Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:dirkmueller:acdc:sp5-rebuild
pacemaker.10805
0002-Test-cts-temporarily-disable-any-enabled-c...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-Test-cts-temporarily-disable-any-enabled-cluster-ser.patch of Package pacemaker.10805
9394c8a58 Test: cts: temporarily disable any enabled cluster serivces when running remote tests cts/CTStests.py | 27 +++++++++++++++++++++++++++ cts/environment.py | 18 ++++++++++++++++++ 2 files changed, 45 insertions(+) Index: pacemaker-1.1.18+20180430.b12c320f5/cts/CTStests.py =================================================================== --- pacemaker-1.1.18+20180430.b12c320f5.orig/cts/CTStests.py +++ pacemaker-1.1.18+20180430.b12c320f5/cts/CTStests.py @@ -2685,6 +2685,22 @@ class RemoteDriver(CTSTest): if not self.failed: self.remote_node_added = 1 + def disable_services(self, node): + self.corosync_enabled = self.Env.service_is_enabled(node, "corosync") + if self.corosync_enabled: + self.Env.disable_service(node, "corosync") + + self.pacemaker_enabled = self.Env.service_is_enabled(node, "pacemaker") + if self.pacemaker_enabled: + self.Env.disable_service(node, "pacemaker") + + def restore_services(self, node): + if self.corosync_enabled: + self.Env.enable_service(node, "corosync") + + if self.pacemaker_enabled: + self.Env.enable_service(node, "pacemaker") + def stop_pcmk_remote(self, node): # disable pcmk remote for i in range(10): @@ -2714,6 +2730,15 @@ class RemoteDriver(CTSTest): self.rsh(node, "killall -CONT pacemaker_remoted") def start_metal(self, node): + # Cluster nodes are reused as remote nodes in remote tests. If cluster + # services were enabled at boot, in case the remote node got fenced, the + # cluster node would join instead of the expected remote one. Meanwhile + # pacemaker_remote would not be able to start. Depending on the chances, + # the situations might not be able to be orchestrated gracefully any more. + # + # Temporarily disable any enabled cluster serivces. + self.disable_services(node) + pcmk_started = 0 # make sure the resource doesn't already exist for some reason @@ -2886,6 +2911,8 @@ class RemoteDriver(CTSTest): return def cleanup_metal(self, node): + self.restore_services(node) + if self.pcmk_started == 0: return Index: pacemaker-1.1.18+20180430.b12c320f5/cts/environment.py =================================================================== --- pacemaker-1.1.18+20180430.b12c320f5.orig/cts/environment.py +++ pacemaker-1.1.18+20180430.b12c320f5/cts/environment.py @@ -198,6 +198,24 @@ class Environment(object): # default self["syslogd"] = "rsyslog" + def disable_service(self, node, service): + if self["have_systemd"]: + # Systemd + return self.rsh(node, "systemctl disable %s" % service) + + else: + # SYS-V + return self.rsh(node, "chkconfig %s off" % service) + + def enable_service(self, node, service): + if self["have_systemd"]: + # Systemd + return self.rsh(node, "systemctl enable %s" % service) + + else: + # SYS-V + return self.rsh(node, "chkconfig %s on" % service) + def service_is_enabled(self, node, service): if self["have_systemd"]: # Systemd
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor