Ehsan Chiniforooshan 8 лет назад
Родитель
Сommit
dd6ec80ca6

+ 9 - 9
test/test_block_store_service.py

@@ -35,14 +35,14 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
                          terminal_states=[VolumeState.ERROR])
                          terminal_states=[VolumeState.ERROR])
 
 
         sit.check_crud(self, self.provider.storage.volumes, Volume,
         sit.check_crud(self, self.provider.storage.volumes, Volume,
-                       "cb_createvol", create_vol, cleanup_vol)
+                       "cb-createvol", create_vol, cleanup_vol)
 
 
     @helpers.skipIfNoService(['storage.volumes'])
     @helpers.skipIfNoService(['storage.volumes'])
     def test_attach_detach_volume(self):
     def test_attach_detach_volume(self):
         """
         """
         Create a new volume, and attempt to attach it to an instance
         Create a new volume, and attempt to attach it to an instance
         """
         """
-        name = "cb_attachvol-{0}".format(helpers.get_uuid())
+        name = "cb-attachvol-{0}".format(helpers.get_uuid())
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values
         net = None
         net = None
@@ -72,7 +72,7 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
         """
         """
         Test volume properties
         Test volume properties
         """
         """
-        name = "cb_volprops-{0}".format(helpers.get_uuid())
+        name = "cb-volprops-{0}".format(helpers.get_uuid())
         vol_desc = 'newvoldesc1'
         vol_desc = 'newvoldesc1'
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values
@@ -134,7 +134,7 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
         whether list_snapshots properly detects the new snapshot.
         whether list_snapshots properly detects the new snapshot.
         Delete everything afterwards.
         Delete everything afterwards.
         """
         """
-        name = "cb_crudsnap-{0}".format(helpers.get_uuid())
+        name = "cb-crudsnap-{0}".format(helpers.get_uuid())
         test_vol = self.provider.storage.volumes.create(
         test_vol = self.provider.storage.volumes.create(
             name,
             name,
             1,
             1,
@@ -153,7 +153,7 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
                     terminal_states=[SnapshotState.ERROR])
                     terminal_states=[SnapshotState.ERROR])
 
 
             sit.check_crud(self, self.provider.storage.snapshots, Snapshot,
             sit.check_crud(self, self.provider.storage.snapshots, Snapshot,
-                           "cb_snap", create_snap, cleanup_snap)
+                           "cb-snap", create_snap, cleanup_snap)
 
 
             # Test creation of a snap via SnapshotService
             # Test creation of a snap via SnapshotService
             def create_snap2(name):
             def create_snap2(name):
@@ -164,21 +164,21 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
                     not isinstance(self.provider, TestMockHelperMixin)):
                     not isinstance(self.provider, TestMockHelperMixin)):
                 time.sleep(15)  # Or get SnapshotCreationPerVolumeRateExceeded
                 time.sleep(15)  # Or get SnapshotCreationPerVolumeRateExceeded
             sit.check_crud(self, self.provider.storage.snapshots, Snapshot,
             sit.check_crud(self, self.provider.storage.snapshots, Snapshot,
-                           "cb_snaptwo", create_snap2, cleanup_snap)
+                           "cb-snaptwo", create_snap2, cleanup_snap)
 
 
     @helpers.skipIfNoService(['storage.snapshots'])
     @helpers.skipIfNoService(['storage.snapshots'])
     def test_snapshot_properties(self):
     def test_snapshot_properties(self):
         """
         """
         Test snapshot properties
         Test snapshot properties
         """
         """
-        name = "cb_snapprop-{0}".format(uuid.uuid4())
+        name = "cb-snapprop-{0}".format(uuid.uuid4())
         test_vol = self.provider.storage.volumes.create(
         test_vol = self.provider.storage.volumes.create(
             name,
             name,
             1,
             1,
             helpers.get_provider_test_data(self.provider, "placement"))
             helpers.get_provider_test_data(self.provider, "placement"))
         with helpers.cleanup_action(lambda: test_vol.delete()):
         with helpers.cleanup_action(lambda: test_vol.delete()):
             test_vol.wait_till_ready()
             test_vol.wait_till_ready()
-            snap_name = "cb_snap-{0}".format(name)
+            snap_name = "cb-snap-{0}".format(name)
             test_snap = test_vol.create_snapshot(name=snap_name,
             test_snap = test_vol.create_snapshot(name=snap_name,
                                                  description=snap_name)
                                                  description=snap_name)
 
 
@@ -209,7 +209,7 @@ class CloudBlockStoreServiceTestCase(ProviderTestBase):
                 self.assertEqual(test_snap.description, 'snapnewdescription1')
                 self.assertEqual(test_snap.description, 'snapnewdescription1')
 
 
                 # Test volume creation from a snapshot (via VolumeService)
                 # Test volume creation from a snapshot (via VolumeService)
-                sv_name = "cb_snapvol_{0}".format(test_snap.name)
+                sv_name = "cb-snapvol-{0}".format(test_snap.name)
                 snap_vol = self.provider.storage.volumes.create(
                 snap_vol = self.provider.storage.volumes.create(
                     sv_name,
                     sv_name,
                     1,
                     1,

+ 5 - 5
test/test_compute_service.py

@@ -18,7 +18,7 @@ class CloudComputeServiceTestCase(ProviderTestBase):
 
 
     @helpers.skipIfNoService(['compute.instances', 'networking.networks'])
     @helpers.skipIfNoService(['compute.instances', 'networking.networks'])
     def test_crud_instance(self):
     def test_crud_instance(self):
-        name = "cb_instcrud-{0}".format(helpers.get_uuid())
+        name = "cb-instcrud-{0}".format(helpers.get_uuid())
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values
         net = None
         net = None
@@ -49,7 +49,7 @@ class CloudComputeServiceTestCase(ProviderTestBase):
             net, subnet = helpers.create_test_network(self.provider, name)
             net, subnet = helpers.create_test_network(self.provider, name)
 
 
             sit.check_crud(self, self.provider.compute.instances, Instance,
             sit.check_crud(self, self.provider.compute.instances, Instance,
-                           "cb_instcrud", create_inst, cleanup_inst,
+                           "cb-instcrud", create_inst, cleanup_inst,
                            custom_check_delete=check_deleted)
                            custom_check_delete=check_deleted)
 
 
     def _is_valid_ip(self, address):
     def _is_valid_ip(self, address):
@@ -63,7 +63,7 @@ class CloudComputeServiceTestCase(ProviderTestBase):
                               'security.vm_firewalls',
                               'security.vm_firewalls',
                               'security.key_pairs'])
                               'security.key_pairs'])
     def test_instance_properties(self):
     def test_instance_properties(self):
-        name = "cb_inst_props-{0}".format(helpers.get_uuid())
+        name = "cb-inst_props-{0}".format(helpers.get_uuid())
 
 
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values
@@ -207,7 +207,7 @@ class CloudComputeServiceTestCase(ProviderTestBase):
     @helpers.skipIfNoService(['compute.instances', 'compute.images',
     @helpers.skipIfNoService(['compute.instances', 'compute.images',
                               'compute.vm_types', 'storage.volumes'])
                               'compute.vm_types', 'storage.volumes'])
     def test_block_device_mapping_attachments(self):
     def test_block_device_mapping_attachments(self):
-        name = "cb_blkattch-{0}".format(helpers.get_uuid())
+        name = "cb-blkattch-{0}".format(helpers.get_uuid())
 
 
         if self.provider.PROVIDER_ID == ProviderList.OPENSTACK:
         if self.provider.PROVIDER_ID == ProviderList.OPENSTACK:
             raise self.skipTest("Not running BDM tests because OpenStack is"
             raise self.skipTest("Not running BDM tests because OpenStack is"
@@ -293,7 +293,7 @@ class CloudComputeServiceTestCase(ProviderTestBase):
                               'networking.floating_ips',
                               'networking.floating_ips',
                               'security.vm_firewalls'])
                               'security.vm_firewalls'])
     def test_instance_methods(self):
     def test_instance_methods(self):
-        name = "cb_instmethods-{0}".format(helpers.get_uuid())
+        name = "cb-instmethods-{0}".format(helpers.get_uuid())
 
 
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values

+ 2 - 2
test/test_image_service.py

@@ -16,7 +16,7 @@ class CloudImageServiceTestCase(ProviderTestBase):
         This covers waiting till the image is ready, checking that the image
         This covers waiting till the image is ready, checking that the image
         name is the expected one and whether list_images is functional.
         name is the expected one and whether list_images is functional.
         """
         """
