diff --git a/fuelweb_test/models/fuel_web_client.py b/fuelweb_test/models/fuel_web_client.py index 43884263e..ca2f6f401 100644 --- a/fuelweb_test/models/fuel_web_client.py +++ b/fuelweb_test/models/fuel_web_client.py @@ -2004,9 +2004,9 @@ class FuelWebClient(object): @logwrap def get_nailgun_primary_node(self, slave, role='primary-controller'): # returns controller or mongo that is primary in nailgun - remote = self.get_ssh_for_node(slave.name) - data = yaml.load(''.join( - remote.execute('cat /etc/astute.yaml')['stdout'])) + with self.get_ssh_for_node(slave.name) as remote: + data = yaml.load(''.join( + remote.execute('cat /etc/astute.yaml')['stdout'])) node_name = [node['fqdn'] for node in data['nodes'] if node['role'] == role][0] logger.debug("node name is {0}".format(node_name)) diff --git a/fuelweb_test/tests/tests_strength/test_failover.py b/fuelweb_test/tests/tests_strength/test_failover.py index 867fc6b1c..e4fec8b04 100644 --- a/fuelweb_test/tests/tests_strength/test_failover.py +++ b/fuelweb_test/tests/tests_strength/test_failover.py @@ -73,13 +73,10 @@ class TestHaNeutronFailover(TestHaFailoverBase): Scenario: 1. Block traffic on br-mgmt of the first controller 2. Check pacemaker status - 3. Revert environment - 4. Block traffic on br-mgmt of the second controller - 5. Check pacemaker status - 6. Wait until MySQL Galera is UP on some controller - 7. Run OSTF + 3. Wait until MySQL Galera is UP on some controller + 4. Run OSTF - Duration 45m + Duration 15m """ super(self.__class__, self).ha_disconnect_controllers() diff --git a/fuelweb_test/tests/tests_strength/test_failover_base.py b/fuelweb_test/tests/tests_strength/test_failover_base.py index 4642a5696..ef9d5b8fa 100644 --- a/fuelweb_test/tests/tests_strength/test_failover_base.py +++ b/fuelweb_test/tests/tests_strength/test_failover_base.py @@ -162,10 +162,11 @@ class TestHaFailoverBase(TestBasic): should_fail=1) def ha_disconnect_controllers(self): - if not self.env.d_env.has_snapshot(self.snapshot_name): + if not self.env.revert_snapshot(self.snapshot_name): raise SkipTest() - self.env.revert_snapshot(self.snapshot_name) + cluster_id = self.fuel_web.client.get_cluster_id( + self.__class__.__name__) with self.fuel_web.get_ssh_for_node( self.env.d_env.nodes().slaves[0].name) as remote: @@ -174,9 +175,6 @@ class TestHaFailoverBase(TestBasic): 'iptables -I OUTPUT -o br-mgmt -j DROP') remote.check_call(cmd) - cluster_id = self.fuel_web.client.get_cluster_id( - self.__class__.__name__) - # Wait until MySQL Galera is UP on some controller self.fuel_web.wait_mysql_galera_is_up(['slave-02']) try: