Merge "Revert "Test quorum number of controller nodes hard shutdown""

This commit is contained in:
Zuul 2021-04-26 10:27:16 +00:00 committed by Gerrit Code Review
commit 2ef60ae638
4 changed files with 4 additions and 24 deletions

View File

@ -77,7 +77,6 @@ RebootHostMethod = _reboot.RebootHostMethod
crash_method = RebootHostMethod.CRASH crash_method = RebootHostMethod.CRASH
hard_reset_method = RebootHostMethod.HARD hard_reset_method = RebootHostMethod.HARD
soft_reset_method = RebootHostMethod.SOFT soft_reset_method = RebootHostMethod.SOFT
hard_shutdown_method = RebootHostMethod.HARD_SHUTDOWN
ssh_process = _ssh.ssh_process ssh_process = _ssh.ssh_process
ssh_execute = _ssh.ssh_execute ssh_execute = _ssh.ssh_execute

View File

@ -32,8 +32,6 @@ class RebootHostMethod(enum.Enum):
SOFT = '/sbin/reboot', SOFT = '/sbin/reboot',
HARD = 'echo 1 > /proc/sys/kernel/sysrq && echo b > /proc/sysrq-trigger', HARD = 'echo 1 > /proc/sys/kernel/sysrq && echo b > /proc/sysrq-trigger',
CRASH = 'echo 1 > /proc/sys/kernel/sysrq && echo c > /proc/sysrq-trigger', CRASH = 'echo 1 > /proc/sys/kernel/sysrq && echo c > /proc/sysrq-trigger',
HARD_SHUTDOWN = \
'echo 1 > /proc/sys/kernel/sysrq && echo o > /proc/sysrq-trigger',
def __init__(self, command: str): def __init__(self, command: str):
self.command = command self.command = command
@ -55,7 +53,7 @@ def reboot_host(ssh_client: ssh.SSHClientFixture,
timeout=timeout, timeout=timeout,
method=method) method=method)
tobiko.setup_fixture(reboot) tobiko.setup_fixture(reboot)
if method != RebootHostMethod.HARD_SHUTDOWN and wait: if wait:
reboot.wait_for_operation() reboot.wait_for_operation()
return reboot return reboot

View File

@ -192,12 +192,6 @@ def reboot_all_controller_nodes(reboot_method=sh.hard_reset_method,
check_overcloud_node_responsive(controller) check_overcloud_node_responsive(controller)
def hard_power_off_overcloud_nodes(nodes):
for node in nodes:
sh.reboot_host(ssh_client=node.ssh_client,
method=sh.hard_shutdown_method)
def get_main_vip(): def get_main_vip():
"""return the ip of the overcloud main vip. """return the ip of the overcloud main vip.
Retreive an ip address (ipv4/ipv6) from the auth_url.""" Retreive an ip address (ipv4/ipv6) from the auth_url."""

View File

@ -215,7 +215,7 @@ class DisruptTripleoNodesTest(testtools.TestCase):
cloud_disruptions.request_galera_sst() cloud_disruptions.request_galera_sst()
OvercloudHealthCheck.run_after() OvercloudHealthCheck.run_after()
def _test_controllers_shutdown(self, shutdown_method): def test_controllers_shutdown(self):
all_nodes = topology.list_openstack_nodes(group='controller') all_nodes = topology.list_openstack_nodes(group='controller')
if len(all_nodes) < 3: if len(all_nodes) < 3:
self.skipTest('It requires at least three controller nodes') self.skipTest('It requires at least three controller nodes')
@ -229,10 +229,10 @@ class DisruptTripleoNodesTest(testtools.TestCase):
quorum_level = math.ceil(0.5 * len(all_nodes)) quorum_level = math.ceil(0.5 * len(all_nodes))
assert quorum_level >= len(all_nodes) - quorum_level assert quorum_level >= len(all_nodes) - quorum_level
nodes = random.sample(all_nodes, quorum_level) nodes = random.sample(all_nodes, quorum_level)
LOG.info(f"Power off {quorum_level} random controller nodes: " LOG.info(f"Power off {quorum_level} random controller nodes: "
f"{[node.name for node in nodes]}") f"{[node.name for node in nodes]}")
shutdown_method(nodes) for node in nodes:
node.power_off_overcloud_node()
random.shuffle(nodes) random.shuffle(nodes)
LOG.info("Power on controller nodes: " LOG.info("Power on controller nodes: "
@ -245,17 +245,6 @@ class DisruptTripleoNodesTest(testtools.TestCase):
LOG.info("Verify can create VMs after controllers power on...") LOG.info("Verify can create VMs after controllers power on...")
tests.test_server_creation() tests.test_server_creation()
def test_controllers_shutdown(self):
def shutdown_nodes(nodes):
for node in nodes:
node.power_off_overcloud_node()
self._test_controllers_shutdown(shutdown_nodes)
def test_controllers_hard_power_down(self):
self._test_controllers_shutdown(
cloud_disruptions.hard_power_off_overcloud_nodes)
# [..] # [..]
# more tests to follow # more tests to follow