예제 #1
0
 def test_011_remote_create_specific(self):
     vm = qubesadmin.vm.DispVM.from_appvm(self.app, 'test-vm')
     (stdout, stderr) = vm.run_service_for_stdio('test.service')
     vm.cleanup()
     self.assertEqual(self.app.service_calls, [
         ('$dispvm:test-vm', 'test.service', {}),
         ('$dispvm:test-vm', 'test.service', b''),
     ])
     self.assertAllCalled()
예제 #2
0
 def test_000_local_create_default(self):
     self.app.qubesd_connection_type = 'socket'
     self.app.expected_calls[('dom0', 'admin.vm.CreateDisposable', None,
                              None)] = b'0\0disp123'
     self.app.expected_calls[('disp123', 'admin.vm.Kill', None,
                              None)] = b'0\0'
     vm = qubesadmin.vm.DispVM.from_appvm(self.app, None)
     (stdout, stderr) = vm.run_service_for_stdio('test.service')
     vm.cleanup()
     self.assertEqual(self.app.service_calls, [
         ('disp123', 'test.service', {}),
         ('disp123', 'test.service', b''),
     ])
     self.assertAllCalled()
예제 #3
0
 def test_001_local_create_specific(self):
     self.app.qubesd_connection_type = 'socket'
     self.app.expected_calls[
         ('test-vm', 'admin.vm.CreateDisposable', None, None)] = \
         b'0\0disp123'
     self.app.expected_calls[('disp123', 'admin.vm.Kill', None,
                              None)] = b'0\0'
     self.app.expected_calls[
         ('disp123', 'admin.vm.property.Get', 'qrexec_timeout', None)] = \
         b'0\0default=yes type=int 30'
     vm = qubesadmin.vm.DispVM.from_appvm(self.app, 'test-vm')
     (stdout, stderr) = vm.run_service_for_stdio('test.service')
     vm.cleanup()
     self.assertEqual(self.app.service_calls, [
         ('disp123', 'test.service', {
             'connect_timeout': 30
         }),
         ('disp123', 'test.service', b''),
     ])
     self.assertAllCalled()