From 1c3b412ef80e81cb8dafcda55976a25f82902592 Mon Sep 17 00:00:00 2001 From: Yassine Ilmi Date: Thu, 1 Feb 2018 00:12:51 +0000 Subject: [PATCH 1/4] 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 --- qubes/vm/qubesvm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index b6892a28..34642007 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -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('/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-persistence', 'full' if self.updateable else 'rw-only') From 0eb978c59ba2ca67bcb180011e78325bf49de30a Mon Sep 17 00:00:00 2001 From: Yassine Ilmi Date: Thu, 1 Feb 2018 00:33:12 +0000 Subject: [PATCH 2/4] Updated assert content for test_620_qdb_standalone in TC_90_QubesVM --- qubes/tests/vm/qubesvm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qubes/tests/vm/qubesvm.py b/qubes/tests/vm/qubesvm.py index 46058968..f7327db7 100644 --- a/qubes/tests/vm/qubesvm.py +++ b/qubes/tests/vm/qubesvm.py @@ -901,6 +901,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase): self.assertEqual(test_qubesdb.data, { '/name': 'test-inst-test', '/type': 'StandaloneVM', + '/default_user': 'user', '/qubes-vm-type': 'AppVM', '/qubes-debug-mode': '0', '/qubes-base-template': '', From a0d45aac9c548fdb04b2b756c0d302c4d84fe572 Mon Sep 17 00:00:00 2001 From: Yassine Ilmi Date: Thu, 1 Feb 2018 00:50:42 +0000 Subject: [PATCH 3/4] replaced underscore by dash and update test accordingly --- qubes/tests/vm/qubesvm.py | 3 ++- qubes/vm/qubesvm.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qubes/tests/vm/qubesvm.py b/qubes/tests/vm/qubesvm.py index f7327db7..ddd041f2 100644 --- a/qubes/tests/vm/qubesvm.py +++ b/qubes/tests/vm/qubesvm.py @@ -476,6 +476,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase): del vm.default_user self.assertPropertyDefaultValue(vm, 'default_user', 'user') self.assertPropertyValue(vm, 'default_user', 123, '123', '123') + vm.default_user = 'user' # TODO: check propagation for template-based VMs @unittest.skip('TODO') @@ -901,7 +902,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase): self.assertEqual(test_qubesdb.data, { '/name': 'test-inst-test', '/type': 'StandaloneVM', - '/default_user': 'user', + '/default-user': 'user', '/qubes-vm-type': 'AppVM', '/qubes-debug-mode': '0', '/qubes-base-template': '', diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 34642007..7a31c17a 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -1798,7 +1798,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): self.untrusted_qdb.write('/name', self.name) self.untrusted_qdb.write('/type', self.__class__.__name__) - self.untrusted_qdb.write('/default_user', self.default_user) + 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-persistence', 'full' if self.updateable else 'rw-only') From 65d5c41fdbb1a69f5c38f6d63744d903556ac2de Mon Sep 17 00:00:00 2001 From: Yassine Ilmi Date: Thu, 1 Feb 2018 01:03:05 +0000 Subject: [PATCH 4/4] Missed one test, adding default-user in assert for test test_621_qdb_vm_with_network in TC_90 --- qubes/tests/vm/qubesvm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qubes/tests/vm/qubesvm.py b/qubes/tests/vm/qubesvm.py index ddd041f2..b3316b04 100644 --- a/qubes/tests/vm/qubesvm.py +++ b/qubes/tests/vm/qubesvm.py @@ -962,6 +962,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase): expected = { '/name': 'test-inst-appvm', '/type': 'AppVM', + '/default-user': 'user', '/qubes-vm-type': 'AppVM', '/qubes-debug-mode': '0', '/qubes-base-template': 'test-inst-template',