def create_vms(cls): si = vmdk_ops.get_si() error, cls.vm1 = vmdk_ops_test.create_vm(si=si, vm_name=cls.vm1_name, datastore_name=cls.datastore) if error: cls.fail("Failed to create VM1!") error, cls.vm2 = vmdk_ops_test.create_vm(si=si, vm_name=cls.vm2_name, datastore_name=cls.datastore) if error: cls.fail("Failed to create VM2!")
def setUp(self): """ Setup run before each test """ if (not self.datastore_name): datastores = vmdk_utils.get_datastores() if datastores: datastore = datastores[0] self.datastore_name = datastore[0] self.datastore_path = datastore[2] if len(datastores) > 1: datastore1 = datastores[1] self.datastore1_name = datastore1[0] self.datastoer1_path = datastore[2] else: self.assertFalse(True) self.cleanup() # get service_instance, and create VMs si = vmdk_ops.get_si() error, self.vm1 = vmdk_ops_test.create_vm(si=si, vm_name=self.vm1_name, datastore_name=self.datastore_name) if error: self.assertFalse(True) self.vm1_config_path = vmdk_utils.get_vm_config_path(self.vm1_name) logging.info("TestTenant: create vm1 name=%s Done", self.vm1_name) error, self.vm2 = vmdk_ops_test.create_vm(si=si, vm_name=self.vm2_name, datastore_name=self.datastore_name) if error: self.assertFalse(True) self.vm2_config_path = vmdk_utils.get_vm_config_path(self.vm2_name) logging.info("TestTenant: create vm2 name=%s Done", self.vm2_name)