TEMP commit , do not merge

Add test create instance with verification of network cannectivity

Change base module for sanity networks test:
change request list admin from iuser to admin
This commit is contained in:
Tatyana Leontovich 2013-07-01 16:34:56 +03:00
parent 9136a05077
commit e028b37b70
4 changed files with 14 additions and 134 deletions

View File

@ -20,12 +20,12 @@ strategy = keystone
# The identity region
region = RegionOne
# This should be the username of a user WITHOUT administrative privileges
username = demo
# This should be the username of a user WITH administrative privileges
username = admin
# The above non-administrative user's password
password = nova
# The above non-administrative user's tenant name
tenant_name = demo
tenant_name = service
# This should be the username of an alternate user WITHOUT
# administrative privileges
@ -73,10 +73,10 @@ allow_tenant_reuse = true
# Reference data for tests. The ref and ref_alt should be
# distinct images/flavors.
#image_ref = 0ee318a0-3a30-44b8-8b73-21f7ac00a6b5
#image_ref_alt = 0ee318a0-3a30-44b8-8b73-21f7ac00a6b5
#flavor_ref = 42
#flavor_ref_alt = 84
image_ref = e4fa4ef5-9f03-45d4-adbd-30b1abdcfb32
image_ref_alt = e4fa4ef5-9f03-45d4-adbd-30b1abdcfb32
flavor_ref = 1
flavor_ref_alt = 2
# User names used to authenticate to an instance for a given image.
image_ssh_user = cirros
@ -180,17 +180,17 @@ catalog_type = network
# A large private cidr block from which to allocate smaller blocks for
# tenant networks.
tenant_network_cidr = 10.100.0.0/16
tenant_network_cidr = 10.13.0.0/16
# The mask bits used to partition the tenant block.
tenant_network_mask_bits = 28
# If tenant networks are reachable, connectivity checks will be
# performed directly against addresses on those networks.
tenant_networks_reachable = false
tenant_networks_reachable = true
# Id of the public network that provides external connectivity.
public_network_id =
public_network_id = eeb739fc-97a0-46b3-b8b9-12212b8247c4
# Id of a shared public router that provides external connectivity.
# A shared public router would commonly be used where IP namespaces
@ -258,10 +258,10 @@ allow_tenant_reuse = true
# Reference data for tests. The ref and ref_alt should be
# distinct images/flavors.
#image_ref = cef3a728-63ad-498c-886c-f76a77c5defe
#image_ref_alt = cef3a728-63ad-498c-886c-f76a77c5defe
#flavor_ref = 42
#flavor_ref_alt = 84
image_ref = e4fa4ef5-9f03-45d4-adbd-30b1abdcfb32
image_ref_alt = e4fa4ef5-9f03-45d4-adbd-30b1abdcfb32
flavor_ref = 1
flavor_ref_alt = 2
# User names used to authenticate to an instance for a given image.
image_ssh_user = cirros

View File

@ -1,32 +0,0 @@
from fuel_health.common.utils import data_utils
from fuel_health.test import attr
from fuel_health.tests.smoke import base
class KeyPairsTestJSON(base.BaseComputeTest):
_interface = 'json'
@classmethod
def setUpClass(cls):
super(KeyPairsTestJSON, cls).setUpClass()
cls.client = cls.keypairs_client
@attr(type=['fuel', 'smoke'])
def test_keypair_create_delete(self):
""" Test keypair creation and deletion. """
k_name = data_utils.rand_name('ost1_test-keypair-')
resp, keypair = self.client.create_keypair(k_name)
self.assertEqual(200, resp.status)
private_key = keypair['private_key']
key_name = keypair['name']
self.assertEqual(key_name, k_name,
"The created keypair name is not equal "
"to the requested name")
self.assertTrue(private_key is not None,
"Field private_key is empty or not found.")
resp, _ = self.client.delete_keypair(k_name)
self.assertEqual(202, resp.status)
# self.assertEqual(202, self.image)
# TODO: add teardown for this test.

View File

@ -1,47 +0,0 @@
import netaddr
from fuel_health.common.utils import data_utils
from fuel_health.test import attr
from fuel_health.tests.smoke import base
"""
Test module for network creation.
Dependencies:
v2.0 of the Quantum API is assumed. It is also assumed that the following
options are defined in the [network] section of etc/tempest.conf:
- tenant_network_cidr with a block of cidr's from which smaller blocks
can be allocated for tenant networks;
- tenant_network_mask_bits with the mask bits to be used to partition the
block defined by tenant-network_cidr.
"""
class NetworksTest(base.BaseComputeTest):
"""
Test class for tenant netwprk creation the Quantum API
using the REST client for Quantum.
"""
_interface = 'json'
@classmethod
def setUpClass(cls):
super(NetworksTest, cls).setUpClass()
@attr(type=["fuel", "smoke"])
def test_create_network(self):
""" Test network creation. """
network_name = data_utils.rand_name('ost1_test-network-')
resp, body = self.network_client.create_network(network_name)
network = body['network']
self.assertEqual(body['name'], network_name)
self.assertTrue(network['id'] is not None)
cidr = netaddr.IPNetwork(self.network_cfg.tenant_network_cidr)
#TODO: finish this test (it`s incomplete for now).
#TODO: add teardown for this test.

View File

@ -1,41 +0,0 @@
from fuel_health.common.utils import data_utils
from fuel_health.test import attr
from fuel_health.tests.smoke import base
0111
class SecurityGroupsTest(base.BaseComputeTest):
"""
Test security group creation.
"""
_interface = 'json'
@classmethod
def setUpClass(cls):
super(SecurityGroupsTest, cls).setUpClass()
cls.client = cls.security_groups_client
def _delete_security_group(self, securitygroup_id):
resp, _ = self.client.delete_security_group(securitygroup_id)
self.assertEqual(202, resp.status)
@attr(type=['fuel', 'smoke'])
def test_security_group_create_delete(self):
# Security Group should be created, verified and deleted
s_name = data_utils.rand_name('ost1_test-securitygroup-')
s_description = data_utils.rand_name('ost1_test-description-')
resp, securitygroup = \
self.client.create_security_group(s_name, s_description)
self.assertTrue('id' in securitygroup)
securitygroup_id = securitygroup['id']
self.addCleanup(self._delete_security_group,
securitygroup_id)
self.assertEqual(200, resp.status)
self.assertFalse(securitygroup_id is None)
self.assertTrue('name' in securitygroup)
securitygroup_name = securitygroup['name']
self.assertEqual(securitygroup_name, s_name,
('The created Security Group name is not equal to '
'the requested name'))