Refactoring of destructive DVS scenarios
* Create new function to check ping vms * Fix documentation strings Change-Id: I8461728188420f4f6e0db0467a8f48e241298e0f
This commit is contained in:
parent
0b1cb8b6c3
commit
7209f296c6
|
@ -278,7 +278,7 @@ epub_copyright = u'2016, Mirantis Inc.'
|
|||
# The basename for the epub file. It defaults to the project name.
|
||||
# epub_basename = u'fuel-plugin-openbook'
|
||||
|
||||
# The HTML theme for the epub output. Since the default themes are not optimized
|
||||
# The HTML theme for the epub output. Since the default themes are'nt optimized
|
||||
# for small screen space, using the same theme for HTML and epub output is
|
||||
# usually not wise. This defaults to 'epub', a theme designed to save visual
|
||||
# space.
|
||||
|
|
|
@ -16,13 +16,12 @@ import time
|
|||
|
||||
import paramiko
|
||||
import yaml
|
||||
from devops.error import TimeoutError
|
||||
from devops.helpers.helpers import icmp_ping
|
||||
from devops.helpers.helpers import tcp_ping
|
||||
from devops.helpers.helpers import wait
|
||||
from proboscis.asserts import assert_true
|
||||
|
||||
from fuelweb_test import logger
|
||||
from fuelweb_test.helpers.ssh_manager import SSHManager
|
||||
from fuelweb_test.helpers.utils import pretty_log
|
||||
|
||||
# timeouts
|
||||
|
@ -56,18 +55,17 @@ def verify_instance_state(os_conn, instances=None, expected_state='ACTIVE',
|
|||
if not instances:
|
||||
instances = os_conn.nova.servers.list()
|
||||
for instance in instances:
|
||||
try:
|
||||
wait(
|
||||
lambda:
|
||||
os_conn.get_instance_detail(instance).status == expected_state,
|
||||
timeout=BOOT_TIMEOUT)
|
||||
except TimeoutError:
|
||||
current_state = os_conn.get_instance_detail(instance).status
|
||||
assert_true(
|
||||
current_state == expected_state,
|
||||
"Timeout is reached. Current state of Vm {0} is {1}".format(
|
||||
instance.name, current_state)
|
||||
)
|
||||
wait(
|
||||
lambda:
|
||||
os_conn.get_instance_detail(instance).status == expected_state,
|
||||
timeout=BOOT_TIMEOUT,
|
||||
timeout_msg="Timeout is reached. "
|
||||
"Current state of Vm {0} is {1}."
|
||||
"Expected state is {2}".format(
|
||||
instance.name,
|
||||
os_conn.get_instance_detail(instance).status,
|
||||
expected_state)
|
||||
)
|
||||
|
||||
|
||||
def create_instances(os_conn, nics, vm_count=1,
|
||||
|
@ -102,33 +100,14 @@ def create_instances(os_conn, nics, vm_count=1,
|
|||
return instances
|
||||
|
||||
|
||||
def generate_message(command, result_of_command, ip_from, ip_to):
|
||||
"""Generate error message for check connection methods.
|
||||
|
||||
:param command: type string, name of command
|
||||
:param result_of_command: type interger, exite code of command execution
|
||||
:param ip_from: type string, check connection from 'ip_from'
|
||||
:param ip_to: type string, check connection from 'ip_to'
|
||||
"""
|
||||
if result_of_command == 0:
|
||||
param = "isn't"
|
||||
else:
|
||||
param = "is"
|
||||
message = "{0} {1} available from {2} to {3}".format(
|
||||
command, param, ip_from, ip_to)
|
||||
return message
|
||||
|
||||
|
||||
def check_connection_vms(ip_pair, command='pingv4',
|
||||
result_of_command=0,
|
||||
def check_connection_vms(ip_pair, command='pingv4', result_of_command=0,
|
||||
timeout=30, interval=5):
|
||||
"""Check network connectivity between instances.
|
||||
|
||||
:param os_conn: type object, openstack
|
||||
:param ip_pair: type dict, {ip_from: [ip_to1, ip_to2, etc.]}
|
||||
:param command: type string, key from dictionary 'commands'
|
||||
by default is 'pingv4'
|
||||
:param result_of_command: type interger, exite code of command execution
|
||||
:param result_of_command: type integer, exit code of command execution
|
||||
by default is 0
|
||||
:param timeout: wait to get expected result
|
||||
:param interval: interval of executing command
|
||||
|
@ -139,21 +118,20 @@ def check_connection_vms(ip_pair, command='pingv4',
|
|||
"arping": "sudo arping -I eth0 {}",
|
||||
"ssh": " "}
|
||||
|
||||
msg = 'Command "{0}", Actual exit code is NOT {1}'
|
||||
for ip_from in ip_pair:
|
||||
with get_ssh_connection(
|
||||
ip_from, instance_creds[0], instance_creds[1]
|
||||
) as ssh:
|
||||
with get_ssh_connection(ip_from, instance_creds[0],
|
||||
instance_creds[1]) as ssh:
|
||||
for ip_to in ip_pair[ip_from]:
|
||||
message = generate_message(
|
||||
commands[command], result_of_command, ip_from, ip_to)
|
||||
logger.info("Check connection from {0} to {1}.".format(
|
||||
ip_from, ip_to))
|
||||
cmd = commands[command].format(ip_to)
|
||||
wait(lambda: execute(
|
||||
ssh, cmd)['exit_code'] == result_of_command,
|
||||
|
||||
wait(lambda:
|
||||
execute(ssh, cmd)['exit_code'] == result_of_command,
|
||||
interval=interval,
|
||||
timeout=timeout,
|
||||
timeout_msg=message.format(ip_from, ip_to)
|
||||
timeout_msg=msg.format(cmd, result_of_command)
|
||||
)
|
||||
|
||||
|
||||
|
@ -163,10 +141,10 @@ def check_connection_through_host(remote, ip_pair, command='pingv4',
|
|||
"""Check network connectivity between instances.
|
||||
|
||||
:param ip_pair: type list, ips of instances
|
||||
:param remote: SSHClient to instance
|
||||
:param remote: Access point IP
|
||||
:param command: type string, key from dictionary 'commands'
|
||||
by default is 'pingv4'
|
||||
:param result_of_command: type interger, exite code of command execution
|
||||
:param result_of_command: type integer, exit code of command execution
|
||||
by default is 0
|
||||
:param timeout: wait to get expected result
|
||||
:param interval: interval of executing command
|
||||
|
@ -176,35 +154,63 @@ def check_connection_through_host(remote, ip_pair, command='pingv4',
|
|||
"pingv6": "ping6 -c 5 {}",
|
||||
"arping": "sudo arping -I eth0 {}"}
|
||||
|
||||
msg = 'Command "{0}", Actual exit code is NOT {1}'
|
||||
|
||||
for ip_from in ip_pair:
|
||||
for ip_to in ip_pair[ip_from]:
|
||||
logger.info('Check ping from {0} to {1}'.format(ip_from, ip_to))
|
||||
message = generate_message(
|
||||
commands[command], result_of_command, ip_from, ip_to)
|
||||
cmd = commands[command].format(ip_to)
|
||||
wait(
|
||||
lambda:
|
||||
remote_execute_command(
|
||||
remote,
|
||||
ip_from,
|
||||
commands[command].format(ip_to),
|
||||
cmd,
|
||||
wait=timeout)['exit_code'] == result_of_command,
|
||||
interval=interval,
|
||||
timeout=timeout,
|
||||
timeout_msg=message.format(
|
||||
ip_from, ip_to)
|
||||
timeout_msg=msg.format(cmd, result_of_command)
|
||||
)
|
||||
|
||||
|
||||
def ping_each_other(ips, command='pingv4', expected_ec=0,
|
||||
timeout=30, interval=5, access_point_ip=None):
|
||||
"""Check network connectivity between instances.
|
||||
|
||||
:param ips: list, list of ips
|
||||
:param command: type string, key from dictionary 'commands'
|
||||
by default is 'pingv4'
|
||||
:param expected_ec: type integer, exit code of command execution
|
||||
by default is 0
|
||||
:param timeout: wait to get expected result
|
||||
:param interval: interval of executing command
|
||||
:param access_point_ip: It is used if check via host
|
||||
"""
|
||||
ip_pair = {key: [ip for ip in ips if ip != key] for key in ips}
|
||||
if access_point_ip:
|
||||
check_connection_through_host(remote=access_point_ip,
|
||||
ip_pair=ip_pair,
|
||||
command=command,
|
||||
result_of_command=expected_ec,
|
||||
timeout=timeout,
|
||||
interval=interval)
|
||||
else:
|
||||
check_connection_vms(ip_pair=ip_pair,
|
||||
command=command,
|
||||
result_of_command=expected_ec,
|
||||
timeout=timeout,
|
||||
interval=interval)
|
||||
|
||||
|
||||
def create_and_assign_floating_ips(os_conn, instances_list):
|
||||
"""Create Vms on available hypervisors.
|
||||
"""Associate floating ips with specified instances.
|
||||
|
||||
:param os_conn: type object, openstack
|
||||
:param instances_list: type list, instances
|
||||
"""
|
||||
fips = []
|
||||
for instance in instances_list:
|
||||
ip = os_conn.assign_floating_ip(
|
||||
instance).ip
|
||||
ip = os_conn.assign_floating_ip(instance).ip
|
||||
fips.append(ip)
|
||||
wait(lambda: icmp_ping(ip), timeout=60 * 5, interval=5)
|
||||
return fips
|
||||
|
@ -323,19 +329,21 @@ def add_role_to_user(os_conn, user_name, role_name, tenant_name):
|
|||
os_conn.keystone.roles.add_user_role(user_id, role_id, tenant_id)
|
||||
|
||||
|
||||
def check_service(ssh, commands):
|
||||
def check_service(ip, commands):
|
||||
"""Check that required nova services are running on controller.
|
||||
|
||||
:param ssh: SSHClient
|
||||
:param ip: ip address of node
|
||||
:param commands: type list, nova commands to execute on controller,
|
||||
example of commands:
|
||||
['nova-manage service list | grep vcenter-vmcluster1'
|
||||
"""
|
||||
ssh.execute('source openrc')
|
||||
SSHManager.execute_on_remote(ip=ip, cmd='source openrc')
|
||||
|
||||
for cmd in commands:
|
||||
wait(
|
||||
lambda:
|
||||
':-)' in list(ssh.execute(cmd)['stdout'])[-1].split(' '),
|
||||
':-)' in SSHManager.execute_on_remote(ip=ip,
|
||||
cmd=cmd)['stdout'][-1],
|
||||
timeout=200)
|
||||
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ from devops.helpers.helpers import icmp_ping
|
|||
from devops.helpers.helpers import wait
|
||||
from proboscis import test
|
||||
from proboscis.asserts import assert_true
|
||||
from proboscis.asserts import fail
|
||||
|
||||
import fuelweb_test.tests.base_test_case
|
||||
from fuelweb_test import logger
|
||||
|
@ -58,8 +59,21 @@ class TestDVSDestructive(TestBasic):
|
|||
cmds = ['nova-manage service list | grep vcenter-vmcluster1',
|
||||
'nova-manage service list | grep vcenter-vmcluster2']
|
||||
|
||||
net_data = [{'net_1': '192.168.112.0/24'},
|
||||
{'net_2': '192.168.113.0/24'}]
|
||||
networks = [
|
||||
{'name': 'net_1',
|
||||
'subnets': [
|
||||
{'name': 'subnet_1',
|
||||
'cidr': '192.168.112.0/24'}
|
||||
]
|
||||
},
|
||||
{'name': 'net_2',
|
||||
'subnets': [
|
||||
{'name': 'subnet_1',
|
||||
'cidr': '192.168.113.0/24'}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
# defaults
|
||||
inter_net_name = openstack.get_defaults()['networks']['internal']['name']
|
||||
ext_net_name = openstack.get_defaults()['networks']['floating']['name']
|
||||
|
@ -112,17 +126,7 @@ class TestDVSDestructive(TestBasic):
|
|||
instance, net_name=self.inter_net_name))
|
||||
time.sleep(30)
|
||||
self.show_step(13)
|
||||
ip_pair = {
|
||||
key: [value for value in ips if key != value] for key in ips}
|
||||
for ip_from in ip_pair:
|
||||
for ip_to in ip_pair[ip_from]:
|
||||
ping_result = openstack.remote_execute_command(
|
||||
access_point_ip, ip_from, "ping -c 5 {0}".format(ip_to))
|
||||
assert_true(
|
||||
ping_result['exit_code'] == 0,
|
||||
"Ping isn't available from {0} to {1}".format(ip_from,
|
||||
ip_to)
|
||||
)
|
||||
openstack.ping_each_other(ips=ips, access_point_ip=access_point_ip)
|
||||
|
||||
self.show_step(14)
|
||||
vcenter_name = [
|
||||
|
@ -136,25 +140,19 @@ class TestDVSDestructive(TestBasic):
|
|||
node.reset()
|
||||
|
||||
self.show_step(15)
|
||||
wait(lambda: not icmp_ping(
|
||||
self.VCENTER_IP), interval=1, timeout=10,
|
||||
timeout_msg='Vcenter is still available.')
|
||||
wait(lambda: not icmp_ping(self.VCENTER_IP),
|
||||
interval=1,
|
||||
timeout=10,
|
||||
timeout_msg='Vcenter is still available.')
|
||||
|
||||
self.show_step(16)
|
||||
wait(lambda: icmp_ping(
|
||||
self.VCENTER_IP), interval=5, timeout=120,
|
||||
timeout_msg='Vcenter is not available.')
|
||||
wait(lambda: icmp_ping(self.VCENTER_IP),
|
||||
interval=5,
|
||||
timeout=120,
|
||||
timeout_msg='Vcenter is not available.')
|
||||
|
||||
self.show_step(17)
|
||||
for ip_from in ip_pair:
|
||||
for ip_to in ip_pair[ip_from]:
|
||||
ping_result = openstack.remote_execute_command(
|
||||
access_point_ip, ip_from, "ping -c 5 {0}".format(ip_to))
|
||||
assert_true(
|
||||
ping_result['exit_code'] == 0,
|
||||
"Ping isn't available from {0} to {1}".format(ip_from,
|
||||
ip_to)
|
||||
)
|
||||
openstack.ping_each_other(ips=ips, access_point_ip=access_point_ip)
|
||||
|
||||
@test(depends_on=[TestDVSSystem.dvs_vcenter_systest_setup],
|
||||
groups=["dvs_vcenter_uninstall"])
|
||||
|
@ -186,10 +184,8 @@ class TestDVSDestructive(TestBasic):
|
|||
self.show_step(3)
|
||||
output = self.ssh_manager.execute_on_remote(
|
||||
ip=self.ssh_manager.admin_ip, cmd='fuel plugins list')['stdout']
|
||||
assert_true(
|
||||
plugin.plugin_name in output[-1].split(' '),
|
||||
"Plugin '{0}' was removed".format(plugin.plugin_name)
|
||||
)
|
||||
assert_true(plugin.plugin_name in output[-1].split(' '),
|
||||
"Plugin '{0}' was removed".format(plugin.plugin_name))
|
||||
|
||||
@test(depends_on=[TestDVSSystem.dvs_vcenter_systest_setup],
|
||||
groups=["dvs_vcenter_bind_port"])
|
||||
|
@ -199,26 +195,26 @@ class TestDVSDestructive(TestBasic):
|
|||
|
||||
Scenario:
|
||||
1. Revert snapshot to dvs_vcenter_systest_setup
|
||||
2. Create private networks net01 with sunet.
|
||||
3. Launch instances VM_1 and VM_2 in the net01
|
||||
2. Create private networks net01 with subnet.
|
||||
3. Launch instance VM_1 in the net01
|
||||
with image TestVM and flavor m1.micro in nova az.
|
||||
4. Launch instances VM_3 and VM_4 in the net01
|
||||
with image TestVM-VMDK and flavor m1.micro in nova az.
|
||||
4. Bind sub_net port of instances.
|
||||
5. Check instances are not available.
|
||||
6. Enable sub_net port of all instances.
|
||||
7. Verify that instances communicate between each other.
|
||||
4. Launch instance VM_2 in the net01
|
||||
with image TestVM-VMDK and flavor m1.micro in vcenter az.
|
||||
5. Disable sub_net port of instances.
|
||||
6. Check instances are not available.
|
||||
7. Enable sub_net port of all instances.
|
||||
8. Verify that instances communicate between each other.
|
||||
Send icmp ping between instances.
|
||||
|
||||
|
||||
Duration: 1,5 hours
|
||||
|
||||
"""
|
||||
self.show_step(1)
|
||||
self.env.revert_snapshot("dvs_vcenter_systest_setup")
|
||||
|
||||
cluster_id = self.fuel_web.get_last_created_cluster()
|
||||
|
||||
# Create new network
|
||||
os_ip = self.fuel_web.get_public_vip(cluster_id)
|
||||
os_conn = os_actions.OpenStackActions(
|
||||
os_ip, SERVTEST_USERNAME,
|
||||
|
@ -228,28 +224,27 @@ class TestDVSDestructive(TestBasic):
|
|||
# create security group with rules for ssh and ping
|
||||
security_group = os_conn.create_sec_group_for_ssh()
|
||||
|
||||
logger.info("Create non default network with subnet.")
|
||||
logger.info('Create network {}'.format(self.net_data[0].keys()[0]))
|
||||
network = os_conn.create_network(
|
||||
network_name=self.net_data[0].keys()[0])['network']
|
||||
self.show_step(2)
|
||||
net = self.networks[0]
|
||||
network = os_conn.create_network(network_name=net['name'])['network']
|
||||
|
||||
subnet = os_conn.create_subnet(
|
||||
subnet_name=network['name'],
|
||||
subnet_name=net['subnets'][0]['name'],
|
||||
network_id=network['id'],
|
||||
cidr=self.net_data[0][self.net_data[0].keys()[0]])
|
||||
cidr=net['subnets'][0]['cidr'])
|
||||
|
||||
logger.info("Check that network are created.")
|
||||
logger.info("Check network was created.")
|
||||
assert_true(
|
||||
os_conn.get_network(network['name'])['id'] == network['id']
|
||||
)
|
||||
|
||||
logger.info("Add net_1 to default router")
|
||||
router = os_conn.get_router(os_conn.get_network(self.ext_net_name))
|
||||
os_conn.add_router_interface(
|
||||
router_id=router["id"],
|
||||
subnet_id=subnet["id"])
|
||||
os_conn.add_router_interface(router_id=router["id"],
|
||||
subnet_id=subnet["id"])
|
||||
|
||||
# Launch instance VM_1 and VM_2
|
||||
self.show_step(3)
|
||||
self.show_step(4)
|
||||
instances = openstack.create_instances(
|
||||
os_conn=os_conn, nics=[{'net-id': network['id']}], vm_count=1,
|
||||
security_groups=[security_group.name]
|
||||
|
@ -257,39 +252,39 @@ class TestDVSDestructive(TestBasic):
|
|||
openstack.verify_instance_state(os_conn)
|
||||
|
||||
ports = os_conn.neutron.list_ports()['ports']
|
||||
floating_ip = openstack.create_and_assign_floating_ips(
|
||||
os_conn, instances)
|
||||
instance_ports = []
|
||||
for instance in instances:
|
||||
instance_addr = os_conn.get_nova_instance_ip(
|
||||
instance, net_name=network['name'])
|
||||
for port in ports:
|
||||
port_addr = port['fixed_ips'][0]['ip_address']
|
||||
if instance_addr == port_addr:
|
||||
instance_ports.append(port)
|
||||
for port in instance_ports:
|
||||
fips = openstack.create_and_assign_floating_ips(os_conn, instances)
|
||||
|
||||
inst_ips = [os_conn.get_nova_instance_ip(
|
||||
instance, net_name=network['name']) for instance in instances]
|
||||
inst_ports = [p for p in ports
|
||||
if p['fixed_ips'][0]['ip_address'] in inst_ips]
|
||||
|
||||
self.show_step(5)
|
||||
for port in inst_ports:
|
||||
os_conn.neutron.update_port(
|
||||
port['id'], {'port': {'admin_state_up': False}}
|
||||
)
|
||||
|
||||
ip_pair = dict.fromkeys(floating_ip)
|
||||
for key in ip_pair:
|
||||
ip_pair[key] = [value for value in floating_ip if key != value]
|
||||
# Verify that not connection to instances
|
||||
self.show_step(6)
|
||||
# TODO(vgorin) create better solution for this step
|
||||
try:
|
||||
openstack.check_connection_vms(ip_pair)
|
||||
openstack.ping_each_other(fips)
|
||||
checker = 1
|
||||
except Exception as e:
|
||||
logger.info(str(e))
|
||||
logger.info(e)
|
||||
checker = 0
|
||||
|
||||
# Enable sub_net ports of instances
|
||||
for port in instance_ports:
|
||||
if checker:
|
||||
fail('Ping is available between instances')
|
||||
|
||||
self.show_step(7)
|
||||
for port in inst_ports:
|
||||
os_conn.neutron.update_port(
|
||||
port['id'], {'port': {'admin_state_up': True}}
|
||||
)
|
||||
|
||||
# Verify that instances communicate between each other.
|
||||
# Send icmp ping between instances
|
||||
openstack.check_connection_vms(ip_pair, timeout=90)
|
||||
self.show_step(8)
|
||||
openstack.ping_each_other(fips, timeout=90)
|
||||
|
||||
@test(depends_on=[SetupEnvironment.prepare_slaves_5],
|
||||
groups=["dvs_destructive_setup_2"])
|
||||
|
@ -300,20 +295,24 @@ class TestDVSDestructive(TestBasic):
|
|||
Scenario:
|
||||
1. Upload plugins to the master node
|
||||
2. Install plugin.
|
||||
3. Create cluster with vcenter.
|
||||
3. Configure cluster with 2 vcenter clusters.
|
||||
4. Add 3 node with controller role.
|
||||
5. Add 2 node with compute role.
|
||||
6. Deploy the cluster.
|
||||
7. Launch instances.
|
||||
6. Configure vcenter
|
||||
7. Deploy the cluster.
|
||||
8. Run smoke OSTF tests
|
||||
9. Launch instances. 1 per az. Assign floating ips.
|
||||
10. Make snapshot
|
||||
|
||||
Duration: 1.8 hours
|
||||
|
||||
Snapshot: dvs_destructive_setup_2
|
||||
"""
|
||||
self.show_step(1)
|
||||
self.env.revert_snapshot("ready_with_5_slaves")
|
||||
|
||||
plugin.install_dvs_plugin(self.ssh_manager.admin_ip)
|
||||
|
||||
# Configure cluster with 2 vcenter clusters
|
||||
self.show_step(2)
|
||||
cluster_id = self.fuel_web.create_cluster(
|
||||
name=self.__class__.__name__,
|
||||
mode=DEPLOYMENT_MODE,
|
||||
|
@ -324,7 +323,8 @@ class TestDVSDestructive(TestBasic):
|
|||
)
|
||||
plugin.enable_plugin(cluster_id, self.fuel_web)
|
||||
|
||||
# Assign role to node
|
||||
self.show_step(3)
|
||||
self.show_step(4)
|
||||
self.fuel_web.update_nodes(
|
||||
cluster_id,
|
||||
{'slave-01': ['controller'],
|
||||
|
@ -333,21 +333,23 @@ class TestDVSDestructive(TestBasic):
|
|||
'slave-04': ['compute'],
|
||||
'slave-05': ['compute']}
|
||||
)
|
||||
# Configure VMWare vCenter settings
|
||||
self.show_step(6)
|
||||
self.fuel_web.vcenter_configure(cluster_id, multiclusters=True)
|
||||
|
||||
self.show_step(7)
|
||||
self.fuel_web.deploy_cluster_wait(cluster_id)
|
||||
|
||||
self.show_step(8)
|
||||
self.fuel_web.run_ostf(
|
||||
cluster_id=cluster_id, test_sets=['smoke'])
|
||||
|
||||
self.show_step(9)
|
||||
os_ip = self.fuel_web.get_public_vip(cluster_id)
|
||||
os_conn = os_actions.OpenStackActions(
|
||||
os_ip, SERVTEST_USERNAME,
|
||||
SERVTEST_PASSWORD,
|
||||
SERVTEST_TENANT)
|
||||
|
||||
# create security group with rules for ssh and ping
|
||||
security_group = os_conn.create_sec_group_for_ssh()
|
||||
|
||||
network = os_conn.nova.networks.find(label=self.inter_net_name)
|
||||
|
@ -356,10 +358,9 @@ class TestDVSDestructive(TestBasic):
|
|||
security_groups=[security_group.name]
|
||||
)
|
||||
openstack.verify_instance_state(os_conn)
|
||||
openstack.create_and_assign_floating_ips(os_conn, instances)
|
||||
|
||||
for instance in instances:
|
||||
os_conn.assign_floating_ip(instance)
|
||||
|
||||
self.show_step(10)
|
||||
self.env.make_snapshot("dvs_destructive_setup_2", is_make=True)
|
||||
|
||||
@test(depends_on=[dvs_destructive_setup_2],
|
||||
|
@ -373,13 +374,14 @@ class TestDVSDestructive(TestBasic):
|
|||
2. Verify connection between instances. Send ping,
|
||||
check that ping get reply
|
||||
3. Reset controller.
|
||||
4. Check that vmclusters should be migrate to another controller.
|
||||
4. Check that vmclusters migrate to another controller.
|
||||
5. Verify connection between instances.
|
||||
Send ping, check that ping get reply
|
||||
|
||||
Duration: 1.8 hours
|
||||
|
||||
"""
|
||||
self.show_step(1)
|
||||
self.env.revert_snapshot("dvs_destructive_setup_2")
|
||||
|
||||
cluster_id = self.fuel_web.get_last_created_cluster()
|
||||
|
@ -389,36 +391,27 @@ class TestDVSDestructive(TestBasic):
|
|||
SERVTEST_PASSWORD,
|
||||
SERVTEST_TENANT)
|
||||
|
||||
# Verify connection between instances.
|
||||
# Send ping Check that ping get reply.
|
||||
self.show_step(2)
|
||||
srv_list = os_conn.get_servers()
|
||||
floating_ip = []
|
||||
fips = []
|
||||
for srv in srv_list:
|
||||
floating_ip.append(os_conn.get_nova_instance_ip(
|
||||
fips.append(os_conn.get_nova_instance_ip(
|
||||
srv, net_name=self.inter_net_name, addrtype='floating'))
|
||||
ip_pair = dict.fromkeys(floating_ip)
|
||||
for key in ip_pair:
|
||||
ip_pair[key] = [value for value in floating_ip if key != value]
|
||||
openstack.check_connection_vms(ip_pair)
|
||||
|
||||
controller = self.fuel_web.get_nailgun_primary_node(
|
||||
self.env.d_env.nodes().slaves[0]
|
||||
)
|
||||
openstack.ping_each_other(fips)
|
||||
|
||||
self.fuel_web.cold_restart_nodes(
|
||||
[self.fuel_web.environment.d_env.get_node(name=controller.name)],
|
||||
wait_offline=True, wait_online=True,
|
||||
wait_after_destroy=300)
|
||||
d_ctrl = self.fuel_web.get_nailgun_primary_node(
|
||||
self.env.d_env.nodes().slaves[0])
|
||||
n_ctrl = self.fuel_web.get_nailgun_node_by_devops_node(d_ctrl)
|
||||
|
||||
controller = self.fuel_web.get_nailgun_primary_node(
|
||||
self.env.d_env.nodes().slaves[1]
|
||||
)
|
||||
self.show_step(3)
|
||||
self.fuel_web.cold_restart_nodes([d_ctrl], wait_after_destroy=300)
|
||||
|
||||
# Verify connection between instances.
|
||||
# Send ping Check that ping get reply.
|
||||
with self.fuel_web.get_ssh_for_node(controller.name) as ssh_control:
|
||||
openstack.check_service(ssh=ssh_control, commands=self.cmds)
|
||||
openstack.check_connection_vms(ip_pair)
|
||||
self.show_step(4)
|
||||
openstack.check_service(ip=n_ctrl['ip'], commands=self.cmds)
|
||||
|
||||
self.show_step(5)
|
||||
openstack.ping_each_other(fips)
|
||||
|
||||
@test(depends_on=[dvs_destructive_setup_2],
|
||||
groups=["dvs_vcenter_shutdown_controller"])
|
||||
|
@ -438,6 +431,7 @@ class TestDVSDestructive(TestBasic):
|
|||
Duration: 1.8 hours
|
||||
|
||||
"""
|
||||
self.show_step(1)
|
||||
self.env.revert_snapshot("dvs_destructive_setup_2")
|
||||
|
||||
cluster_id = self.fuel_web.get_last_created_cluster()
|
||||
|
@ -447,37 +441,29 @@ class TestDVSDestructive(TestBasic):
|
|||
SERVTEST_PASSWORD,
|
||||
SERVTEST_TENANT)
|
||||
|
||||
# Verify connection between instances.
|
||||
# Send ping, check that ping get reply.
|
||||
self.show_step(2)
|
||||
srv_list = os_conn.get_servers()
|
||||
floating_ip = []
|
||||
fips = []
|
||||
for srv in srv_list:
|
||||
floating_ip.append(os_conn.get_nova_instance_ip(
|
||||
fips.append(os_conn.get_nova_instance_ip(
|
||||
srv, net_name=self.inter_net_name, addrtype='floating'))
|
||||
ip_pair = dict.fromkeys(floating_ip)
|
||||
for key in ip_pair:
|
||||
ip_pair[key] = [value for value in floating_ip if key != value]
|
||||
openstack.check_connection_vms(ip_pair)
|
||||
openstack.ping_each_other(fips)
|
||||
|
||||
controllers = self.fuel_web.get_devops_nodes_by_nailgun_nodes(
|
||||
self.fuel_web.get_nailgun_cluster_nodes_by_roles(
|
||||
cluster_id=cluster_id,
|
||||
roles=['controller']))
|
||||
n_ctrls = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
|
||||
cluster_id=cluster_id, roles=['controller'])
|
||||
|
||||
with self.fuel_web.get_ssh_for_node(controllers[0].name) as ssh_contr:
|
||||
openstack.check_service(ssh=ssh_contr, commands=self.cmds)
|
||||
|
||||
openstack.check_connection_vms(ip_pair)
|
||||
openstack.check_service(ip=n_ctrls[0]['ip'], commands=self.cmds)
|
||||
openstack.ping_each_other(fips)
|
||||
|
||||
self.show_step(3)
|
||||
self.fuel_web.warm_shutdown_nodes(
|
||||
[self.fuel_web.environment.d_env.get_node(
|
||||
name=controllers[0].name)])
|
||||
[self.fuel_web.get_devops_node_by_nailgun_node(n_ctrls[0])])
|
||||
|
||||
# Verify connection between instances.
|
||||
# Send ping Check that ping get reply.
|
||||
with self.fuel_web.get_ssh_for_node(controllers[1].name) as ssh_contr:
|
||||
openstack.check_service(ssh=ssh_contr, commands=self.cmds)
|
||||
openstack.check_connection_vms(ip_pair, timeout=90)
|
||||
self.show_step(4)
|
||||
openstack.check_service(ip=n_ctrls[1]['ip'], commands=self.cmds)
|
||||
|
||||
self.show_step(5)
|
||||
openstack.ping_each_other(fips, timeout=90)
|
||||
|
||||
@test(depends_on=[SetupEnvironment.prepare_slaves_5],
|
||||
groups=["dvs_reboot_vcenter_1"])
|
||||
|
@ -551,10 +537,7 @@ class TestDVSDestructive(TestBasic):
|
|||
plugin.enable_plugin(cluster_id, self.fuel_web)
|
||||
|
||||
self.show_step(7)
|
||||
self.fuel_web.vcenter_configure(
|
||||
cluster_id,
|
||||
multiclusters=True
|
||||
)
|
||||
self.fuel_web.vcenter_configure(cluster_id, multiclusters=True)
|
||||
|
||||
self.show_step(8)
|
||||
self.fuel_web.verify_network(cluster_id)
|
||||
|
@ -563,15 +546,13 @@ class TestDVSDestructive(TestBasic):
|
|||
self.fuel_web.deploy_cluster_wait(cluster_id)
|
||||
|
||||
self.show_step(10)
|
||||
self.fuel_web.run_ostf(
|
||||
cluster_id=cluster_id, test_sets=['smoke'])
|
||||
self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])
|
||||
|
||||
os_ip = self.fuel_web.get_public_vip(cluster_id)
|
||||
self.extended_tests_reset_vcenter(os_ip)
|
||||
|
||||
self.show_step(18)
|
||||
self.fuel_web.run_ostf(
|
||||
cluster_id=cluster_id, test_sets=['smoke'])
|
||||
self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])
|
||||
|
||||
@test(depends_on=[SetupEnvironment.prepare_slaves_5],
|
||||
groups=["dvs_reboot_vcenter_2"])
|
||||
|
@ -599,7 +580,7 @@ class TestDVSDestructive(TestBasic):
|
|||
configure Nova Compute instances on compute-vmware.
|
||||
8. Verify networks.
|
||||
9. Deploy cluster.
|
||||
10. Run OSTF.
|
||||
10. Run Smoke OSTF.
|
||||
11. Launch instance VM_1 with image TestVM, availability zone nova
|
||||
and flavor m1.micro.
|
||||
12. Launch instance VM_2 with image TestVM-VMDK, availability zone
|
||||
|
@ -610,7 +591,7 @@ class TestDVSDestructive(TestBasic):
|
|||
15. Check that controller lost connection with vCenter.
|
||||
16. Wait for vCenter.
|
||||
17. Ensure that all instances from vCenter displayed in dashboard.
|
||||
18. Run OSTF.
|
||||
18. Run Smoke OSTF.
|
||||
|
||||
|
||||
Duration: 2.5 hours
|
||||
|
@ -661,12 +642,10 @@ class TestDVSDestructive(TestBasic):
|
|||
self.fuel_web.deploy_cluster_wait(cluster_id)
|
||||
|
||||
self.show_step(10)
|
||||
self.fuel_web.run_ostf(
|
||||
cluster_id=cluster_id, test_sets=['smoke'])
|
||||
self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])
|
||||
|
||||
os_ip = self.fuel_web.get_public_vip(cluster_id)
|
||||
self.extended_tests_reset_vcenter(os_ip)
|
||||
|
||||
self.show_step(18)
|
||||
self.fuel_web.run_ostf(
|
||||
cluster_id=cluster_id, test_sets=['smoke'])
|
||||
self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])
|
||||
|
|
Loading…
Reference in New Issue