From 921040b0b25cbd4835a93b78b60271cd6d35ceb8 Mon Sep 17 00:00:00 2001 From: Lukas Oyen Date: Mon, 2 Jan 2017 16:41:34 +0100 Subject: [PATCH] Bug #34216: reduce flakiness in 91_samba4_gpc_two_way_replication --- ucs-test-ucsschool/90_ucsschool/91_samba4_gpc_two_way_replication | 2 +- ucs-test-ucsschool/90_ucsschool/essential/test_samba4.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ucs-test-ucsschool/90_ucsschool/91_samba4_gpc_two_way_replication b/ucs-test-ucsschool/90_ucsschool/91_samba4_gpc_two_way_replication index d7e9e66..422a53a 100755 --- a/ucs-test-ucsschool/90_ucsschool/91_samba4_gpc_two_way_replication +++ b/ucs-test-ucsschool/90_ucsschool/91_samba4_gpc_two_way_replication @@ -138,7 +138,7 @@ class TestGPCReplicationTwoWays(TestSamba4): replication from. """ print("\nCurrent server role is DC-Master, trying to find a DC-Slave in the domain for the test") - udm_stdout = self.get_udm_list_dc_slaves_with_samba4() + udm_stdout = self.get_udm_list_dc_slaves_with_samba4(with_ucsschool=True) if "serverRole: slave" not in udm_stdout.strip(): print( diff --git a/ucs-test-ucsschool/90_ucsschool/essential/test_samba4.py b/ucs-test-ucsschool/90_ucsschool/essential/test_samba4.py index 7947133..da24356 100644 --- a/ucs-test-ucsschool/90_ucsschool/essential/test_samba4.py +++ b/ucs-test-ucsschool/90_ucsschool/essential/test_samba4.py @@ -118,7 +118,7 @@ class TestSamba4(object): utils.fail("An error occured while running a sed command '%s':\n'%s'" % (" ".join(cmd), stderr)) return stdout - def get_udm_list_dcs(self, dc_type, with_samba4=True): + def get_udm_list_dcs(self, dc_type, with_samba4=True, with_ucsschool=False): """ Runs the "udm computers/'dc_type' list" and returns the output. If 'with_samba4' is 'True' returns only those running Samba 4. @@ -131,18 +131,20 @@ class TestSamba4(object): cmd = ("udm", "computers/" + dc_type, "list") if with_samba4: cmd += ("--filter", "service=Samba 4") + if with_ucsschool: + cmd += ("--filter", "service=UCS@school") stdout, stderr = self.create_and_run_process(cmd) if stderr: utils.fail("An error occured while running a '%s' command to find all '%s' in the domain:\n'%s'" % (" ".join(cmd), dc_type, stderr)) return stdout - def get_udm_list_dc_slaves_with_samba4(self): + def get_udm_list_dc_slaves_with_samba4(self, with_ucsschool=False): """ Returns the output of "udm computers/domaincontroller_slave list --filter service=Samba 4" command. """ - return self.get_udm_list_dcs("domaincontroller_slave") + return self.get_udm_list_dcs("domaincontroller_slave", with_ucsschool=with_ucsschool) def select_school_ou(self, schoolname_only=False): """ -- 2.7.4