Skip to content

Commit

Permalink
Remove skips for bug 1182384
Browse files Browse the repository at this point in the history
Commit a2ccca0 fixed some negative tests to check for neutron when
determining the invalid ID to use for nova APIs that behave differently
when using neutron vs nova-network.

This patch uses the same idea to remove the skips in place for bug
1182384 in the compute security group negative tests.

Closes-Bug: #1182384

Change-Id: I58ba125012a74ea49311a163e9bf7fd7af33c1fc
  • Loading branch information
Matt Riedemann committed Nov 12, 2013
1 parent 19a14c6 commit b0ede30
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
20 changes: 11 additions & 9 deletions tempest/api/compute/security_groups/test_security_group_rules.py
Expand Up @@ -15,12 +15,12 @@
# License for the specific language governing permissions and limitations
# under the License.

import uuid

from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest.test import attr
from tempest.test import skip_because


class SecurityGroupRulesTestJSON(base.BaseV2ComputeTest):
Expand All @@ -30,6 +30,7 @@ class SecurityGroupRulesTestJSON(base.BaseV2ComputeTest):
def setUpClass(cls):
super(SecurityGroupRulesTestJSON, cls).setUpClass()
cls.client = cls.security_groups_client
cls.neutron_available = cls.config.service_available.neutron

@attr(type='gate')
def test_security_group_rules_create(self):
Expand Down Expand Up @@ -93,14 +94,14 @@ def test_security_group_rules_create_with_optional_arguments(self):
self.addCleanup(self.client.delete_security_group_rule, rule['id'])
self.assertEqual(200, resp.status)

@skip_because(bug="1182384",
condition=config.TempestConfig().service_available.neutron)
@attr(type=['negative', 'gate'])
@attr(type=['negative', 'smoke'])
def test_security_group_rules_create_with_invalid_id(self):
# Negative test: Creation of Security Group rule should FAIL
# with invalid Parent group id
# Adding rules to the invalid Security Group id
parent_group_id = data_utils.rand_int_id(start=999)
if self.neutron_available:
parent_group_id = str(uuid.uuid4())
ip_protocol = 'tcp'
from_port = 22
to_port = 22
Expand Down Expand Up @@ -185,15 +186,16 @@ def test_security_group_rules_create_with_invalid_port_range(self):
self.client.create_security_group_rule,
secgroup_id, ip_protocol, from_port, to_port)

@skip_because(bug="1182384",
condition=config.TempestConfig().service_available.neutron)
@attr(type=['negative', 'gate'])
@attr(type=['negative', 'smoke'])
def test_security_group_rules_delete_with_invalid_id(self):
# Negative test: Deletion of Security Group rule should be FAIL
# with invalid rule id
group_rule_id = data_utils.rand_int_id(start=999)
if self.neutron_available:
group_rule_id = str(uuid.uuid4())
self.assertRaises(exceptions.NotFound,
self.client.delete_security_group_rule,
data_utils.rand_int_id(start=999))
group_rule_id)

@attr(type='gate')
def test_security_group_rules_list(self):
Expand Down
14 changes: 8 additions & 6 deletions tempest/api/compute/security_groups/test_security_groups.py
Expand Up @@ -16,6 +16,7 @@
# under the License.

import testtools
import uuid

from tempest.api.compute import base
from tempest.common.utils import data_utils
Expand All @@ -32,6 +33,7 @@ class SecurityGroupsTestJSON(base.BaseV2ComputeTest):
def setUpClass(cls):
super(SecurityGroupsTestJSON, cls).setUpClass()
cls.client = cls.security_groups_client
cls.neutron_available = cls.config.service_available.neutron

def _delete_security_group(self, securitygroup_id):
resp, _ = self.client.delete_security_group(securitygroup_id)
Expand Down Expand Up @@ -108,9 +110,7 @@ def test_security_group_create_get_delete(self):
"The fetched Security Group is different "
"from the created Group")

@skip_because(bug="1182384",
condition=config.TempestConfig().service_available.neutron)
@attr(type=['negative', 'gate'])
@attr(type=['negative', 'smoke'])
def test_security_group_get_nonexistant_group(self):
# Negative test:Should not be able to GET the details
# of non-existent Security Group
Expand All @@ -121,6 +121,8 @@ def test_security_group_get_nonexistant_group(self):
# Creating a non-existent Security Group id
while True:
non_exist_id = data_utils.rand_int_id(start=999)
if self.neutron_available:
non_exist_id = str(uuid.uuid4())
if non_exist_id not in security_group_id:
break
self.assertRaises(exceptions.NotFound, self.client.get_security_group,
Expand Down Expand Up @@ -198,9 +200,7 @@ def test_delete_the_default_security_group(self):
self.client.delete_security_group,
default_security_group_id)

@skip_because(bug="1182384",
condition=config.TempestConfig().service_available.neutron)
@attr(type=['negative', 'gate'])
@attr(type=['negative', 'smoke'])
def test_delete_nonexistant_security_group(self):
# Negative test:Deletion of a non-existent Security Group should Fail
security_group_id = []
Expand All @@ -210,6 +210,8 @@ def test_delete_nonexistant_security_group(self):
# Creating non-existent Security Group
while True:
non_exist_id = data_utils.rand_int_id(start=999)
if self.neutron_available:
non_exist_id = str(uuid.uuid4())
if non_exist_id not in security_group_id:
break
self.assertRaises(exceptions.NotFound,
Expand Down

0 comments on commit b0ede30

Please sign in to comment.