From 2f49a0d95a8ce7a3b704a24fd7b034e7e671bbbc Mon Sep 17 00:00:00 2001 From: kshithijiyer Date: Fri, 4 Sep 2020 14:06:58 +0530 Subject: [Testfix] Fix hostname issue with special file cases Problem: The code fails if we have give hostname in glusto-tests config file. This is becuase we have a converstion logic present in the testcase which converts IP to hostname. Solution: Adding code to check if it's an IP and then only run the code to convert it. Change-Id: I3bb1a566d469a4c32161c91fa610da378d46e77e Signed-off-by: kshithijiyer --- tests/functional/dht/test_pipe_character_and_block_device_files.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/functional/dht/test_pipe_character_and_block_device_files.py b/tests/functional/dht/test_pipe_character_and_block_device_files.py index 02e7f8f3f..8a3739b83 100644 --- a/tests/functional/dht/test_pipe_character_and_block_device_files.py +++ b/tests/functional/dht/test_pipe_character_and_block_device_files.py @@ -147,9 +147,9 @@ class TestPipeCharacterAndBlockDeviceFiles(GlusterBaseClass): self.assertTrue(ret, "Unable to find file {} on brick {}" .format(fname, path)) brick_text = brick_path.split('/')[:-1] - brick_text[0] = gethostbyname(brick_text[0][:-1]) + ":" - present_brick_list.append( - '/'.join(brick_text)) + if brick_text[0][0:2].isdigit(): + brick_text[0] = gethostbyname(brick_text[0][:-1]) + ":" + present_brick_list.append('/'.join(brick_text)) # Check on other bricks where file doesn't exist brick_list = get_all_bricks(self.mnode, self.volname) -- cgit