|
|
@@ -12,6 +12,7 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
|
|
|
super(CloudSecurityServiceTestCase, self).__init__(
|
|
|
methodName=methodName, provider=provider)
|
|
|
|
|
|
+ @helpers.skipIfNoService(['security.key_pairs'])
|
|
|
def test_crud_key_pair_service(self):
|
|
|
name = 'cbtestkeypairA-{0}'.format(uuid.uuid4())
|
|
|
kp = self.provider.security.key_pairs.create(name=name)
|
|
|
@@ -63,6 +64,7 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
|
|
|
no_kp,
|
|
|
"Found a key pair {0} that should not exist?".format(no_kp))
|
|
|
|
|
|
+ @helpers.skipIfNoService(['security.key_pairs'])
|
|
|
def test_key_pair(self):
|
|
|
name = 'cbtestkeypairB-{0}'.format(uuid.uuid4())
|
|
|
kp = self.provider.security.key_pairs.create(name=name)
|
|
|
@@ -102,6 +104,7 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
|
|
|
lambda: self.provider.network.delete(network_id=net.id)):
|
|
|
self.provider.security.security_groups.delete(group_id=sg.id)
|
|
|
|
|
|
+ @helpers.skipIfNoService(['security.security_groups'])
|
|
|
def test_crud_security_group_service(self):
|
|
|
name = 'cbtestsecuritygroupA-{0}'.format(uuid.uuid4())
|
|
|
net = self.provider.network.create(name=name)
|
|
|
@@ -155,6 +158,7 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
|
|
|
len(no_sg) == 0,
|
|
|
"Found a bogus security group?!?".format(no_sg))
|
|
|
|
|
|
+ @helpers.skipIfNoService(['security.security_groups'])
|
|
|
def test_security_group(self):
|
|
|
"""Test for proper creation of a security group."""
|
|
|
name = 'cbtestsecuritygroupB-{0}'.format(uuid.uuid4())
|
|
|
@@ -205,6 +209,7 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
|
|
|
"Security group {0} should have been deleted but still exists."
|
|
|
.format(name))
|
|
|
|
|
|
+ @helpers.skipIfNoService(['security.security_groups'])
|
|
|
def test_security_group_rule_add_twice(self):
|
|
|
"""Test whether adding the same rule twice succeeds."""
|
|
|
name = 'cbtestsecuritygroupB-{0}'.format(uuid.uuid4())
|
|
|
@@ -222,6 +227,7 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
|
|
|
"Expected rule {0} not found in security group: {0}".format(
|
|
|
same_rule, sg.rules))
|
|
|
|
|
|
+ @helpers.skipIfNoService(['security.security_groups'])
|
|
|
def test_security_group_group_rule(self):
|
|
|
"""Test for proper creation of a security group rule."""
|
|
|
name = 'cbtestsecuritygroupC-{0}'.format(uuid.uuid4())
|