-        instance_name = "cb_crudimage-{0}".format(helpers.get_uuid())
+        instance_name = "cb-crudimage-{0}".format(helpers.get_uuid())
 
 
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values
@@ -45,5 +45,5 @@ class CloudImageServiceTestCase(ProviderTestBase):
                 self.provider, instance_name, subnet=subnet)
                 self.provider, instance_name, subnet=subnet)
 
 
             sit.check_crud(self, self.provider.compute.images, MachineImage,
             sit.check_crud(self, self.provider.compute.images, MachineImage,
-                           "cb_listimg", create_img, cleanup_img,
+                           "cb-listimg", create_img, cleanup_img,
                            extra_test_func=extra_tests)
                            extra_test_func=extra_tests)

+ 2 - 2
test/test_interface.py

@@ -55,8 +55,8 @@ class CloudInterfaceTestCase(ProviderTestBase):
             cloned_config['aws_access_key'] = "dummy_a_key"
             cloned_config['aws_access_key'] = "dummy_a_key"
             cloned_config['aws_secret_key'] = "dummy_s_key"
             cloned_config['aws_secret_key'] = "dummy_s_key"
         elif self.provider.PROVIDER_ID == 'openstack':
         elif self.provider.PROVIDER_ID == 'openstack':
-            cloned_config['os_username'] = "cb_dummy"
-            cloned_config['os_password'] = "cb_dummy"
+            cloned_config['os_username'] = "cb-dummy"
+            cloned_config['os_password'] = "cb-dummy"
 
 
         with self.assertRaises(ProviderConnectionException):
         with self.assertRaises(ProviderConnectionException):
             cloned_provider = CloudProviderFactory().create_provider(
             cloned_provider = CloudProviderFactory().create_provider(

+ 7 - 7
test/test_network_service.py

@@ -21,12 +21,12 @@ class CloudNetworkServiceTestCase(ProviderTestBase):
             self.provider.networking.networks.delete(network_id=net.id)
             self.provider.networking.networks.delete(network_id=net.id)
 
 
         sit.check_crud(self, self.provider.networking.networks, Network,
         sit.check_crud(self, self.provider.networking.networks, Network,
-                       "cb_crudnetwork", create_net, cleanup_net)
+                       "cb-crudnetwork", create_net, cleanup_net)
 
 
     @helpers.skipIfNoService(['networking.networks'])
     @helpers.skipIfNoService(['networking.networks'])
     def test_network_properties(self):
     def test_network_properties(self):
-        name = 'cb_propnetwork-{0}'.format(helpers.get_uuid())
-        subnet_name = 'cb_propsubnet-{0}'.format(helpers.get_uuid())
+        name = 'cb-propnetwork-{0}'.format(helpers.get_uuid())
+        subnet_name = 'cb-propsubnet-{0}'.format(helpers.get_uuid())
         net = self.provider.networking.networks.create(
         net = self.provider.networking.networks.create(
             name=name, cidr_block='10.0.0.0/16')
             name=name, cidr_block='10.0.0.0/16')
         with helpers.cleanup_action(
         with helpers.cleanup_action(
@@ -80,7 +80,7 @@ class CloudNetworkServiceTestCase(ProviderTestBase):
         def cleanup_subnet(subnet):
         def cleanup_subnet(subnet):
             self.provider.networking.subnets.delete(subnet=subnet)
             self.provider.networking.subnets.delete(subnet=subnet)
 
 
-        net_name = 'cb_crudsubnet-{0}'.format(helpers.get_uuid())
+        net_name = 'cb-crudsubnet-{0}'.format(helpers.get_uuid())
         net = self.provider.networking.networks.create(
         net = self.provider.networking.networks.create(
             name=net_name, cidr_block='10.0.0.0/16')
             name=net_name, cidr_block='10.0.0.0/16')
         with helpers.cleanup_action(
         with helpers.cleanup_action(
@@ -88,7 +88,7 @@ class CloudNetworkServiceTestCase(ProviderTestBase):
                 self.provider.networking.networks.delete(network_id=net.id)
                 self.provider.networking.networks.delete(network_id=net.id)
         ):
         ):
             sit.check_crud(self, self.provider.networking.subnets, Subnet,
             sit.check_crud(self, self.provider.networking.subnets, Subnet,
-                           "cb_crudsubnet", create_subnet, cleanup_subnet)
+                           "cb-crudsubnet", create_subnet, cleanup_subnet)
 
 
     @helpers.skipIfNoService(['networking.floating_ips'])
     @helpers.skipIfNoService(['networking.floating_ips'])
     def test_crud_floating_ip(self):
     def test_crud_floating_ip(self):
@@ -100,7 +100,7 @@ class CloudNetworkServiceTestCase(ProviderTestBase):
             self.provider.networking.floating_ips.delete(fip.id)
             self.provider.networking.floating_ips.delete(fip.id)
 
 
         sit.check_crud(self, self.provider.networking.floating_ips, FloatingIP,
         sit.check_crud(self, self.provider.networking.floating_ips, FloatingIP,
-                       "cb_crudfip", create_fip, cleanup_fip,
+                       "cb-crudfip", create_fip, cleanup_fip,
                        skip_name_check=True)
                        skip_name_check=True)
 
 
     def test_floating_ip_properties(self):
     def test_floating_ip_properties(self):
@@ -134,7 +134,7 @@ class CloudNetworkServiceTestCase(ProviderTestBase):
                             router.detach_subnet(subnet)
                             router.detach_subnet(subnet)
                             router.detach_gateway(gateway)
                             router.detach_gateway(gateway)
 
 
-        name = 'cb_crudrouter-{0}'.format(helpers.get_uuid())
+        name = 'cb-crudrouter-{0}'.format(helpers.get_uuid())
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values
         net = None
         net = None

+ 1 - 1
test/test_object_life_cycle.py

@@ -12,7 +12,7 @@ class CloudObjectLifeCycleTestCase(ProviderTestBase):
         """
         """
         Test object life cycle methods by using a volume.
         Test object life cycle methods by using a volume.
         """
         """
-        name = "cb_objlifecycle-{0}".format(helpers.get_uuid())
+        name = "cb-objlifecycle-{0}".format(helpers.get_uuid())
         test_vol = self.provider.storage.volumes.create(
         test_vol = self.provider.storage.volumes.create(
             name,
             name,
             1,
             1,

+ 2 - 2
test/test_object_store_service.py

@@ -34,7 +34,7 @@ class CloudObjectStoreServiceTestCase(ProviderTestBase):
 
 
         with self.assertRaises(InvalidNameException):
         with self.assertRaises(InvalidNameException):
             # underscores are not allowed in bucket names
             # underscores are not allowed in bucket names
-            create_bucket("cb_bucket")
+            create_bucket("cb-bucket")
 
 
         with self.assertRaises(InvalidNameException):
         with self.assertRaises(InvalidNameException):
             # names of length less than 3 should raise an exception
             # names of length less than 3 should raise an exception
@@ -73,7 +73,7 @@ class CloudObjectStoreServiceTestCase(ProviderTestBase):
             test_bucket = self.provider.storage.buckets.create(name)
             test_bucket = self.provider.storage.buckets.create(name)
 
 
             sit.check_crud(self, test_bucket.objects, BucketObject,
             sit.check_crud(self, test_bucket.objects, BucketObject,
-                           "cb_bucketobj", create_bucket_obj,
+                           "cb-bucketobj", create_bucket_obj,
                            cleanup_bucket_obj, skip_name_check=True)
                            cleanup_bucket_obj, skip_name_check=True)
 
 
     @helpers.skipIfNoService(['storage.buckets'])
     @helpers.skipIfNoService(['storage.buckets'])

+ 10 - 10
test/test_security_service.py

@@ -26,12 +26,12 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
                 self.provider.security.key_pairs.create(name=kp.name)
                 self.provider.security.key_pairs.create(name=kp.name)
 
 
         sit.check_crud(self, self.provider.security.key_pairs, KeyPair,
         sit.check_crud(self, self.provider.security.key_pairs, KeyPair,
-                       "cb_crudkp", create_kp, cleanup_kp,
+                       "cb-crudkp", create_kp, cleanup_kp,
                        extra_test_func=extra_tests)
                        extra_test_func=extra_tests)
 
 
     @helpers.skipIfNoService(['security.key_pairs'])
     @helpers.skipIfNoService(['security.key_pairs'])
     def test_key_pair_properties(self):
     def test_key_pair_properties(self):
-        name = 'cb_kpprops-{0}'.format(helpers.get_uuid())
+        name = 'cb-kpprops-{0}'.format(helpers.get_uuid())
         kp = self.provider.security.key_pairs.create(name=name)
         kp = self.provider.security.key_pairs.create(name=name)
         with helpers.cleanup_action(lambda: kp.delete()):
         with helpers.cleanup_action(lambda: kp.delete()):
             self.assertIsNotNone(
             self.assertIsNotNone(
@@ -44,7 +44,7 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
 
 
     @helpers.skipIfNoService(['security.vm_firewalls'])
     @helpers.skipIfNoService(['security.vm_firewalls'])
     def test_crud_vm_firewall(self):
     def test_crud_vm_firewall(self):
-        name = 'cb_crudfw-{0}'.format(helpers.get_uuid())
+        name = 'cb-crudfw-{0}'.format(helpers.get_uuid())
 
 
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values
@@ -62,11 +62,11 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
             net, _ = helpers.create_test_network(self.provider, name)
             net, _ = helpers.create_test_network(self.provider, name)
 
 
             sit.check_crud(self, self.provider.security.vm_firewalls,
             sit.check_crud(self, self.provider.security.vm_firewalls,
-                           VMFirewall, "cb_crudfw", create_fw, cleanup_fw)
+                           VMFirewall, "cb-crudfw", create_fw, cleanup_fw)
 
 
     @helpers.skipIfNoService(['security.vm_firewalls'])
     @helpers.skipIfNoService(['security.vm_firewalls'])
     def test_vm_firewall_properties(self):
     def test_vm_firewall_properties(self):
-        name = 'cb_propfw-{0}'.format(helpers.get_uuid())
+        name = 'cb-propfw-{0}'.format(helpers.get_uuid())
 
 
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values
@@ -82,7 +82,7 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
 
 
     @helpers.skipIfNoService(['security.vm_firewalls'])
     @helpers.skipIfNoService(['security.vm_firewalls'])
     def test_crud_vm_firewall_rules(self):
     def test_crud_vm_firewall_rules(self):
-        name = 'cb_crudfw_rules-{0}'.format(helpers.get_uuid())
+        name = 'cb-crudfw_rules-{0}'.format(helpers.get_uuid())
 
 
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values
@@ -104,13 +104,13 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
                 def cleanup_fw_rule(rule):
                 def cleanup_fw_rule(rule):
                     rule.delete()
                     rule.delete()
 
 
-                sit.check_crud(self, fw.rules, VMFirewallRule, "cb_crudfwrule",
+                sit.check_crud(self, fw.rules, VMFirewallRule, "cb-crudfwrule",
                                create_fw_rule, cleanup_fw_rule,
                                create_fw_rule, cleanup_fw_rule,
                                skip_name_check=True)
                                skip_name_check=True)
 
 
     @helpers.skipIfNoService(['security.vm_firewalls'])
     @helpers.skipIfNoService(['security.vm_firewalls'])
     def test_vm_firewall_rule_properties(self):
     def test_vm_firewall_rule_properties(self):
-        name = 'cb_propfwrule-{0}'.format(helpers.get_uuid())
+        name = 'cb-propfwrule-{0}'.format(helpers.get_uuid())
 
 
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values
@@ -133,7 +133,7 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
 
 
     @helpers.skipIfNoService(['security.vm_firewalls'])
     @helpers.skipIfNoService(['security.vm_firewalls'])
     def test_vm_firewall_rule_add_twice(self):
     def test_vm_firewall_rule_add_twice(self):
-        name = 'cb_fwruletwice-{0}'.format(helpers.get_uuid())
+        name = 'cb-fwruletwice-{0}'.format(helpers.get_uuid())
 
 
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values
@@ -157,7 +157,7 @@ class CloudSecurityServiceTestCase(ProviderTestBase):
 
 
     @helpers.skipIfNoService(['security.vm_firewalls'])
     @helpers.skipIfNoService(['security.vm_firewalls'])
     def test_vm_firewall_group_rule(self):
     def test_vm_firewall_group_rule(self):
-        name = 'cb_fwrule-{0}'.format(helpers.get_uuid())
+        name = 'cb-fwrule-{0}'.format(helpers.get_uuid())
 
 
         # Declare these variables and late binding will allow
         # Declare these variables and late binding will allow
         # the cleanup method access to the most current values
         # the cleanup method access to the most current values