Close remote connections after using checkers.check_public_ping()

Change-Id: Ib24837db8c4cc2e7a90f4fbd1b4c6b950ecce5b4
Related-Bug:#1483756
This commit is contained in:
Dennis Dmitriev 2015-08-13 19:05:22 +03:00
parent ad50912d9d
commit 71abe120b4
6 changed files with 22 additions and 25 deletions

View File

@ -1017,17 +1017,16 @@ def check_repo_managment(remote):
remote.check_call(cmd) remote.check_call(cmd)
def check_public_ping(remotes): def check_public_ping(remote):
""" Check if ping public vip """ Check if ping public vip
:type remotes: list :type remote: SSHClient object
""" """
cmd = ('ruby /etc/puppet/modules/osnailyfacter/' cmd = ('ruby /etc/puppet/modules/osnailyfacter/'
'modular/virtual_ips/public_vip_ping_post.rb') 'modular/virtual_ips/public_vip_ping_post.rb')
for remote in remotes: res = remote.execute(cmd)
res = remote.execute(cmd) assert_equal(0, res['exit_code'],
assert_equal(0, res['exit_code'], 'Public ping check failed:'
'Public ping check failed:' ' {0}'.format(res))
' {0}'.format(res))
def check_cobbler_node_exists(remote, node_id): def check_cobbler_node_exists(remote, node_id):

View File

@ -485,9 +485,9 @@ class FuelWebClient(object):
if MULTIPLE_NETWORKS: if MULTIPLE_NETWORKS:
node_groups = {n['name']: [] for n in NODEGROUPS} node_groups = {n['name']: [] for n in NODEGROUPS}
self.update_nodegroups(cluster_id, node_groups) self.update_nodegroups(cluster_id, node_groups)
for NODEGROUP in NODEGROUPS: for nodegroup in NODEGROUPS:
self.update_network_configuration(cluster_id, self.update_network_configuration(cluster_id,
nodegroup=NODEGROUP) nodegroup=nodegroup)
else: else:
self.update_network_configuration(cluster_id) self.update_network_configuration(cluster_id)
@ -1205,7 +1205,7 @@ class FuelWebClient(object):
timeout=60 * 2) timeout=60 * 2)
node = self.get_nailgun_node_by_devops_node(devops_node) node = self.get_nailgun_node_by_devops_node(devops_node)
assert_true(node['online'], assert_true(node['online'],
'Node {} is online'.format(node['mac'])) 'Node {0} is offline'.format(node['mac']))
if custom_names: if custom_names:
name = custom_names.get(node_name, name = custom_names.get(node_name,
@ -1213,7 +1213,7 @@ class FuelWebClient(object):
node_name, node_name,
"_".join(node_roles))) "_".join(node_roles)))
else: else:
name = '{}_{}'.format(node_name, "_".join(node_roles)) name = '{0}_{1}'.format(node_name, "_".join(node_roles))
node_data = { node_data = {
'cluster_id': cluster_id, 'cluster_id': cluster_id,

View File

@ -19,7 +19,6 @@ from proboscis.asserts import assert_equal
from proboscis.asserts import assert_true from proboscis.asserts import assert_true
from proboscis import test from proboscis import test
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers.decorators import log_snapshot_after_test from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.helpers.eb_tables import Ebtables from fuelweb_test.helpers.eb_tables import Ebtables
from fuelweb_test.helpers import os_actions from fuelweb_test.helpers import os_actions

View File

@ -138,7 +138,7 @@ class TestMultipleClusterNets(TestBasic):
6. Run health checks (OSTF) 6. Run health checks (OSTF)
Duration 110m Duration 110m
Snapshot deploy_neutron_tun_ha_nodegroups Snapshot deploy_ceph_ha_nodegroups
""" """
@ -178,4 +178,4 @@ class TestMultipleClusterNets(TestBasic):
self.fuel_web.deploy_cluster_wait(cluster_id, timeout=150 * 60) self.fuel_web.deploy_cluster_wait(cluster_id, timeout=150 * 60)
self.fuel_web.verify_network(cluster_id) self.fuel_web.verify_network(cluster_id)
self.fuel_web.run_ostf(cluster_id=cluster_id) self.fuel_web.run_ostf(cluster_id=cluster_id)
self.env.make_snapshot("deploy_neutron_tun_ha_nodegroups") self.env.make_snapshot("deploy_ceph_ha_nodegroups")

View File

@ -128,12 +128,9 @@ class TestHaFailoverBase(TestBasic):
os_conn, smiles_count=16, networks_count=1, timeout=300) os_conn, smiles_count=16, networks_count=1, timeout=300)
self.fuel_web.verify_network(cluster_id) self.fuel_web.verify_network(cluster_id)
# Bug #1289297. Pause 5 min to make sure that all remain activity for node in ['slave-0{0}'.format(slave) for slave in xrange(1, 4)]:
# on the admin node has over before creating a snapshot. with self.fuel_web.get_ssh_for_node(node) as remote:
time.sleep(5 * 60) check_public_ping(remote)
remotes = [self.fuel_web.get_ssh_for_node(node) for node
in ['slave-0{0}'.format(slave) for slave in xrange(1, 4)]]
check_public_ping(remotes)
self.env.make_snapshot(self.snapshot_name, is_make=True) self.env.make_snapshot(self.snapshot_name, is_make=True)

View File

@ -87,10 +87,10 @@ class TestNeutronFailover(base_test_case.TestBasic):
groups=["deploy_ha_neutron"]) groups=["deploy_ha_neutron"])
@log_snapshot_after_test @log_snapshot_after_test
def deploy_ha_neutron(self): def deploy_ha_neutron(self):
"""Deploy cluster in HA mode, Neutron with GRE segmentation """Deploy cluster in HA mode, Neutron with VXLAN segmentation
Scenario: Scenario:
1. Create cluster. HA, Neutron with GRE segmentation 1. Create cluster. HA, Neutron with VXLAN segmentation
2. Add 3 nodes with controller roles 2. Add 3 nodes with controller roles
3. Add 2 nodes with compute roles 3. Add 2 nodes with compute roles
4. Add 1 node with cinder role 4. Add 1 node with cinder role
@ -128,9 +128,11 @@ class TestNeutronFailover(base_test_case.TestBasic):
} }
) )
self.fuel_web.deploy_cluster_wait(cluster_id) self.fuel_web.deploy_cluster_wait(cluster_id)
remotes = [self.fuel_web.get_ssh_for_node(node) for node
in ['slave-0{0}'.format(slave) for slave in xrange(1, 4)]] for node in ['slave-0{0}'.format(slave) for slave in xrange(1, 4)]:
checkers.check_public_ping(remotes) with self.fuel_web.get_ssh_for_node(node) as remote:
checkers.check_public_ping(remote)
self.env.make_snapshot("deploy_ha_neutron", is_make=True) self.env.make_snapshot("deploy_ha_neutron", is_make=True)
@test(depends_on=[deploy_ha_neutron], @test(depends_on=[deploy_ha_neutron],