@@ -86,26 +86,40 @@ def test_001_list_assigned_required(self):
8686 # This shouldn't be listed
8787 self .expected_device_call (
8888 'test-vm2' , 'Available' ,
89- b"0\0 dev2 ident='dev1' devclass='testclass' backend_domain='test-vm2'\n " )
90- self .expected_device_call ('test-vm3' , 'Available' )
89+ b"0\0 dev2 ident='dev2' devclass='testclass' backend_domain='test-vm2'\n " )
90+ self .expected_device_call (
91+ 'test-vm3' , 'Available' ,
92+ b"0\0 dev3 ident='dev3' devclass='testclass' backend_domain='test-vm3' vendor='evil inc.' product='test-device-3'\n "
93+ )
9194 self .expected_device_call ('test-vm1' , 'Attached' )
9295 self .expected_device_call ('test-vm2' , 'Attached' )
9396 self .expected_device_call ('test-vm3' , 'Attached' )
9497 self .expected_device_call ('test-vm1' , 'Assigned' )
95- self .expected_device_call ('test-vm2' , 'Assigned' )
9698 self .expected_device_call (
97- 'test-vm3 ' , 'Assigned' ,
99+ 'test-vm2 ' , 'Assigned' ,
98100 b"0\0 test-vm1+dev1 ident='dev1' devclass='testclass' "
99101 b"backend_domain='test-vm1' attach_automatically='yes' "
102+ b"required='yes' _option='other option' _extra_opt='yes'\n "
103+ b"test-vm3+dev3 ident='dev3' devclass='testclass' "
104+ b"backend_domain='test-vm3' attach_automatically='yes' "
100105 b"required='yes'\n "
101106 )
107+ self .expected_device_call (
108+ 'test-vm3' , 'Assigned' ,
109+ b"0\0 test-vm1+dev1 ident='dev1' devclass='testclass' "
110+ b"backend_domain='test-vm1' attach_automatically='yes' "
111+ b"required='yes' _option='test option'\n "
112+ )
102113
103114 with qubesadmin .tests .tools .StdoutBuffer () as buf :
104115 qubesadmin .tools .qvm_device .main (
105116 ['testclass' , 'list' , 'test-vm3' ], app = self .app )
106117 self .assertEqual (
107118 buf .getvalue (),
108- 'test-vm1:dev1 ?******: itl test-device test-vm3\n '
119+ 'test-vm1:dev1 ?******: itl test-device '
120+ 'test-vm2 (option=other option, extra_opt=yes), '
121+ 'test-vm3 (option=test option)\n '
122+ 'test-vm3:dev3 ?******: evil inc. test-device-3 test-vm2\n '
109123 )
110124
111125 def test_002_list_attach (self ):
0 commit comments