Merge remote-tracking branch 'origin/pr/235'

* origin/pr/235:
  Add default_qrexec_timeout to qubes-prefs
This commit is contained in:
Marek Marczykowski-Górecki 2018-09-19 06:03:10 +02:00
commit 8b75b264ae
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
4 changed files with 19 additions and 1 deletions

View File

@ -718,6 +718,13 @@ class Qubes(qubes.PropertyHolder):
setter=_setter_pool,
doc='Default storage pool for kernel volumes')
default_qrexec_timeout = qubes.property('default_qrexec_timeout',
load_stage=3,
default=60,
type=int,
doc='''Default time in seconds after which qrexec connection attempt is
deemed failed''')
stats_interval = qubes.property('stats_interval',
default=3,
type=int,

View File

@ -88,6 +88,7 @@ class TestApp(qubes.tests.TestEmitter):
self.default_pool_root = 'default'
self.default_pool_private = 'default'
self.default_pool_kernel = 'linux-kernel'
self.default_qrexec_timeout = 60
self.default_netvm = None
self.domains = TestVMsCollection()
#: jinja2 environment for libvirt XML templates

View File

@ -459,6 +459,15 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
self.assertPropertyInvalidValue(vm, 'qrexec_timeout', '-2')
self.assertPropertyInvalidValue(vm, 'qrexec_timeout', '')
def test_272_qrexec_timeout_global_changed(self):
self.app.default_qrexec_timeout = 123
vm = self.get_vm()
self.assertPropertyDefaultValue(vm, 'qrexec_timeout', 123)
self.assertPropertyValue(vm, 'qrexec_timeout', 3, 3, '3')
del vm.qrexec_timeout
self.assertPropertyDefaultValue(vm, 'qrexec_timeout', 123)
self.assertPropertyValue(vm, 'qrexec_timeout', '3', 3, '3')
def test_280_autostart(self):
vm = self.get_vm()
# FIXME any better idea to not involve systemctl call at this stage?

View File

@ -510,7 +510,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
# return self._default_user
qrexec_timeout = qubes.property('qrexec_timeout', type=int,
default=_default_with_template('qrexec_timeout', 60),
default=_default_with_template('qrexec_timeout',
lambda self: self.app.default_qrexec_timeout),
setter=_setter_positive_int,
doc='''Time in seconds after which qrexec connection attempt is deemed
failed. Operating system inside VM should be able to boot in this