Skip to content

Commit 8d75b44

Browse files
authored
Skip tests working only on upstream/RHGS accordingly (#1209)
* Marked tests working only on upstream/RHGS Signed-off-by: nik-redhat <[email protected]> * Fix skip check Signed-off-by: nik-redhat <[email protected]>
1 parent 8a2fef0 commit 8d75b44

13 files changed

+46
-17
lines changed

common/ops/support_ops/machine_ops.py

+16-5
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,15 @@ def check_hardware_requirements(self, servers: list = None,
428428
raise Exception(f"The test case requires {bricks_count}"
429429
" bricks per node to run the test")
430430

431-
def check_rhgs_installation(self, servers: list):
431+
def check_gluster_installation(self, servers: list, inst_type: str):
432432
"""
433-
Method to check if the RHGS is installed on the servers
433+
Method to check if the type of gluster installation on the servers
434+
That is upstream/downstream.
434435
435436
Args:
436437
servers (list): List of server nodes
437438
438-
NOTE: This might not be the best way to check for RHGS, but it works
439+
NOTE: This might not be the best way to check, but it works
439440
for now
440441
"""
441442
if not isinstance(servers, list):
@@ -445,15 +446,25 @@ def check_rhgs_installation(self, servers: list):
445446
cmd = "rpm -qa | grep 'gluster' | grep '6\.0-'"
446447
ret = self.execute_command_multinode(cmd, servers)
447448
for each_ret in ret:
448-
if each_ret['error_code'] != 0:
449+
if inst_type == "upstream" and each_ret['error_code'] == 0:
450+
self.TEST_RES[0] = None
451+
raise Exception("The test case requires Upstream "
452+
"installation")
453+
454+
elif inst_type == "downstream" and each_ret['error_code'] != 0:
449455
self.TEST_RES[0] = None
450456
raise Exception("The test case requires RHGS Installation")
451457

452458
# Check for RHEL env
453459
cmd = "rpm -qa | grep 'gluster' | grep '\.el'"
454460
ret = self.execute_command_multinode(cmd, servers)
455461
for each_ret in ret:
456-
if each_ret['error_code'] != 0:
462+
if inst_type == "upstream" and each_ret['error_code'] == 0:
463+
self.TEST_RES[0] = None
464+
raise Exception("The test case requires Upstream "
465+
"installation")
466+
467+
elif inst_type == "downstream" and each_ret['error_code'] != 0:
457468
self.TEST_RES[0] = None
458469
raise Exception("The test case requires RHGS Installation")
459470

config/config.yml

-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ excluded_tests:
7777
- tests/functional/arbiter/test_self_heal_50k_files.py # Taking a lot of time, needs to be debugged
7878
- tests/functional/arbiter/test_self_heal_50k_files_heal_command_by_add_brick.py # Same as above
7979
- tests/functional/arbiter/test_create_snapshot_and_verify_content.py # Excluded in RHGS CI test
80-
- tests/functional/glusterd/test_localtime_logging_and_opversion_negative_case.py # localtime-logging option not available in RHGS
81-
- tests/functional/glusterd/test_rebalance_start_not_failed_with_socket_path_too_long.py # Doesn't work on RHGS installation
8280
- tests/functional/glusterd/test_glusterd_selinux.py # Issue with SELinux in CI
8381
- tests/functional/glusterd/test_glusterd_memory_consumption_increase.py # Memory consumption not consistent
8482
- tests/functional/glusterd/test_shared_storage.py # Fails in CI, because of a known issue with shared_storage mounting after reboot in env having ipv6 enabled

tests/functional/arbiter/test_create_snapshot_and_verify_content.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def setup_test(self):
3535
"""
3636
# Check for RHGS installation, as snapshot restore throws
3737
# error in upstream devel code
38-
self.redant.check_rhgs_installation(self.server_list)
38+
self.redant.check_gluster_installation(self.server_list, "downstream")
3939

4040
conf_hash = deepcopy(self.vol_type_inf[self.volume_type])
4141
self.redant.setup_volume(self.vol_name, self.server_list[0],

tests/functional/dht/test_add_brick_rebalance_with_self_heal_in_progress.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def setup_test(self):
3535
self.is_copy_running = False
3636

3737
# Skip test if not RHGS installation
38-
self.redant.check_rhgs_installation(self.server_list)
38+
self.redant.check_gluster_installation(self.server_list, "downstream")
3939

4040
self.redant.setup_volume(self.vol_name, self.server_list[0],
4141
self.vol_type_inf[self.volume_type],

tests/functional/dht/test_rebalance_add_brick_and_lookup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def setup_test(self):
3232
Override the volume create, start and mount in parent_run_test
3333
"""
3434
# Run TC only on RHGS installation
35-
self.redant.check_rhgs_installation(self.server_list)
35+
self.redant.check_gluster_installation(self.server_list, "downstream")
3636

3737
conf_hash = self.vol_type_inf[self.volume_type]
3838
self.redant.setup_volume(self.vol_name, self.server_list[0],

tests/functional/dht/test_wipe_out_directory_permissions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def setup_test(self):
3030
Override the volume create, start and mount in parent_run_test
3131
"""
3232
# Skip test if not RHGS installation
33-
self.redant.check_rhgs_installation(self.server_list)
33+
self.redant.check_gluster_installation(self.server_list, "downstream")
3434

3535
conf_hash = deepcopy(self.vol_type_inf[self.volume_type])
3636
conf_hash['dist_count'] = 1

tests/functional/glusterd/test_default_ping_timer_and_epoll_thread_count.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ def run_test(self, redant):
3737
5. Fetch the pid of glusterd
3838
6. Check epoll thread count of glusterd should be 1
3939
"""
40+
# Skip if not RHGS installation
41+
redant.check_gluster_installation(self.server_list, "downstream")
42+
4043
# Fetch the ping timeout value from glusterd.vol file
41-
# TODO: this path might change as per the installation
42-
cmd = "cat /etc/glusterfs/glusterd.vol |\
43-
grep -i ping-timeout"
44+
cmd = "cat /etc/glusterfs/glusterd.vol | grep -i ping-timeout"
4445

4546
ret = redant.execute_command(cmd, self.server_list[0])
4647
out = ret['msg'][0]

tests/functional/glusterd/test_glusterd_friend_updates_on_node_rejoin.py

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def run_test(self, redant):
3636
glusterd was running
3737
3. Check friend updates between rejoined node to each other node
3838
"""
39+
# Skip if not RHGS installation
40+
redant.check_gluster_installation(self.server_list, "downstream")
41+
3942
# Restart glusterd on one of the node
4043
redant.restart_glusterd(self.server_list[0])
4144

tests/functional/glusterd/test_localtime_logging_and_opversion_negative_case.py

+13
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@
2525

2626
class TestCase(DParentTest):
2727

28+
@DParentTest.setup_custom_enable
29+
def setup_test(self):
30+
"""
31+
Override the volume create, start and mount in parent_run_test
32+
"""
33+
# Skip if RHGS installation
34+
self.redant.check_gluster_installation(self.server_list, "upstream")
35+
36+
conf_hash = self.vol_type_inf[self.volume_type]
37+
self.redant.setup_volume(self.vol_name, self.server_list[0],
38+
conf_hash, self.server_list,
39+
self.brick_roots)
40+
2841
def _logging_time_check(self):
2942
"""
3043
Check if the logging is done in localtime

tests/functional/glusterd/test_rebalance_start_not_failed_with_socket_path_too_long.py

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def run_test(self, redant):
5454
6. Perform add-brick for disperse volume 6 bricks
5555
7. Start rebalance of disperse volume
5656
"""
57+
# Skip if RHGS installation
58+
self.redant.check_gluster_installation(self.server_list, "upstream")
59+
5760
cmd = ("sed -i 's/end-volume/option transport.socket.bind-address"
5861
f" {self.server_list[0]}\\n&/g' /etc/glusterfs/glusterd.vol")
5962

tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def setup_test(self):
3232
Override the volume create, start and mount in parent_run_test
3333
"""
3434
# Skip test if not RHGS installation
35-
self.redant.check_rhgs_installation(self.server_list)
35+
self.redant.check_gluster_installation(self.server_list, "downstream")
3636

3737
self.redant.setup_volume(self.vol_name, self.server_list[0],
3838
self.vol_type_inf[self.volume_type],

tests/functional/snapshot/test_snapshot_create.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def setup_test(self):
3636
self.validate_io_procs = False
3737

3838
# Skip test if not RHGS installation
39-
self.redant.check_rhgs_installation(self.server_list)
39+
self.redant.check_gluster_installation(self.server_list, "downstream")
4040

4141
self.redant.setup_volume(self.vol_name, self.server_list[0],
4242
self.vol_type_inf[self.volume_type],

tests/functional/snapshot/test_validate_snap_del_gd_down.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def setup_test(self):
3535
Override the volume create, start in parent_run_test
3636
"""
3737
# Skip test if not RHGS installation
38-
self.redant.check_rhgs_installation(self.server_list)
38+
self.redant.check_gluster_installation(self.server_list, "downstream")
3939

4040
self.redant.setup_volume(self.vol_name, self.server_list[0],
4141
self.vol_type_inf[self.volume_type],

0 commit comments

Comments
 (0)