Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10657

testAclCLI.xml setfacl test should expect mask r-x

    Details

    • Type: Test
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.8.0, 3.0.0-alpha2
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      The following test case should expect mask::r-x ACL entry instead of mask::rwx:

            <description>setfacl : check inherit default ACL to dir</description>
            <test-commands>
              <command>-fs NAMENODE -mkdir /dir1</command>
              <command>-fs NAMENODE -setfacl -m default:user:charlie:r-x,default:group:admin:rwx /dir1</command>
              <command>-fs NAMENODE -mkdir /dir1/dir2</command>
              <command>-fs NAMENODE -getfacl /dir1/dir2</command>
      ...
              <comparator>
                <type>SubstringComparator</type>
                <expected-output>mask::rwx</expected-output>
              </comparator>
      

      But why does it pass? Because the comparator type is SubstringComparator and it matches the wrong line default:mask::rwx in the output of getfacl:

      # file: /dir1/dir2
      # owner: jzhuge
      # group: supergroup
      user::rwx
      user:charlie:r-x
      group::r-x
      group:admin:rwx	#effective:r-x
      mask::r-x
      other::r-x
      default:user::rwx
      default:user:charlie:r-x
      default:group::r-x
      default:group:admin:rwx
      default:mask::rwx
      default:other::r-x
      

      The comparator should match the entire line instead of just substring. Other comparators in testAclCLI.xml have the same problem.

        Activity

        Hide
        jzhuge John Zhuge added a comment -

        Change the type to RegexpComparator and set expected-output to ^mask::r-x$.

        Is it worthwhile to create a new type ExactLineComparator? With the new type, expected-output can be mask::r-x

        Show
        jzhuge John Zhuge added a comment - Change the type to RegexpComparator and set expected-output to ^mask::r-x$ . Is it worthwhile to create a new type ExactLineComparator ? With the new type, expected-output can be mask::r-x
        Hide
        vinayrpet Vinayakumar B added a comment -

        Thanks John Zhu for the catch.

        Is it worthwhile to create a new type ExactLineComparator? With the new type, expected-output can be mask::r-x

        I think that sounds cool.

        Show
        vinayrpet Vinayakumar B added a comment - Thanks John Zhu for the catch. Is it worthwhile to create a new type ExactLineComparator? With the new type, expected-output can be mask::r-x I think that sounds cool.
        Hide
        jzhuge John Zhuge added a comment -

        Patch 001:

        • Expect mask r-x, not rwx
        • Add a new ExactLineComparator that match an expected string with an entire line in the multi-line output string
        Show
        jzhuge John Zhuge added a comment - Patch 001: Expect mask r-x, not rwx Add a new ExactLineComparator that match an expected string with an entire line in the multi-line output string
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 17s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 2 new or modified test files.
        0 mvndep 1m 34s Maven dependency ordering for branch
        +1 mvninstall 7m 12s trunk passed
        +1 compile 7m 1s trunk passed
        +1 checkstyle 1m 26s trunk passed
        +1 mvnsite 2m 13s trunk passed
        +1 mvneclipse 0m 27s trunk passed
        +1 findbugs 3m 7s trunk passed
        +1 javadoc 1m 41s trunk passed
        0 mvndep 0m 14s Maven dependency ordering for patch
        +1 mvninstall 1m 24s the patch passed
        +1 compile 6m 47s the patch passed
        +1 javac 6m 47s the patch passed
        +1 checkstyle 1m 23s the patch passed
        +1 mvnsite 1m 50s the patch passed
        +1 mvneclipse 0m 25s the patch passed
        -1 whitespace 0m 0s The patch has 4 line(s) that end in whitespace. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply
        +1 xml 0m 2s The patch has no ill-formed XML file.
        +1 findbugs 3m 23s the patch passed
        +1 javadoc 1m 40s the patch passed
        +1 unit 7m 24s hadoop-common in the patch passed.
        +1 unit 60m 24s hadoop-hdfs in the patch passed.
        +1 asflicense 0m 24s The patch does not generate ASF License warnings.
        111m 11s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Issue HDFS-10657
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827842/HDFS-10657.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle xml
        uname Linux e344256c8523 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / cba973f
        Default Java 1.8.0_101
        findbugs v3.0.0
        whitespace https://builds.apache.org/job/PreCommit-HDFS-Build/16697/artifact/patchprocess/whitespace-eol.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16697/testReport/
        modules C: hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs U: .
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16697/console
        Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 17s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 2 new or modified test files. 0 mvndep 1m 34s Maven dependency ordering for branch +1 mvninstall 7m 12s trunk passed +1 compile 7m 1s trunk passed +1 checkstyle 1m 26s trunk passed +1 mvnsite 2m 13s trunk passed +1 mvneclipse 0m 27s trunk passed +1 findbugs 3m 7s trunk passed +1 javadoc 1m 41s trunk passed 0 mvndep 0m 14s Maven dependency ordering for patch +1 mvninstall 1m 24s the patch passed +1 compile 6m 47s the patch passed +1 javac 6m 47s the patch passed +1 checkstyle 1m 23s the patch passed +1 mvnsite 1m 50s the patch passed +1 mvneclipse 0m 25s the patch passed -1 whitespace 0m 0s The patch has 4 line(s) that end in whitespace. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply +1 xml 0m 2s The patch has no ill-formed XML file. +1 findbugs 3m 23s the patch passed +1 javadoc 1m 40s the patch passed +1 unit 7m 24s hadoop-common in the patch passed. +1 unit 60m 24s hadoop-hdfs in the patch passed. +1 asflicense 0m 24s The patch does not generate ASF License warnings. 111m 11s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HDFS-10657 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827842/HDFS-10657.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle xml uname Linux e344256c8523 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / cba973f Default Java 1.8.0_101 findbugs v3.0.0 whitespace https://builds.apache.org/job/PreCommit-HDFS-Build/16697/artifact/patchprocess/whitespace-eol.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16697/testReport/ modules C: hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs U: . Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16697/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        yzhangal Yongjun Zhang added a comment -

        HI John Zhuge,

        Nice catch of the issue and thanks for working on it. The patch looks good to me.

        I will commit next Monday, I will strip the white space before commit..

        Thanks.

        Show
        yzhangal Yongjun Zhang added a comment - HI John Zhuge , Nice catch of the issue and thanks for working on it. The patch looks good to me. I will commit next Monday, I will strip the white space before commit.. Thanks.
        Hide
        jzhuge John Zhuge added a comment -

        Thanks Yongjun Zhang.

        Show
        jzhuge John Zhuge added a comment - Thanks Yongjun Zhang .
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10430 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10430/)
        HDFS-10657. testAclCLI.xml setfacl test should expect mask r-x. (John (yzhang: rev d2466ec3e01b5ef2a0bde738232c5ad6d2d956eb)

        • (add) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/cli/util/ExactLineComparator.java
        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testAclCLI.xml
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10430 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10430/ ) HDFS-10657 . testAclCLI.xml setfacl test should expect mask r-x. (John (yzhang: rev d2466ec3e01b5ef2a0bde738232c5ad6d2d956eb) (add) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/cli/util/ExactLineComparator.java (edit) hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testAclCLI.xml
        Hide
        yzhangal Yongjun Zhang added a comment -

        Committed to trunk, branch-2 and branch-2.8.

        Thanks John Zhuge for the contribution, and Vinayakumar B for the input.

        Show
        yzhangal Yongjun Zhang added a comment - Committed to trunk, branch-2 and branch-2.8. Thanks John Zhuge for the contribution, and Vinayakumar B for the input.
        Hide
        jzhuge John Zhuge added a comment -

        Thank you Yongjun Zhang for the review and commit, Vinayakumar B for the encouragement.

        Show
        jzhuge John Zhuge added a comment - Thank you Yongjun Zhang for the review and commit, Vinayakumar B for the encouragement.

          People

          • Assignee:
            jzhuge John Zhuge
            Reporter:
            jzhuge John Zhuge
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development