def test_13_move_across_subdomain_vm_snapshot(self): """Test as domain admin, stop a VM from subdomain1 and attempt to move it to subdomain2 """ # Validate the following: # 1. deploy VM in sub subdomain1 with snapshot. # 3. assignVirtualMachine to subdomain2 self.create_vm(self.sdomain_account_user1['account'], self.sdomain_account_user1['domain'], snapshot=True) self.virtual_machine.assign_virtual_machine(self.apiclient, self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id) snapshots = list_snapshots(self.apiclient, id=self.snapshot.id) self.assertEqual(snapshots, None, "Snapshots stil present for a vm in domain")
def test_13_move_across_subdomain_vm_snapshot(self): """Test as domain admin, stop a VM from subdomain1 and attempt to move it to subdomain2 """ # Validate the following: # 1. deploy VM in sub subdomain1 with snapshot. # 3. assignVirtualMachine to subdomain2 self.create_vm(self.sdomain_account_user1['account'], self.sdomain_account_user1['domain'], snapshot=True) self.virtual_machine.assign_virtual_machine( self.apiclient, self.sdomain_account_user2['account'].name, self.sdomain_account_user2['domain'].id) snapshots = list_snapshots(self.apiclient, id=self.snapshot.id) self.assertEqual(snapshots, None, "Snapshots stil present for a vm in domain")
def get_Snapshots_For_Account(self, account, domainid): try: snapshots = list_snapshots(self.apiclient, account=account, domainid=domainid, listall=True, key='type', value='manual') self.debug("List Snapshots result : %s" % snapshots) self.assertEqual(isinstance(snapshots, list), True, "List snapshots shall return a valid list") return snapshots except Exception as e: self.fail("Failed to fetch snapshots for account: %s - %s" % (account, e))
def get_Snapshots_For_Account(self, account, domainid): try: snapshots = list_snapshots( self.apiclient, account=account, domainid=domainid, listall=True, key='type', value='manual' ) self.debug("List Snapshots result : %s" % snapshots) self.assertEqual( isinstance(snapshots, list), True, "List snapshots shall return a valid list" ) return snapshots except Exception as e: self.fail("Failed to fetch snapshots for account: %s - %s" % (account, e))