Example #1
0
    def test_use_datanode_hostname(self, environ_get):
        environ_get.return_value = False
        # no snakebiterc
        # read external config (hdfs-site, core-site)
        self.parser.args = MockParseArgs()
        try:
            HDFSConfig.core_try_paths = (ConfigTest.get_config_path('ha-core-site.xml'),)
            HDFSConfig.hdfs_try_paths = (ConfigTest.get_config_path('use-datanode-hostname-hdfs-site.xml'),)
            self.parser.init()

            self.assertTrue(self.parser.client.use_datanode_hostname)
        finally:
            self._revert_hdfs_try_paths()
    def test_cl_usetrash_setting_preserved_after_external_nontrash_config(self, environ_get):
        environ_get.return_value = False
        # no snakebiterc
        # read external config (hdfs-site, core-site)
        self.parser.args = MockParseArgs(dir=["/user/rav/test"], usetrash=True, command="rm")
        try:
            HDFSConfig.core_try_paths = (ConfigTest.get_config_path("ha-core-site.xml"),)
            HDFSConfig.hdfs_try_paths = (ConfigTest.get_config_path("ha-noport-hdfs-site.xml"),)
            self.parser.init()

            self.assertTrue(self.parser.args.usetrash)
            self.assertTrue(self.parser.client.use_trash)
        finally:
            self._revert_hdfs_try_paths()
Example #3
0
    def test_cl_usetrash_setting_preserved_after_external_nontrash_config(self, environ_get):
        environ_get.return_value = False
        # no snakebiterc
        # read external config (hdfs-site, core-site)
        self.parser.args = MockParseArgs(dir=["/user/rav/test"],
                                         usetrash=True,
                                         command="rm")
        try:
            HDFSConfig.core_try_paths = (ConfigTest.get_config_path('ha-core-site.xml'),)
            HDFSConfig.hdfs_try_paths = (ConfigTest.get_config_path('ha-noport-hdfs-site.xml'),)
            self.parser.init()

            self.assertTrue(self.parser.args.usetrash)
            self.assertTrue(self.parser.client.use_trash)
        finally:
            self._revert_hdfs_try_paths()