Merge "Fix system tests."

This commit is contained in:
Jenkins
2016-07-12 08:28:13 +00:00
committed by Gerrit Code Review
2 changed files with 47 additions and 75 deletions

View File

@@ -754,7 +754,7 @@ class DPDKTests(TestBasic):
in the hpgs availability zone.
5. Make snapshot of the created instance.
6. Delete the last created instance.
7. Launch another instance from the snapshot created in step 2
7. Launch another instance from the snapshot created in step 5.
and flavor with hpgs in the hpgs availability zone.
8. Delete the last created instance.
@@ -918,7 +918,6 @@ class DPDKTests(TestBasic):
os_ip, SERVTEST_USERNAME,
SERVTEST_PASSWORD,
SERVTEST_TENANT)
tenant = os_conn.get_tenant(SERVTEST_TENANT)
network = os_conn.create_network(
network_name=net_name)['network']
@@ -929,7 +928,12 @@ class DPDKTests(TestBasic):
ip_version=4)
self.show_step(3)
router = os_conn.create_router('router_1', tenant=tenant)
gateway = {
"network_id": os_conn.get_network('admin_floating_net')['id'],
"enable_snat": True}
router_param = {'router': {
'name': 'df', 'external_gateway_info': gateway}}
router = os_conn.neutron.create_router(body=router_param)['router']
os_conn.add_router_interface(
router_id=router["id"],
subnet_id=subnet["id"])
@@ -949,16 +953,15 @@ class DPDKTests(TestBasic):
self.show_step(9)
wait(
lambda: tcp_ping(fip, 22), timeout=60, interval=5,
lambda: tcp_ping(fip, 22), timeout=120, interval=5,
timeout_msg="Node {0} is not accessible by SSH.".format(fip))
self.show_step(10)
remote = self.fuel_web.get_nailgun_primary_node(
self.env.d_env.nodes().slaves[0])
assert_true(
os_conn.execute_through_host(
remote, fip, ping_command)['exit_code'] == 0,
'Ping responce is not received.')
with self.fuel_web.get_ssh_for_node("slave-01") as remote:
assert_true(
os_conn.execute_through_host(
remote, fip, ping_command)['exit_code'] == 0,
'Ping responce is not received.')
self.show_step(11)
os_conn.delete_instance(srv)

View File

