@@ -86,26 +86,40 @@ def test_001_list_assigned_required(self):
86
86
# This shouldn't be listed
87
87
self .expected_device_call (
88
88
'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
+ )
91
94
self .expected_device_call ('test-vm1' , 'Attached' )
92
95
self .expected_device_call ('test-vm2' , 'Attached' )
93
96
self .expected_device_call ('test-vm3' , 'Attached' )
94
97
self .expected_device_call ('test-vm1' , 'Assigned' )
95
- self .expected_device_call ('test-vm2' , 'Assigned' )
96
98
self .expected_device_call (
97
- 'test-vm3 ' , 'Assigned' ,
99
+ 'test-vm2 ' , 'Assigned' ,
98
100
b"0\0 test-vm1+dev1 ident='dev1' devclass='testclass' "
99
101
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' "
100
105
b"required='yes'\n "
101
106
)
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
+ )
102
113
103
114
with qubesadmin .tests .tools .StdoutBuffer () as buf :
104
115
qubesadmin .tools .qvm_device .main (
105
116
['testclass' , 'list' , 'test-vm3' ], app = self .app )
106
117
self .assertEqual (
107
118
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 '
109
123
)
110
124
111
125
def test_002_list_attach (self ):
0 commit comments