qubesadmin.tests.backup package

Submodules

qubesadmin.tests.backup.backupcompatibility module

class qubesadmin.tests.backup.backupcompatibility.AppProxy(app, sync_queue)[source]

Bases: object

qubesd_call(dest, method, arg=None, payload=None, payload_stream=None)[source]
class qubesadmin.tests.backup.backupcompatibility.MockFirewall(import_data_queue, *args, **kwargs)[source]

Bases: qubesadmin.firewall.Firewall

class qubesadmin.tests.backup.backupcompatibility.MockVolume(import_data_queue, *args, **kwargs)[source]

Bases: qubesadmin.storage.Volume

class qubesadmin.tests.backup.backupcompatibility.TC_00_QubesXML(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

assertCorrectlyConverted(backup_app, expected_data)[source]
test_000_qubes_xml_r2()[source]
test_010_qubes_xml_r4()[source]
class qubesadmin.tests.backup.backupcompatibility.TC_10_BackupCompatibility(methodName='runTest')[source]

Bases: qubesadmin.tests.backup.BackupTestCase

append_backup_stream(f_name, stream, basedir=None)[source]
assertDirectoryExists(path)[source]
assertDom0Restored(timestamp)[source]
assertFileExists(path)[source]
calculate_hmac(f_name, algorithm='sha512', password='qubes')[source]
create_appmenus(dir, template, list)[source]
create_dom0_files()[source]
create_private_img(filename)[source]
create_v1_files(r2b2=False)[source]
create_v3_backup(encrypted=True, compressed=True)[source]

Create “backup format 3” backup - used in R2 and R3.0

Parameters:
  • encrypted – Should the backup be encrypted
  • compressed – Should the backup be compressed
Returns:

create_v4_backup(compressed=True)[source]

Create “backup format 4” backup - used in R4.0

Parameters:compressed – Should the backup be compressed
Returns:
create_v4_files()[source]
create_volatile_img(filename)[source]
create_whitelisted_appmenus(filename)[source]
dom0_dirs = ('Downloads', 'Pictures', 'Documents', '.config', '.local')
dom0_files = ('.bash_history', 'some-file.txt', 'Pictures/another-file.png')
fullpath(name)[source]
handle_v3_file(f_name, subdir, stream, compressed=True, encrypted=True)[source]
handle_v4_file(f_name, subdir, stream, compressed=True)[source]
mock_appmenus(queue, vm, stream)[source]
scrypt_encrypt(f_name, output_name=None, password='qubes', basedir=None)[source]
setup_expected_calls(parsed_qubes_xml, templates_map=None)[source]
storage_pool = None
tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_210_r2()[source]
test_220_r2_encrypted()[source]
test_230_r2_uncompressed()[source]
test_230_r4()[source]
test_230_r4_compressed()[source]
class qubesadmin.tests.backup.backupcompatibility.TC_11_BackupCompatibilityIntoLVM(methodName='runTest')[source]

Bases: qubesadmin.tests.backup.backupcompatibility.TC_10_BackupCompatibility

restore_backup(source=None, appvm=None, options=None, expect_errors=None, manipulate_restore_info=None, passphrase='qubes')[source]
storage_pool = 'some-pool'

Module contents

class qubesadmin.tests.backup.BackupTestCase(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

class BackupErrorHandler(errors_queue, level=0)[source]

Bases: logging.Handler

emit(record)[source]

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

assertCorrectlyRestored(orig_vms, orig_hashes)[source]

Verify if restored VMs are identical to those before backup.

Parameters:
  • orig_vms – collection of original QubesVM objects
  • orig_hashes – result of vm_checksum() on original VMs, before backup
Returns:

create_backup_vms(pool=None)[source]
create_sparse(path, size, signature=b'')[source]
fill_image(path, size=None, sparse=False, signature=b'')[source]
make_backup(vms, target=None, expect_failure=False, **kwargs)[source]
make_vm_name(name)[source]
restore_backup(source=None, appvm=None, options=None, expect_errors=None, manipulate_restore_info=None, passphrase='qubes')[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

vm_checksum(vms)[source]