Merge remote-tracking branch 'qubesos/pr/190'

* qubesos/pr/190:
  Missed one test, adding default-user in assert for test test_621_qdb_vm_with_network in TC_90
  replaced underscore by dash and update test accordingly
  Updated assert content for test_620_qdb_standalone in TC_90_QubesVM
  Added the default_user property from the Qube to the qubesdb so it is available when starting X. This is the 1st part of a fix for issue https://github.com/QubesOS/qubes-issues/issues/2372
This commit is contained in:
Marek Marczykowski-Górecki 2018-02-14 01:29:08 +01:00
commit b00bbb73e4
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 4 additions and 0 deletions

View File

@ -476,6 +476,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
del vm.default_user del vm.default_user
self.assertPropertyDefaultValue(vm, 'default_user', 'user') self.assertPropertyDefaultValue(vm, 'default_user', 'user')
self.assertPropertyValue(vm, 'default_user', 123, '123', '123') self.assertPropertyValue(vm, 'default_user', 123, '123', '123')
vm.default_user = 'user'
# TODO: check propagation for template-based VMs # TODO: check propagation for template-based VMs
@unittest.skip('TODO') @unittest.skip('TODO')
@ -901,6 +902,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
self.assertEqual(test_qubesdb.data, { self.assertEqual(test_qubesdb.data, {
'/name': 'test-inst-test', '/name': 'test-inst-test',
'/type': 'StandaloneVM', '/type': 'StandaloneVM',
'/default-user': 'user',
'/qubes-vm-type': 'AppVM', '/qubes-vm-type': 'AppVM',
'/qubes-debug-mode': '0', '/qubes-debug-mode': '0',
'/qubes-base-template': '', '/qubes-base-template': '',
@ -960,6 +962,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
expected = { expected = {
'/name': 'test-inst-appvm', '/name': 'test-inst-appvm',
'/type': 'AppVM', '/type': 'AppVM',
'/default-user': 'user',
'/qubes-vm-type': 'AppVM', '/qubes-vm-type': 'AppVM',
'/qubes-debug-mode': '0', '/qubes-debug-mode': '0',
'/qubes-base-template': 'test-inst-template', '/qubes-base-template': 'test-inst-template',

View File

@ -1798,6 +1798,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
self.untrusted_qdb.write('/name', self.name) self.untrusted_qdb.write('/name', self.name)
self.untrusted_qdb.write('/type', self.__class__.__name__) self.untrusted_qdb.write('/type', self.__class__.__name__)
self.untrusted_qdb.write('/default-user', self.default_user)
self.untrusted_qdb.write('/qubes-vm-updateable', str(self.updateable)) self.untrusted_qdb.write('/qubes-vm-updateable', str(self.updateable))
self.untrusted_qdb.write('/qubes-vm-persistence', self.untrusted_qdb.write('/qubes-vm-persistence',
'full' if self.updateable else 'rw-only') 'full' if self.updateable else 'rw-only')