<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 09/19/2013 05:58 PM, Petr Viktorin
      wrote:<br>
    </div>
    <blockquote cite="mid:523B1F0F.3010101@redhat.com" type="cite">On
      09/17/2013 04:35 PM, Tomas Babej wrote: <br>
      <blockquote type="cite">On 09/17/2013 10:43 AM, Petr Viktorin
        wrote: <br>
        <blockquote type="cite">On 09/16/2013 03:45 PM, Tomas Babej
          wrote: <br>
          <blockquote type="cite">Hi, <br>
            <br>
            this set of patches extends ipatests module to support
            integration <br>
            testing with Active Directory, <br>
            as well as provides an basic (working without artificial
            sleeps!) trust <br>
            test case. <br>
          </blockquote>
          <br>
          Thanks, this is great news! <br>
          I haven't testes the test yet. Here are my comments from
          reading them. <br>
          <br>
          <br>
          Patch 100: <br>
          Please document the new configuration options. There are two
          places: <br>
          - ipa-test-config man page <br>
          - <br>
          <a class="moz-txt-link-freetext"
href="http://www.freeipa.org/page/V3/Integration_testing#Test_configuration">http://www.freeipa.org/page/V3/Integration_testing#Test_configuration</a>
          <br>
          (or if you end up writing a separate design page for AD tests,
          link to <br>
          it) <br>
          <br>
        </blockquote>
        <br>
        I added the options to the the man page. <br>
      </blockquote>
      <br>
      Looks good. <br>
      <br>
      <blockquote type="cite">
        <blockquote type="cite">Patch 101: <br>
          The `if role == 'ad':` block should rather be in the
          `Host.from_env` <br>
          factory. <br>
          <br>
        </blockquote>
        <br>
        Moved. <br>
      </blockquote>
      <br>
      Looks good. <br>
      With my patches for #3890, this should use BaseHost.from_env. <br>
    </blockquote>
    <br>
    Fixed.<br>
    <br>
    <blockquote cite="mid:523B1F0F.3010101@redhat.com" type="cite"> <br>
      <blockquote type="cite">
        <blockquote type="cite">Patch 102: <br>
          Thanks for cleaning that up! <br>
          You could go one step further with <br>
          cls.replicas = get_resources(domain.replicas, 'replicas', <br>
          cls.num_replicas) <br>
          and `return container[:num_needed]` there <br>
        </blockquote>
        <br>
        You're welcome, refactoring part expanded. <br>
      </blockquote>
      <br>
      Looks good. <br>
      <br>
      <blockquote type="cite">
        <blockquote type="cite">Patch 103: <br>
          This patch should come before 101 which uses it. <br>
          <br>
        </blockquote>
        <br>
        We can push this in the correct order if this is an issue,
        right? <br>
        Patches are independent (meaning they do not touch the same
        source code, <br>
        so they should apply cleanly). <br>
      </blockquote>
      <br>
      Sure. <br>
      <br>
      <blockquote type="cite">
        <blockquote type="cite">Ideally there would be a BaseHost with
          common functionality, and <br>
          concrete Host and WinHost subclassing it. <br>
        </blockquote>
        <br>
        Yes, I agree, that's what we discussed. <br>
        <br>
        <blockquote type="cite">I'll be making changes here for #3890;
          please concentrate on other <br>
          parts for now to avoid conflicts. I'll take Windows hosts into
          <br>
          consideration. <br>
        </blockquote>
      </blockquote>
      <br>
      My patches are on the list. Conflicts should be minimal; withthem
      WinHost should end up empty. <br>
    </blockquote>
    <br>
    My patches are now rebased on top of yours.<br>
    <br>
    <blockquote cite="mid:523B1F0F.3010101@redhat.com" type="cite"> <br>
      <blockquote type="cite">
        <blockquote type="cite">Raise instances rather than the
          exception classes: raise <br>
          NotImplementedError() <br>
        </blockquote>
        Fixed. <br>
      </blockquote>
      <br>
      <blockquote type="cite">
        <blockquote type="cite">Patch 104: <br>
        </blockquote>
      </blockquote>
      [...] <br>
      <blockquote type="cite">
        <blockquote type="cite">I'd prefer to keep the function in
          test_trust.py until we see there's <br>
          a wider scope for it. <br>
          And rename it to run_repeatedly or some other name that
          describes it <br>
          better. <br>
          <br>
        </blockquote>
        <br>
        I renamed the function. <br>
      </blockquote>
      <br>
      Thanks <br>
      <br>
      <blockquote type="cite">Why do you think there's not scope for it?
        I'd rather keep it in tasks, <br>
        since it addresses <br>
        a general use case of waiting in a loop until a command returns
        expected <br>
        output. <br>
        <br>
        This can happen with any command that starts asynchronous
        actions and we <br>
        want to make <br>
        sure that the changes are propagated before continuing (such as
        DNS <br>
        updates via our CLI). <br>
        <br>
        I wouldn't consider this being specific for AD trust testing. <br>
      </blockquote>
      <br>
      I'd like to keep tasks to high-level operations, the kind that
      ipa-test-task would do. <br>
      (Putting wait_for_replication there was, in hindsight, a mistake.)
      <br>
      <br>
      We can add an util module later. It's easy to move things to a
      shared module when needed, but if we do it too early and often the
      module will be hard to maintain. Predicting the future in this
      respect hasn't worked very well for me :) <br>
    </blockquote>
    <br>
    I moved that to the util.py. The reason is that this function is
    also used from within AD integration tasks. Having the tasks
    themselves import functions from the testcases does not seem right.<br>
    <br>
    Do you want to move wait_for_replication there as well?<br>
    <br>
    <blockquote cite="mid:523B1F0F.3010101@redhat.com" type="cite"> <br>
      <blockquote type="cite">
        <blockquote type="cite">Patch 105: <br>
          Please add these tasks to ipa-test-task (and its man page) as
          well. <br>
          The instructions in the docstring in configure_dns_for_trust
          should go <br>
          to a test design document. I think just starting a section in
          <br>
          Integration_testing would be fine if you mark it as not
          implemented <br>
          yet (and link to the ticket). <br>
        </blockquote>
      </blockquote>
      <br>
      This still needs some work (unfortunately I haven't found a way to
      make it less tedious). <br>
    </blockquote>
    <br>
    I added the man page section and removed docstrings.<br>
    <br>
    <blockquote cite="mid:523B1F0F.3010101@redhat.com" type="cite"> <br>
      <blockquote type="cite">
        <blockquote type="cite">Use parentheses instead of \ for line
          continuation (see PEP8). <br>
        </blockquote>
        <br>
        I don't really like wrapping arbitrary expressions in
        parentheses, <br>
        particularly when assigning the result to a variable: <br>
        <br>
        result = (something or <br>
                       something_completely_else) <br>
        <br>
        To me, the following looks better: <br>
        <br>
        result = something or \ <br>
                      something completely else <br>
        <br>
        I checked with PEP8. I remember there was a section that
        backslash can <br>
        be used in cases it produces nicer results, but it's gone now. <br>
        Backslash is still recommended in some cases. <br>
        <br>
        Still (but no strong opinions here), I would not consider this a
        <br>
        violation unless it happens between brackets (in which case it
        is <br>
        redundant). <br>
      </blockquote>
      <br>
      Personal opinions aside, the PEP8 is pretty clear on this, sorry.
      It lists `with` and `assert` statements where you can't use
      parentheses around everything after the keyword, but that's not
      case here. <br>
      <br>
    </blockquote>
    <br>
    Fixed. <br>
    <br>
    <blockquote cite="mid:523B1F0F.3010101@redhat.com" type="cite">
      <blockquote type="cite">
        <blockquote type="cite">Patch 106: <br>
          The instructions in the TestADTrust docstring should go to a
          test <br>
          design document. <br>
          <br>
          Please use the SID regex from a shared location. You'll need
          to assign <br>
          it to a variable and make the Fuzzy from that, so that
          variable can be <br>
          imported and used with the standard re module. <br>
          <br>
        </blockquote>
        <br>
        This is something that I tried to address with the Fuzzy
        refactoring. <br>
        This is a temporary solution, once we resolve that patchset, of
        course, <br>
        the test will use the shared location. <br>
        I added a comment there, I'd rather not create conflicts. <br>
      </blockquote>
      <br>
      OK, let's worry about this later. <br>
      <br>
      [...] <br>
      <blockquote type="cite">
        <blockquote type="cite">test_user_gid_uid_resolution_in_nonposix_trust:

          <br>
          - For a one-off regex, compile() is unnecessary: <br>
              assert re.search(testuser_regex, result.stdout_text) <br>
          - Whenever substituting a literal string into a regex, please
          use <br>
          re.escape(). <br>
          <br>
        </blockquote>
        Fixed. <br>
      </blockquote>
      <br>
      Sorry, I meant non-literal and wrote exactly the opposite! This is
      suboptimal: <br>
          self.ad.domain.name.replace('.', '\.') <br>
      This is better: <br>
          re.escape(self.ad.domain.name) <br>
    </blockquote>
    <br>
    Fixed.<br>
    <br>
    <blockquote cite="mid:523B1F0F.3010101@redhat.com" type="cite"> <br>
      <blockquote type="cite"> <br>
        <blockquote type="cite">Use parentheses instead of \ for line
          continuation (see PEP8). <br>
          <br>
          <br>
        </blockquote>
        <br>
        Design will follow soon. <br>
      </blockquote>
      <br>
      Perfect! <br>
      <br>
      <br>
    </blockquote>
    <br>
    Design page draft:<br>
    <br>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <a href="http://www.freeipa.org/page/V3/Integration_testing/AD">http://www.freeipa.org/page/V3/Integration_testing/AD</a><br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Tomas Babej
Associate Software Engeneer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org</pre>
  </body>
</html>