@@ -44,7 +44,7 @@ from helpers import openstack
from helpers.settings import OSTF_RUN_TIMEOUT
@test(groups=["plugins"])
@test(groups=["contrail_system_tests"])
class SystemTests(TestBasic):
"""System test suite.
@@ -116,9 +116,9 @@ class SystemTests(TestBasic):
1. Create an environment with "Neutron with tunneling
segmentation" as a network configuration
2. Enable Contrail plugin
3. Add 1 node with contrail-config, contrail-control and
contrail-db roles
4. Add a node with controller role
3. Add 1 node with contrail-config, contrail-control,
contrail-analytics and contrail-db roles
4. Add a node with controller, mongo roles
5. Add a node with compute role
6. Deploy cluster with plugin
7. Run OSTF.
@@ -127,7 +127,8 @@ class SystemTests(TestBasic):
"""
self.show_step(1)
plugin.prepare_contrail_plugin(self, slaves=5)
plugin.prepare_contrail_plugin(
self, slaves=5, options={'ceilometer': True})
# activate vSRX image
plugin.activate_vsrx()
@@ -141,8 +142,9 @@ class SystemTests(TestBasic):
{
'slave-01': ['contrail-config',
'contrail-control',
'contrail-db'],
'slave-02': ['controller'],
'contrail-db',
'contrail-analytics'],
'slave-02': ['controller', 'mongo'],
'slave-03': ['compute'],
'slave-04': ['compute'],
})
@@ -151,12 +153,14 @@ class SystemTests(TestBasic):
openstack.deploy_cluster(self)
self.show_step(7)
self.fuel_web.run_ostf(
cluster_id=self.cluster_id, test_sets=['smoke'])
cluster_id=self.cluster_id,
test_sets=['smoke', 'sanity', 'tests_platform'],
timeout=OSTF_RUN_TIMEOUT)
self.env.make_snapshot("systest_setup", is_make=True)
@test(depends_on=[systest_setup],
groups=["create_new_network_via_contrail", 'contrail_system_tests'])
groups=["create_new_network_via_contrail"])
@log_snapshot_after_test
def create_new_network_via_contrail(self):
"""Create a new network via Contrail.
@@ -176,6 +180,7 @@ class SystemTests(TestBasic):
# constants
net_name = 'net_1'
self.show_step(1)
self.env.revert_snapshot('systest_setup')
cluster_id = self.fuel_web.get_last_created_cluster()
self.show_step(2)
@@ -241,7 +246,7 @@ class SystemTests(TestBasic):
instance.name, net_name))
@test(depends_on=[systest_setup],
groups=["create_networks", 'contrail_system_tests'])
groups=["create_networks"])
@log_snapshot_after_test
def create_networks(self):
"""Create and terminate networks and verify in Contrail UI.
@@ -262,6 +267,7 @@ class SystemTests(TestBasic):
net_names = ['net_1', 'net_2']
self.show_step(1)
self.env.revert_snapshot('systest_setup')
cluster_id = self.fuel_web.get_last_created_cluster()
self.show_step(2)
@@ -305,8 +311,7 @@ class SystemTests(TestBasic):
assert_true(net['id'] == net_contrail)
@test(depends_on=[systest_setup],
groups=["contrail_vm_connection_in_different_tenants",
'contrail_system_tests'])
groups=["contrail_vm_connection_in_different_tenants"])
@log_snapshot_after_test
def contrail_vm_connection_in_different_tenants(self):
"""Create a new network via Contrail.
@@ -327,8 +332,8 @@ class SystemTests(TestBasic):
net_admin = 'net_1'
net_test = 'net_2'
cidr = '192.168.115.0'
self.env.revert_snapshot('systest_setup')
self.show_step(1)
self.env.revert_snapshot('systest_setup')
cluster_id = self.fuel_web.get_last_created_cluster()
self.show_step(2)
@@ -441,26 +446,17 @@ class SystemTests(TestBasic):
'{0} is not attached to network {1}'.format(
srv_2.name, net_test))
@test(depends_on=[SetupEnvironment.prepare_slaves_9],
groups=["contrail_ceilometer_metrics", 'contrail_system_tests'])
@test(depends_on=[systest_setup],
groups=["contrail_ceilometer_metrics"])
@log_snapshot_after_test
def contrail_ceilometer_metrics(self):
"""Check that ceilometer collects contrail metrics.
Scenario:
1. Install contrail plugin.
2. Create an environment with "Neutron with tunneling
segmentation" as a network configuration.
3. Enable and configure Contrail plugin.
4. Add a node with "controller" + "MongoDB" multirole.
6. Add a node with "compute".
7. Add a node with "contrail-config", "contrail-control" and
"contrail-db" roles.
8. Deploy cluster with plugin.
9. Run OSTF tests.
10. Create 2 instances in the default network.
11. Send icpm packets from one instance to another.
12. Check contrail ceilometer metrics:
1. Setup systest_setup.
2. Create 2 instances in the default network.
3. Send icpm packets from one instance to another.
4. Check contrail ceilometer metrics:
*ip.floating.receive.bytes
*ip.floating.receive.packets
*ip.floating.transmit.bytes
@@ -483,36 +479,8 @@ class SystemTests(TestBasic):
message = "Ceilometer doesn't collect metric {0}."
self.show_step(1)
plugin.prepare_contrail_plugin(
self,
slaves=3,
options={'ceilometer': True})
self.env.revert_snapshot('systest_setup')
self.show_step(2)
plugin.activate_plugin(self)
# activate vSRX image
vsrx_setup_result = plugin.activate_vsrx()
plugin.show_range(self, 4, 8)
self.fuel_web.update_nodes(
self.cluster_id,
{
'slave-01': ['controller', 'mongo'],
'slave-02': ['compute'],
'slave-03': ['contrail-config',
'contrail-control',
'contrail-db'],
})
self.show_step(8)
openstack.deploy_cluster(self)
self.show_step(9)
if vsrx_setup_result:
self.fuel_web.run_ostf(
cluster_id=self.cluster_id,
test_sets=['smoke', 'tests_platform'],
timeout=OSTF_RUN_TIMEOUT)
self.show_step(10)
cluster_id = self.fuel_web.get_last_created_cluster()
os_ip = self.fuel_web.get_public_vip(cluster_id)
os_conn = os_actions.OpenStackActions(
@@ -533,14 +501,14 @@ class SystemTests(TestBasic):
lambda: tcp_ping(fip, 22), timeout=60, interval=5,
timeout_msg="Node {0} is not accessible by SSH.".format(fip))
self.show_step(11)
self.show_step(3)
controller = self.fuel_web.get_nailgun_primary_node(
self.env.d_env.nodes().slaves[0])
self.env.d_env.nodes().slaves[1])
self.ping_instance_from_instance(
os_conn, controller.name, {fip_1.ip: [fip_2.ip]})
self.show_step(12)
with self.fuel_web.get_ssh_for_node("slave-01") as ssh:
self.show_step(4)
with self.fuel_web.get_ssh_for_node("slave-02") as ssh:
for metric in ceilometer_metrics:
for resource_id in [fip_1.id, fip_2.id]:
wait(
@@ -560,7 +528,7 @@ class SystemTests(TestBasic):
collect_metric_type, metric_type))
@test(depends_on=[systest_setup],
groups=["https_tls_selected", 'contrail_system_tests'])
groups=["https_tls_selected"])
@log_snapshot_after_test
def https_tls_selected(self):
"""Create a new network via Contrail.
@@ -581,6 +549,7 @@ class SystemTests(TestBasic):
raise SkipTest()
self.show_step(1)
self.env.revert_snapshot('systest_setup')
cluster_id = self.fuel_web.get_last_created_cluster()
os_ip = self.fuel_web.get_public_vip(cluster_id)
@@ -617,9 +586,9 @@ class SystemTests(TestBasic):
"""
# constants
max_password_lengh = 64
port = 18082
self.show_step(1)
self.env.revert_snapshot('systest_setup')
cluster_id = self.fuel_web.get_last_created_cluster()
self.show_step(2)
@@ -628,7 +597,7 @@ class SystemTests(TestBasic):
os_ip, SERVTEST_USERNAME,
SERVTEST_PASSWORD,
SERVTEST_TENANT)
contrail_client = ContrailClient(os_ip, contrail_port=port)
contrail_client = ContrailClient(os_ip)
projects = contrail_client.get_projects()
tenant = os_conn.get_tenant(SERVTEST_TENANT)
@@ -668,7 +637,7 @@ class SystemTests(TestBasic):
new_password,
SERVTEST_TENANT)
contrail = ContrailClient(
os_ip, contrail_port=port,
os_ip,
credentials={
'username': new_username,
'tenant_name': SERVTEST_TENANT,