@@ -734,13 +734,25 @@ def test_043_clone_devices(self):
734734 b'0\0 pci\n '
735735
736736 self .app .expected_calls [
737- ('test-vm' , 'admin.vm.device.pci.List' , None , None )] = \
738- b'0\0 test-vm2+dev1 ro=True\n ' \
739- b'test-vm3+dev2 required=True\n '
737+ ('test-vm' , 'admin.vm.device.pci.Assigned' , None , None )] = \
738+ (b"0\0 test-vm2+dev1 ident='dev1' devclass='pci' "
739+ b"backend_domain='test-vm2' attach_automatically='yes' "
740+ b"_ro='yes'\n "
741+ b"test-vm3+dev2 ident='dev2' devclass='pci' "
742+ b"backend_domain='test-vm3' attach_automatically='yes' "
743+ b"required='yes'\n " )
740744
741745 self .app .expected_calls [
742- ('new-name' , 'admin.vm.device.pci.Attach' , 'test-vm3+dev2' ,
743- b'required=True' )] = b'0\0 '
746+ ('new-name' , 'admin.vm.device.pci.Assign' , 'test-vm2+dev1' ,
747+ b"required='no' attach_automatically='yes' ident='dev1' "
748+ b"devclass='pci' backend_domain='test-vm2' "
749+ b"frontend_domain='new-name' _ro='yes'" )] = b'0\0 '
750+
751+ self .app .expected_calls [
752+ ('new-name' , 'admin.vm.device.pci.Assign' , 'test-vm3+dev2' ,
753+ b"required='yes' attach_automatically='yes' ident='dev2' "
754+ b"devclass='pci' backend_domain='test-vm3' "
755+ b"frontend_domain='new-name'" )] = b'0\0 '
744756
745757 new_vm = self .app .clone_vm ('test-vm' , 'new-name' )
746758 self .assertEqual (new_vm .name , 'new-name' )
@@ -770,20 +782,32 @@ def test_044_clone_devices_fail(self):
770782 b'0\0 pci\n '
771783
772784 self .app .expected_calls [
773- ('test-vm' , 'admin.vm.device.pci.List' , None , None )] = \
774- b'0\0 test-vm2+dev1 ro=True\n ' \
775- b'test-vm3+dev2 required=True\n '
785+ ('test-vm' , 'admin.vm.device.pci.Assigned' , None , None )] = \
786+ (b"0\0 test-vm2+dev1 ident='dev1' devclass='pci' "
787+ b"backend_domain='test-vm2' attach_automatically='yes' "
788+ b"_ro='yes'\n "
789+ b"test-vm3+dev2 ident='dev2' devclass='pci' "
790+ b"backend_domain='test-vm3' attach_automatically='yes' "
791+ b"required='yes'\n " )
776792
777793 self .app .expected_calls [
778- ('new-name' , 'admin.vm.device.pci.Attach' , 'test-vm3+dev2' ,
779- b'required=True' )] = \
794+ ('new-name' , 'admin.vm.device.pci.Assign' , 'test-vm2+dev1' ,
795+ b"required='no' attach_automatically='yes' ident='dev1' "
796+ b"devclass='pci' backend_domain='test-vm2' "
797+ b"frontend_domain='new-name' _ro='yes'" )] = b'0\0 '
798+
799+ self .app .expected_calls [
800+ ('new-name' , 'admin.vm.device.pci.Assign' , 'test-vm3+dev2' ,
801+ b"required='yes' attach_automatically='yes' ident='dev2' "
802+ b"devclass='pci' backend_domain='test-vm3' "
803+ b"frontend_domain='new-name'" )] = \
780804 b'2\0 QubesException\0 \0 something happened\0 '
781805
782806 self .app .expected_calls [
783807 ('new-name' , 'admin.vm.Remove' , None , None )] = b'0\0 '
784808
785809 with self .assertRaises (qubesadmin .exc .QubesException ):
786- new_vm = self .app .clone_vm ('test-vm' , 'new-name' )
810+ self .app .clone_vm ('test-vm' , 'new-name' )
787811
788812 self .assertAllCalled ()
789813
0 commit comments