qubesadmin.tests.tools package

Submodules

qubesadmin.tests.tools.init module

class qubesadmin.tests.tools.init.TC_00_PropertyAction(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_default()[source]
test_001_set_prop()[source]
test_002_set_prop_2()[source]
test_003_set_prop_override_default()[source]
test_003_set_prop_with_default()[source]
class qubesadmin.tests.tools.init.TC_01_SinglePropertyAction(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_help()[source]
test_001_help_const()[source]
test_100_default()[source]
test_101_set_prop()[source]
test_102_set_prop_dest()[source]
test_103_set_prop_const()[source]
test_104_set_prop_positional()[source]

qubesadmin.tests.tools.qubes_prefs module

class qubesadmin.tests.tools.qubes_prefs.TC_00_qubes_prefs(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_list()[source]
test_002_set_property()[source]
test_003_invalid_property()[source]
test_004_set_invalid_property()[source]

qubesadmin.tests.tools.qvm_backup module

class qubesadmin.tests.tools.qvm_backup.TC_00_qvm_backup(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_write_backup_profile()[source]
test_001_write_backup_profile_include()[source]
test_002_write_backup_profile_exclude()[source]
test_003_write_backup_with_passphrase()[source]
test_010_main_save_profile_cancel(mock_getpass, mock_input)[source]
test_011_main_save_profile_confirm(mock_getpass, mock_input)[source]
test_012_main_existing_profile(mock_getpass, mock_input)[source]
test_013_main_new_profile_vm(mock_getpass, mock_input)[source]
test_014_main_passphrase_file(mock_getpass, mock_input)[source]

qubesadmin.tests.tools.qvm_backup_restore module

class qubesadmin.tests.tools.qvm_backup_restore.TC_00_qvm_backup_restore(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

assertAppropriateLogging(missing_name, action)[source]
Parameters:
  • missing_name – NetVM or TemplateVM
  • action – ‘skip_broken’, ‘ignore_missing’
Returns:

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.

test_000_simple(mock_backup, mock_getpass, mock_input)[source]
test_001_selected_vms(mock_backup, mock_getpass, mock_input)[source]
test_010_handle_broken_no_problems()[source]
test_011_handle_broken_missing_template()[source]
test_012_handle_broken_missing_netvm()[source]

qubesadmin.tests.tools.qvm_check module

class qubesadmin.tests.tools.qvm_check.TC_00_qvm_check(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_exists()[source]
test_001_exists_multi()[source]
test_002_exists_verbose()[source]
test_003_exists_multi_verbose()[source]
test_004_running_verbose()[source]
test_005_running_multi_verbose()[source]
test_006_running_multi_verbose2()[source]
test_007_not_running_verbose()[source]
test_008_paused()[source]
test_009_paused_multi()[source]
test_010_template()[source]
test_011_template_multi()[source]

qubesadmin.tests.tools.qvm_clone module

class qubesadmin.tests.tools.qvm_clone.TC_00_qvm_clone(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_simple()[source]
test_001_missing_vm()[source]
test_004_pool()[source]
test_005_pools()[source]
test_006_new_cls()[source]

qubesadmin.tests.tools.qvm_create module

class qubesadmin.tests.tools.qvm_create.TC_00_qvm_create(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_just_appvm()[source]
test_001_missing_vm()[source]
test_002_custom_template()[source]
test_003_properties()[source]
test_004_pool()[source]
test_005_pools()[source]
test_005_root_copy_from()[source]
test_006_root_move_from()[source]
test_007_root_move_copy_both()[source]
test_008_root_invalid_path()[source]
test_009_help_classes()[source]
test_010_root_copy_from_with_resize()[source]
test_011_standalonevm(check_output_mock)[source]
test_012_invalid_label()[source]
test_013_root_copy_from_template_based()[source]
test_014_standalone_shortcut()[source]
test_015_disp_shortcut()[source]

qubesadmin.tests.tools.qvm_device module

Tests for the qvm-device tool.

class qubesadmin.tests.tools.qvm_device.TC_00_qvm_device(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

Tests the output logic of the qvm-device tool

setUp()[source]

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

test_000_list_all()[source]

List all exposed vm devices. No devices are attached to other domains.

test_001_list_persistent_attach()[source]

Attach the device exposed by the vm1 to the vm3 persistently.

test_002_list_list_temp_attach()[source]

Attach the device exposed by the vm1 to the vm3 non-persistently.

test_010_attach()[source]

Test attach action

test_011_attach_options()[source]

Test attach action

test_011_attach_persistent()[source]

Test attach action

test_012_attach_invalid()[source]

Test attach action

test_013_attach_invalid2()[source]

Test attach action

test_014_attach_invalid3()[source]

Test attach action

test_020_detach()[source]

Test detach action

test_021_detach_unknown()[source]

Test detach action

test_022_detach_all()[source]

Test detach action

qubesadmin.tests.tools.qvm_features module

class qubesadmin.tests.tools.qvm_features.TC_00_qvm_features(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_list()[source]
test_001_set()[source]
test_002_get()[source]
test_003_del()[source]

qubesadmin.tests.tools.qvm_firewall module

class qubesadmin.tests.tools.qvm_firewall.TC_00_RuleAction(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

setUp()[source]

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

test_000_named_opts()[source]
test_001_unnamed_opts()[source]
test_002_unnamed_opts()[source]
test_003_mixed_opts()[source]
test_004_expire_absolute()[source]
test_005_expire_relative()[source]
test_006_dsthost_aliases()[source]
class qubesadmin.tests.tools.qvm_firewall.TC_10_qvm_firewall(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

setUp()[source]

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

test_000_list()[source]
test_001_list_default()[source]
test_002_list_expire()[source]
test_002_list_raw()[source]
test_003_list_raw_reload()[source]
test_010_add_after()[source]
test_011_add_before()[source]
test_020_del_number()[source]
test_021_del_rule()[source]

qubesadmin.tests.tools.qvm_kill module

class qubesadmin.tests.tools.qvm_kill.TC_00_qvm_kill(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_with_vm()[source]
test_001_missing_vm()[source]
test_002_invalid_vm()[source]
test_003_not_running()[source]

qubesadmin.tests.tools.qvm_ls module

class qubesadmin.tests.tools.qvm_ls.TC_00_Column(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_100_init()[source]
class qubesadmin.tests.tools.qvm_ls.TC_10_globals(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_100_simple_flag()[source]
test_900_formats_columns()[source]
class qubesadmin.tests.tools.qvm_ls.TC_50_List(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_100_list_with_status()[source]
test_101_list_with_underscore()[source]
test_102_list_selected()[source]
test_102_raw_list()[source]
class qubesadmin.tests.tools.qvm_ls.TC_70_Tags(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

setUp()[source]

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

test_100_tag()[source]
test_100_tag_nomatch()[source]
test_100_tags()[source]
test_100_tags_nomatch()[source]
class qubesadmin.tests.tools.qvm_ls.TC_80_Power_state_filters(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

setUp()[source]

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

test_100_nofilter()[source]
test_100_running()[source]
test_100_running_or_halted()[source]
class qubesadmin.tests.tools.qvm_ls.TC_90_List_with_qubesd_calls(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_100_list_with_status()[source]
test_101_list_selected()[source]
class qubesadmin.tests.tools.qvm_ls.TestApp[source]

Bases: object

qubesadmin.tests.tools.qvm_pause module

class qubesadmin.tests.tools.qvm_pause.TC_00_qvm_pause(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_with_vm()[source]
test_001_missing_vm()[source]
test_002_invalid_vm()[source]
test_003_not_running()[source]
test_004_multiple_vms()[source]

qubesadmin.tests.tools.qvm_pool module

class qubesadmin.tests.tools.qvm_pool.TC_00_qvm_pool(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_list()[source]
test_010_list_drivers()[source]
test_020_add()[source]
test_030_remove()[source]
test_040_info()[source]
test_050_set()[source]
test_051_set_invalid()[source]

qubesadmin.tests.tools.qvm_prefs module

class qubesadmin.tests.tools.qvm_prefs.TC_00_qvm_prefs(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_list()[source]
test_001_no_vm()[source]
test_002_set_property()[source]
test_003_invalid_property()[source]
test_004_set_invalid_property()[source]
test_005_get_str()[source]
test_006_get_vm()[source]
test_007_get_vm_none()[source]
test_008_set_vm_prop_none()[source]

qubesadmin.tests.tools.qvm_remove module

class qubesadmin.tests.tools.qvm_remove.TC_00_qvm_remove(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_single()[source]
test_100_dependencies(mock_dependencies)[source]

qubesadmin.tests.tools.qvm_run module

class qubesadmin.tests.tools.qvm_run.TC_00_qvm_run(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

default_filter_esc()[source]
setUp()[source]

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

test_000_run_single()[source]
test_001_run_multiple()[source]
test_002_color_output()[source]
test_002_passio()[source]
test_002_passio_service()[source]
test_003_no_color_output()[source]
test_004_no_filter_esc()[source]
test_005_localcmd(mock_popen)[source]
test_006_run_single_with_gui()[source]
test_007_run_service_with_gui()[source]
test_008_dispvm_remote()[source]
test_009_dispvm_remote_specific()[source]
test_010_dispvm_local()[source]
test_011_dispvm_local_specific()[source]
test_012_exclude()[source]
test_013_no_autostart()[source]
test_014_dispvm_local_gui()[source]
test_015_dispvm_local_no_gui()[source]
test_016_run_single_windows()[source]

qubesadmin.tests.tools.qvm_service module

class qubesadmin.tests.tools.qvm_service.TC_00_qvm_service(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_list()[source]
test_001_list_l()[source]
test_002_enable()[source]
test_003_enable_opt()[source]
test_004_enable_opt_mixed()[source]
test_005_disable()[source]
test_006_disable_opt()[source]
test_007_get()[source]
test_008_del()[source]
test_009_del_legacy()[source]
test_010_set_invalid()[source]

qubesadmin.tests.tools.qvm_shutdown module

class qubesadmin.tests.tools.qvm_shutdown.TC_00_qvm_shutdown(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_with_vm()[source]
test_001_missing_vm()[source]
test_002_invalid_vm()[source]
test_003_not_running()[source]
test_004_multiple_vms()[source]
test_010_wait()[source]

test –wait option

test_012_wait_all()[source]

test –wait option, with multiple VMs

test_013_wait_all_order()[source]

test –wait option, with some VMs requiring specific shutdown order

test_014_wait_all_order_no_events()[source]

test –wait option, with some VMs requiring specific shutdown order

test_015_wait_all_kill_timeout()[source]

test –wait option, with multiple VMs and killing on timeout

qubesadmin.tests.tools.qvm_start module

class qubesadmin.tests.tools.qvm_start.TC_00_qvm_start(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_with_vm()[source]
test_001_missing_vm()[source]
test_002_invalid_vm()[source]
test_003_already_running()[source]
test_010_drive_cdrom()[source]
test_011_drive_disk()[source]
test_012_drive_disk()[source]
test_013_drive_loop_local(mock_subprocess)[source]
test_014_drive_loop_remote()[source]
test_015_drive_failed_start()[source]
test_016_drive_failed_attach()[source]

qubesadmin.tests.tools.qvm_start_gui module

class qubesadmin.tests.tools.qvm_start_gui.TC_00_qvm_start_gui(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

mock_coroutine(mock, *args, **kwargs)[source]
setUp()[source]

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

test_000_kde_args(proc_mock)[source]
test_001_kde_args_none(proc_mock)[source]
test_010_common_args()[source]
test_011_common_args_debug()[source]
test_012_common_args_rpc_clipboard()[source]
test_020_start_gui_for_vm(proc_mock)[source]
test_021_start_gui_for_vm_hvm(proc_mock)[source]
test_022_start_gui_for_vm_hvm_stubdom()[source]
test_030_start_gui_for_stubdomain()[source]
test_031_start_gui_for_stubdomain_forced()[source]
test_040_start_gui()[source]
test_041_start_gui_running()[source]
test_042_start_gui_pvh()[source]
test_050_get_monitor_layout1(proc_mock)[source]
test_051_get_monitor_layout_multiple(proc_mock)[source]
test_052_get_monitor_layout_hidpi1(proc_mock)[source]
test_052_get_monitor_layout_hidpi2(proc_mock)[source]
test_052_get_monitor_layout_hidpi3(proc_mock)[source]
test_060_send_monitor_layout()[source]
test_061_send_monitor_layout_exclude()[source]
test_062_send_monitor_layout_not_running()[source]
test_063_send_monitor_layout_signal_existing()[source]
test_070_send_monitor_layout_all()[source]

qubesadmin.tests.tools.qvm_tags module

class qubesadmin.tests.tools.qvm_tags.TC_00_qvm_tags(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_list()[source]
test_001_list_action()[source]
test_002_list_alias()[source]
test_003_list_check()[source]
test_004_list_check_missing()[source]
test_005_list_empty()[source]
test_010_add()[source]
test_020_del()[source]

qubesadmin.tests.tools.qvm_template_postprocess module

class qubesadmin.tests.tools.qvm_template_postprocess.QubesLocalMock[source]

Bases: qubesadmin.tests.QubesTest

qubesd_call(dest, method, arg=None, payload=None, payload_stream=None)

Execute Admin API method.

Only one of payload and payload_stream can be specified.

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)

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
Return type:

subprocess.Popen

class qubesadmin.tests.tools.qvm_template_postprocess.TC_00_qvm_template_postprocess(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

add_new_vm_side_effect(*args, **kwargs)[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.

test_000_import_root_img_raw()[source]
test_001_import_root_img_tar()[source]
test_002_import_root_img_no_overwrite()[source]
test_010_import_appmenus()[source]
test_011_import_appmenus_as_root(mock_getuid, mock_getgrnam)[source]
test_012_import_appmenus_missing_user(mock_getuid, mock_getgrnam)[source]
test_020_post_install(mock_import_root_img, mock_import_appmenus)[source]
test_021_post_install_reinstall(mock_import_root_img, mock_import_appmenus)[source]
test_022_post_install_skip_start(mock_import_root_img, mock_import_appmenus)[source]
test_030_pre_remove()[source]
test_031_pre_remove_existing_appvm()[source]
test_040_missing_really()[source]
wait_for_shutdown(vm)[source]

qubesadmin.tests.tools.qvm_unpause module

class qubesadmin.tests.tools.qvm_unpause.TC_00_qvm_unpause(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

test_000_with_vm()[source]
test_001_missing_vm()[source]
test_002_invalid_vm()[source]
test_003_not_running()[source]
test_004_multiple_vms()[source]

qubesadmin.tests.tools.qvm_volume module

class qubesadmin.tests.tools.qvm_volume.TC_00_qvm_volume(methodName='runTest')[source]

Bases: qubesadmin.tests.QubesTestCase

setup_expected_calls_for_list(vms=('vm1', 'sys-net'))[source]
test_000_list()[source]
test_001_list_domain()[source]
test_002_list_domain_pool()[source]
test_003_list_pool()[source]
test_004_list_multiple_domains()[source]
test_005_list_default_action()[source]
test_010_extend()[source]
test_011_extend_error()[source]
test_012_extend_deny_shrink()[source]
test_013_resize_force_shrink()[source]
test_020_revert()[source]
test_021_revert_error()[source]
test_022_revert_no_snapshots()[source]
test_023_revert_specific()[source]
test_030_set_revisions_to_keep()[source]
test_031_set_rw()[source]
test_032_set_invalid()[source]
test_040_info()[source]
test_041_info_no_revisions()[source]
test_042_info_single_prop()[source]
test_043_info_revisions_only()[source]

Module contents

class qubesadmin.tests.tools.MockEventsReader(events, delay=0.05)[source]

Bases: object

at_eof()[source]
readuntil(delim)[source]
class qubesadmin.tests.tools.StderrBuffer[source]

Bases: object

class qubesadmin.tests.tools.StdoutBuffer[source]

Bases: object