qubesadmin.tests package¶
Subpackages¶
- qubesadmin.tests.backup package
- Submodules
- qubesadmin.tests.backup.backupcompatibility module
AppProxy
MockFirewall
MockVolume
TC_00_QubesXML
TC_10_BackupCompatibility
TC_10_BackupCompatibility.append_backup_stream()
TC_10_BackupCompatibility.assertDirectoryExists()
TC_10_BackupCompatibility.assertDom0Restored()
TC_10_BackupCompatibility.assertFileExists()
TC_10_BackupCompatibility.calculate_hmac()
TC_10_BackupCompatibility.cleanup_tmpdir()
TC_10_BackupCompatibility.create_appmenus()
TC_10_BackupCompatibility.create_dom0_files()
TC_10_BackupCompatibility.create_limited_tmpdir()
TC_10_BackupCompatibility.create_private_img()
TC_10_BackupCompatibility.create_v1_files()
TC_10_BackupCompatibility.create_v3_backup()
TC_10_BackupCompatibility.create_v4_backup()
TC_10_BackupCompatibility.create_v4_files()
TC_10_BackupCompatibility.create_volatile_img()
TC_10_BackupCompatibility.create_whitelisted_appmenus()
TC_10_BackupCompatibility.dom0_dirs
TC_10_BackupCompatibility.dom0_files
TC_10_BackupCompatibility.fullpath()
TC_10_BackupCompatibility.handle_v3_file()
TC_10_BackupCompatibility.handle_v4_file()
TC_10_BackupCompatibility.mock_appmenus()
TC_10_BackupCompatibility.scrypt_encrypt()
TC_10_BackupCompatibility.setup_expected_calls()
TC_10_BackupCompatibility.storage_pool
TC_10_BackupCompatibility.test_210_r2()
TC_10_BackupCompatibility.test_220_r2_encrypted()
TC_10_BackupCompatibility.test_230_r2_uncompressed()
TC_10_BackupCompatibility.test_230_r4()
TC_10_BackupCompatibility.test_230_r4_compressed()
TC_10_BackupCompatibility.test_230_r4_custom_compression()
TC_10_BackupCompatibility.test_230_r4_optional_compression()
TC_10_BackupCompatibility.test_230_r4_uncommon_compression()
TC_10_BackupCompatibility.test_230_r4_uncommon_compression_forced()
TC_10_BackupCompatibility.test_300_r4_no_space()
TC_11_BackupCompatibilityIntoLVM
- Module contents
BackupTestCase
BackupTestCase.BackupErrorHandler
BackupTestCase.assertCorrectlyRestored()
BackupTestCase.create_backup_vms()
BackupTestCase.create_full_image()
BackupTestCase.create_sparse()
BackupTestCase.fill_image()
BackupTestCase.make_vm_name()
BackupTestCase.restore_backup()
BackupTestCase.setUp()
BackupTestCase.tearDown()
BackupTestCase.vm_checksum()
- qubesadmin.tests.tools package
- Submodules
- qubesadmin.tests.tools.init module
TC_00_PropertyAction
TC_01_SinglePropertyAction
TC_01_SinglePropertyAction.test_000_help()
TC_01_SinglePropertyAction.test_001_help_const()
TC_01_SinglePropertyAction.test_100_default()
TC_01_SinglePropertyAction.test_101_set_prop()
TC_01_SinglePropertyAction.test_102_set_prop_dest()
TC_01_SinglePropertyAction.test_103_set_prop_const()
TC_01_SinglePropertyAction.test_104_set_prop_positional()
- qubesadmin.tests.tools.qubes_prefs module
- qubesadmin.tests.tools.qvm_backup module
- qubesadmin.tests.tools.qvm_backup_restore module
- qubesadmin.tests.tools.qvm_check module
- qubesadmin.tests.tools.qvm_clone module
- qubesadmin.tests.tools.qvm_create module
- qubesadmin.tests.tools.qvm_device module
TC_00_qvm_device
TC_00_qvm_device.expected_device_call()
TC_00_qvm_device.setUp()
TC_00_qvm_device.test_000_list_all()
TC_00_qvm_device.test_001_list_assigned_required()
TC_00_qvm_device.test_002_list_attach()
TC_00_qvm_device.test_003_list_device_classes()
TC_00_qvm_device.test_004_list_pci_with_sbdf()
TC_00_qvm_device.test_010_attach()
TC_00_qvm_device.test_011_attach_options()
TC_00_qvm_device.test_012_attach_invalid()
TC_00_qvm_device.test_013_attach_invalid_device()
TC_00_qvm_device.test_014_attach_invalid_backend()
TC_00_qvm_device.test_020_detach()
TC_00_qvm_device.test_021_detach_unknown()
TC_00_qvm_device.test_022_detach_all()
TC_00_qvm_device.test_030_assign()
TC_00_qvm_device.test_031_assign_required()
TC_00_qvm_device.test_032_assign_ask_and_options()
TC_00_qvm_device.test_033_assign_invalid()
TC_00_qvm_device.test_034_assign_invalid_device()
TC_00_qvm_device.test_035_assign_invalid_backend()
TC_00_qvm_device.test_036_assign_port()
TC_00_qvm_device.test_037_assign_port_asterisk()
TC_00_qvm_device.test_038_assign_device_from_port()
TC_00_qvm_device.test_039_assign_explicit_device()
TC_00_qvm_device.test_040_assign_explicit_device_device_id()
TC_00_qvm_device.test_041_assign_denied_device()
TC_00_qvm_device.test_050_unassign()
TC_00_qvm_device.test_051_unassign_unknown()
TC_00_qvm_device.test_052_unassign_port()
TC_00_qvm_device.test_053_unassign_device_from_port()
TC_00_qvm_device.test_054_unassign_explicit_device()
TC_00_qvm_device.test_055_unassign_explicit_device_port()
TC_00_qvm_device.test_056_unassign_explicit_device_id()
TC_00_qvm_device.test_057_unassign_all()
TC_00_qvm_device.test_060_device_info()
- qubesadmin.tests.tools.qvm_features module
- qubesadmin.tests.tools.qvm_firewall module
- qubesadmin.tests.tools.qvm_kill module
- qubesadmin.tests.tools.qvm_ls module
TC_00_Column
TC_100_Sort
TC_10_globals
TC_110_Filtering
TC_110_Filtering.test_111_filter_class()
TC_110_Filtering.test_112_filter_label()
TC_110_Filtering.test_113_filter_template_source()
TC_110_Filtering.test_114_filter_netvm_is()
TC_110_Filtering.test_115_internal_servicevm_pending_updates()
TC_110_Filtering.test_116_features()
TC_110_Filtering.test_117_preferences()
TC_50_List
TC_70_Tags
TC_80_Power_state_filters
TC_90_List_with_qubesd_calls
TestApp
- qubesadmin.tests.tools.qvm_pause module
- qubesadmin.tests.tools.qvm_pool module
TC_00_qvm_pool
TC_00_qvm_pool.test_000_list()
TC_00_qvm_pool.test_010_drivers()
TC_00_qvm_pool.test_020_add()
TC_00_qvm_pool.test_021_add_multiple()
TC_00_qvm_pool.test_030_remove()
TC_00_qvm_pool.test_031_remove_multiple()
TC_00_qvm_pool.test_040_info()
TC_00_qvm_pool.test_050_set()
TC_00_qvm_pool.test_051_set_invalid()
- qubesadmin.tests.tools.qvm_prefs module
TC_00_qvm_prefs
TC_00_qvm_prefs.test_000_list()
TC_00_qvm_prefs.test_001_no_vm()
TC_00_qvm_prefs.test_002_set_property()
TC_00_qvm_prefs.test_003_invalid_property()
TC_00_qvm_prefs.test_004_set_invalid_property()
TC_00_qvm_prefs.test_005_get_str()
TC_00_qvm_prefs.test_006_get_vm()
TC_00_qvm_prefs.test_007_get_vm_none()
TC_00_qvm_prefs.test_008_set_vm_prop_none()
TC_00_qvm_prefs.test_009_hide_default()
- qubesadmin.tests.tools.qvm_remove module
- qubesadmin.tests.tools.qvm_run module
- qubesadmin.tests.tools.qvm_service module
- qubesadmin.tests.tools.qvm_shutdown module
- qubesadmin.tests.tools.qvm_start module
- qubesadmin.tests.tools.qvm_start_daemon module
- qubesadmin.tests.tools.qvm_tags module
- qubesadmin.tests.tools.qvm_template_postprocess module
- qubesadmin.tests.tools.qvm_unpause module
- qubesadmin.tests.tools.qvm_volume module
TC_00_qvm_volume
TC_00_qvm_volume.setup_expected_calls_for_list()
TC_00_qvm_volume.test_000_list()
TC_00_qvm_volume.test_001_list_domain()
TC_00_qvm_volume.test_002_list_domain_pool()
TC_00_qvm_volume.test_003_list_pool()
TC_00_qvm_volume.test_004_list_multiple_domains()
TC_00_qvm_volume.test_005_list_default_action()
TC_00_qvm_volume.test_010_extend()
TC_00_qvm_volume.test_011_extend_error()
TC_00_qvm_volume.test_012_extend_deny_shrink()
TC_00_qvm_volume.test_013_resize_force_shrink()
TC_00_qvm_volume.test_020_revert()
TC_00_qvm_volume.test_021_revert_error()
TC_00_qvm_volume.test_022_revert_no_snapshots()
TC_00_qvm_volume.test_023_revert_specific()
TC_00_qvm_volume.test_030_set_revisions_to_keep()
TC_00_qvm_volume.test_031_set_rw()
TC_00_qvm_volume.test_032_set_invalid()
TC_00_qvm_volume.test_033_set_ephemeral()
TC_00_qvm_volume.test_040_info()
TC_00_qvm_volume.test_041_info_no_revisions()
TC_00_qvm_volume.test_042_info_single_prop()
TC_00_qvm_volume.test_043_info_revisions_only()
TC_00_qvm_volume.test_044_info_no_ephemeral()
TC_00_qvm_volume.test_050_import_file()
TC_00_qvm_volume.test_051_import_stdin()
TC_00_qvm_volume.test_052_import_file_size()
TC_00_qvm_volume.test_053_import_file_matching_size()
TC_00_qvm_volume.test_053_import_file_noresize()
- Module contents
- qubesadmin.tests.vm package
- Submodules
- qubesadmin.tests.vm.actions module
TC_00_Actions
TC_00_Actions.test_000_start()
TC_00_Actions.test_001_shutdown()
TC_00_Actions.test_002_kill()
TC_00_Actions.test_003_pause()
TC_00_Actions.test_004_unpause()
TC_00_Actions.test_005_suspend()
TC_00_Actions.test_006_resume()
TC_00_Actions.test_010_run_linux()
TC_00_Actions.test_011_run_windows()
TC_00_Actions.test_015_run_with_args_shell()
TC_00_Actions.test_016_run_with_args_exec()
- qubesadmin.tests.vm.dispvm module
- qubesadmin.tests.vm.properties module
TC_00_Properties
TC_00_Properties.test_000_list()
TC_00_Properties.test_001_get_str()
TC_00_Properties.test_002_get_int()
TC_00_Properties.test_003_get_bool()
TC_00_Properties.test_004_get_vm()
TC_00_Properties.test_005_get_none_vm()
TC_00_Properties.test_006_get_none_bool()
TC_00_Properties.test_007_get_none_int()
TC_00_Properties.test_008_get_none_str()
TC_00_Properties.test_010_get_default()
TC_00_Properties.test_011_get_default()
TC_00_Properties.test_012_get_invalid()
TC_00_Properties.test_020_set_str()
TC_00_Properties.test_021_set_int()
TC_00_Properties.test_022_set_bool()
TC_00_Properties.test_023_set_vm()
TC_00_Properties.test_024_set_none()
TC_00_Properties.test_030_reset()
TC_00_Properties.test_031_reset()
TC_00_Properties.test_040_get_default()
TC_00_Properties.test_041_get_default_int()
TC_00_Properties.test_042_get_default_none()
TC_00_Properties.test_050_get_all()
TC_00_Properties.test_051_get_all_fallback()
TC_01_SpecialCases
TC_01_SpecialCases.test_000_get_name()
TC_01_SpecialCases.test_001_set_name()
TC_01_SpecialCases.test_010_power_state_running()
TC_01_SpecialCases.test_011_power_state_paused()
TC_01_SpecialCases.test_012_power_state_halted()
TC_01_SpecialCases.test_012_power_state_transient()
TC_01_SpecialCases.test_013_power_state_suspended()
TC_01_SpecialCases.test_015_mem()
- qubesadmin.tests.vm.storage module
- Module contents
Submodules¶
qubesadmin.tests.app module¶
- class qubesadmin.tests.app.TC_00_VMCollection(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.app.TC_10_QubesBase(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.app.TC_20_QubesLocal(methodName='runTest')[source]¶
Bases:
TestCase
qubesadmin.tests.devices module¶
- class qubesadmin.tests.devices.TC_00_DeviceCollection(methodName='runTest')[source]¶
Bases:
QubesTestCase
qubesadmin.tests.errors module¶
qubesadmin.tests.events module¶
- class qubesadmin.tests.events.TC_00_Events(methodName='runTest')[source]¶
Bases:
QubesTestCase
qubesadmin.tests.features module¶
- class qubesadmin.tests.features.TC_00_Features(methodName='runTest')[source]¶
Bases:
QubesTestCase
qubesadmin.tests.firewall module¶
Tests for firewall API. This is mostly copy from core-admin
- class qubesadmin.tests.firewall.TC_00_RuleChoice(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.firewall.TC_01_Action(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.firewall.TC_02_DstHost(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.firewall.TC_02_Proto(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.firewall.TC_03_DstPorts(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.firewall.TC_04_IcmpType(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.firewall.TC_05_SpecialTarget(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.firewall.TC_06_Expire(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.firewall.TC_07_Comment(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.firewall.TC_10_Rule(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.firewall.TC_11_Firewall(methodName='runTest')[source]¶
Bases:
QubesTestCase
qubesadmin.tests.label module¶
- class qubesadmin.tests.label.TC_00_Label(methodName='runTest')[source]¶
Bases:
QubesTestCase
qubesadmin.tests.storage module¶
- class qubesadmin.tests.storage.TestPool(methodName='runTest')[source]¶
Bases:
QubesTestCase
- class qubesadmin.tests.storage.TestPoolVolume(methodName='runTest')[source]¶
Bases:
TestVMVolume
- class qubesadmin.tests.storage.TestVMVolume(methodName='runTest')[source]¶
Bases:
QubesTestCase
Module contents¶
- class qubesadmin.tests.QubesTest[source]¶
Bases:
QubesBase
- actual_calls = None¶
actual calls made
- expected_calls = None¶
expected Admin API calls and saved replies for them
- expected_service_calls = None¶
expected qrexec service calls and saved replies for them
- qubesd_call(dest, method, arg=None, payload=None, payload_stream=None)[source]¶
Execute Admin API method.
If payload and payload_stream are both specified, they will be sent in that order.
- Parameters:
dest – Destination VM name
method – Full API method name (‘admin…’)
arg – Method argument (if any)
payload – Payload send to the method
payload_stream – file-like object to read payload from
- Returns:
Data returned by qubesd (string)
Warning
payload_stream will get closed by this function
- run_service(dest, service, **kwargs)[source]¶
Run qrexec service in a given destination
kwargs are passed verbatim to
subprocess.Popen()
.- Parameters:
dest (str) – Destination - may be a VM name or empty string for default (for a given service)
service (str) – service name
filter_esc (bool) – filter escape sequences to protect terminal emulator
user (str) – username to run service as
localcmd (str) – Command to connect stdin/stdout to
wait (bool) – Wait service run
autostart (bool) – Automatically start the target VM
- Return type:
subprocess.Popen
- service_calls = None¶
rpc service calls
- class qubesadmin.tests.QubesTestCase(methodName='runTest')[source]¶
Bases:
TestCase
- assertNotRaises(excClass, *args, callableObj=None, **kwargs)[source]¶
Fail if an exception of class excClass is raised by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is raised, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
If called with callableObj omitted or None, will return a context object used like this:
with self.assertRaises(SomeException): do_something()
The context manager keeps a reference to the exception as the ‘exception’ attribute. This allows you to inspect the exception after the assertion:
with self.assertRaises(SomeException) as cm: do_something() the_exception = cm.exception self.assertEqual(the_exception.error_code, 3)
- class qubesadmin.tests.TestProcess(input_callback=None, stdout=None, stderr=None, stdout_data=None)[source]¶
Bases:
object