|
@@ -83,13 +83,31 @@ class AzureSecurityServiceTestCase(ProviderTestBase):
|
|
|
self.assertEqual(len(rules), 2)
|
|
self.assertEqual(len(rules), 2)
|
|
|
|
|
|
|
|
@helpers.skipIfNoService(['security.security_groups'])
|
|
@helpers.skipIfNoService(['security.security_groups'])
|
|
|
- def test_azure_security_group_rule_get(self):
|
|
|
|
|
|
|
+ def test_azure_security_group_rule_delete_Default(self):
|
|
|
|
|
+ list = self.provider.security.security_groups.list()
|
|
|
|
|
+ cb = list.data[0]
|
|
|
|
|
+ rules = cb.rules
|
|
|
|
|
+ print("Before deleting Rule - " + str(rules[0]) + " length - " + str(len(rules)))
|
|
|
|
|
+
|
|
|
|
|
+ with self.assertRaises(Exception):
|
|
|
|
|
+ rules[0].delete()
|
|
|
|
|
+
|
|
|
|
|
+ @helpers.skipIfNoService(['security.security_groups'])
|
|
|
|
|
+ def test_azure_security_group_rule_get_exist(self):
|
|
|
list = self.provider.security.security_groups.list()
|
|
list = self.provider.security.security_groups.list()
|
|
|
cb = list.data[0]
|
|
cb = list.data[0]
|
|
|
rule = cb.get_rule('*', '25', '1', '100')
|
|
rule = cb.get_rule('*', '25', '1', '100')
|
|
|
print("Get Rule - " + str(rule))
|
|
print("Get Rule - " + str(rule))
|
|
|
self.assertEqual(str(rule), "<CBSecurityGroupRule: IP: *; from: 25; to: 1; grp: None>")
|
|
self.assertEqual(str(rule), "<CBSecurityGroupRule: IP: *; from: 25; to: 1; grp: None>")
|
|
|
|
|
|
|
|
|
|
+ @helpers.skipIfNoService(['security.security_groups'])
|
|
|
|
|
+ def test_azure_security_group_rule_get_notExist(self):
|
|
|
|
|
+ list = self.provider.security.security_groups.list()
|
|
|
|
|
+ cb = list.data[0]
|
|
|
|
|
+ rule = cb.get_rule('*', '25', '1', '1')
|
|
|
|
|
+ print("Get Rule - " + str(rule))
|
|
|
|
|
+ self.assertEqual(str(rule), 'None')
|
|
|
|
|
+
|
|
|
@helpers.skipIfNoService(['security.security_groups'])
|
|
@helpers.skipIfNoService(['security.security_groups'])
|
|
|
def test_azure_security_group_to_json(self):
|
|
def test_azure_security_group_to_json(self):
|
|
|
list = self.provider.security.security_groups.list()
|
|
list = self.provider.security.security_groups.list()
|