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

HDFS Credential Provider related Unit Test Failure

    XMLWordPrintableJSON

Details

    • Test
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.1
    • 2.6.0
    • encryption
    • None
    • Reviewed

    Description

      Reported by: Xiaomara and investigated by cnauroth.

      The credential provider related unit tests failed on Windows. The tests try to set up a URI by taking the build test directory and concatenating it with other strings containing the rest of the URI format, i.e.:

        public void testFactory() throws Exception {
          Configuration conf = new Configuration();
          conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH,
              UserProvider.SCHEME_NAME + ":///," +
                  JavaKeyStoreProvider.SCHEME_NAME + "://file" + tmpDir + "/test.jks");
      

      This logic is incorrect on Windows, because the file path separator will be '\', which violates URI syntax. Forward slash is not permitted.

      The proper fix is to always do path/URI construction through the org.apache.hadoop.fs.Path class, specifically using the constructors that take explicit parent and child arguments.

      The affected unit tests are:

      * TestCryptoAdminCLI
      * TestDFSUtil
      * TestEncryptionZones
      * TestReservedRawPaths
      

      Attachments

        1. HDFS-7025.1.patch
          7 kB
          Xiaoyu Yao
        2. HDFS-7025.0.patch
          5 kB
          Xiaoyu Yao

        Activity

          People

            xyao Xiaoyu Yao
            xyao Xiaoyu Yao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: