Fix qubes.tests.storage

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-07-12 18:05:10 +02:00
parent bba9b38e8e
commit 4cc7b8d2a8
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE

View File

@ -20,19 +20,16 @@ import qubes.log
from qubes.exc import QubesException from qubes.exc import QubesException
from qubes.storage import pool_drivers from qubes.storage import pool_drivers
from qubes.storage.file import FilePool from qubes.storage.file import FilePool
from qubes.tests import QubesTestCase, SystemTestsMixin from qubes.tests import QubesTestCase
# :pylint: disable=invalid-name # :pylint: disable=invalid-name
class TestApp(qubes.tests.TestEmitter):
pass
class TestVM(object): class TestVM(object):
def __init__(self, test, template=None): def __init__(self, test, template=None):
self.app = test.app self.app = test.app
self.name = test.make_vm_name('appvm') self.name = test.make_vm_name('appvm')
self.dir_path = '/var/lib/qubes/appvms/' + self.name
self.log = qubes.log.get_vm_logger(self.name) self.log = qubes.log.get_vm_logger(self.name)
if template: if template:
@ -50,6 +47,10 @@ class TestVM(object):
class TestTemplateVM(TestVM): class TestTemplateVM(TestVM):
dir_path_prefix = qubes.config.system_path['qubes_templates_dir'] dir_path_prefix = qubes.config.system_path['qubes_templates_dir']
def __init__(self, test, template=None):
super(TestTemplateVM, self).__init__(test, template)
self.dir_path = '/var/lib/qubes/vm-templates/' + self.name
def is_template(self): def is_template(self):
return True return True
@ -59,7 +60,7 @@ class TestDisposableVM(TestVM):
return True return True
class TestApp(qubes.Qubes): class TestApp(qubes.Qubes):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs): # pylint: disable=unused-argument
super(TestApp, self).__init__('/tmp/qubes-test.xml', super(TestApp, self).__init__('/tmp/qubes-test.xml',
load=False, offline_mode=True, **kwargs) load=False, offline_mode=True, **kwargs)
self.load_initial_values() self.load_initial_values()