Commit Graph

226 Commits

Author SHA1 Message Date
Marek Marczykowski-Górecki
422f30b969 tests: port network tests to core3 API 2016-03-21 11:43:32 +01:00
Marek Marczykowski-Górecki
63f0966cdd
tests: fix MimeHandlers after "29c602c tests: prefix internal functions with underscore" 2016-03-13 03:37:04 +01:00
Marek Marczykowski-Górecki
b24ba307c3
tests: move warning to the module level 2016-03-13 03:36:20 +01:00
Marek Marczykowski-Górecki
bc240bd742
tests: move external test loader to qubes.tests.extra module
This way, tests will appear as from 'extra' module.

Besides the move, some minor changes:
 - add missing self.qc.unlock_db() in create_vms()
 - suffix per-template tests with template name

QubesOS/qubes-issues#1800
2016-03-03 23:47:52 +01:00
Marek Marczykowski-Górecki
02c601b830
tests: expose API for external tests
Fixes QubesOS/qubes-issues#1800
2016-03-03 23:47:52 +01:00
Marek Marczykowski-Górecki
3f66da0412
tests: add a function for adding qrexec rules
QubesOS/qubes-issues#1800
2016-03-03 23:47:51 +01:00
Marek Marczykowski-Górecki
29c602c9ff
tests: prefix internal functions with underscore
Preparation for API for external tests.

QubesOS/qubes-issues#1800
2016-03-03 23:47:51 +01:00
Marek Marczykowski-Górecki
7ca89688bd
Improve expectedFailureIfTemplate decorator 2016-03-03 23:47:51 +01:00
Marek Marczykowski-Górecki
8497471a72
tests: fix preparation of "small" backup storage in Debian 7
losetup Debian 7 doesn't deal with /dev/loop-control, so needs
existing /dev/loop* devices. Just /dev/loop0 is enough.
2016-03-03 23:47:51 +01:00
Marek Marczykowski-Górecki
5c877e9850
tests: mark NetworkManager in ProxyVM fail for debian-7
NM there expect some different options in configuration, and since it's
old stable, we won't implement it.
2016-03-03 23:47:50 +01:00
Marek Marczykowski-Górecki
4420b320e7
tests: add expectedFailureIfTemplate decorator
Some tests are expected to fail only on some templates (some feature not
available in older distribution, some feature not yet ported to
another).
2016-03-03 23:47:50 +01:00
Marek Marczykowski-Górecki
c0c0e0022e tests: convert storage tests to core3 API
QubesOS/qubes-issues#
2016-03-03 01:18:17 +01:00
Marek Marczykowski-Górecki
fb74126e56 tests: convert dom0 update test to core3 API 2016-03-03 01:18:17 +01:00
Marek Marczykowski-Górecki
2daba9e0eb core: migrate handy GUI functions and backup mixin from core2
That's all from tests/__init__.py, so remove that file.
2016-03-03 01:18:16 +01:00
Wojtek Porczyk
9eafa57539 Merge remote-tracking branch 'marmarek/master' into core3-devel
The following list is bollocks. There were many, many more.

Conflicts:
    core-modules/003QubesTemplateVm.py
    core-modules/005QubesNetVm.py
    core/qubes.py
    core/storage/__init__.py
    core/storage/xen.py
    doc/qvm-tools/qvm-pci.rst
    doc/qvm-tools/qvm-prefs.rst
    qubes/tools/qmemmand.py
    qvm-tools/qvm-create
    qvm-tools/qvm-prefs
    qvm-tools/qvm-start
    tests/__init__.py
    vm-config/xen-vm-template-hvm.xml

This commit took 2 days (26-27.01.2016) and put our friendship to test.
    --Wojtek and Marek
2016-03-03 01:13:51 +01:00
Marek Marczykowski-Górecki
3bef37f881
tests: PCI passthrough to HVM
A simple test which checks if the device is visible there at all.
Device set with QUBES_TEST_PCIDEV env variable is used - it should be
some unimportant device which can be freely detached from dom0.

QubesOS/qubes-issues#1659
2016-02-26 11:04:52 +01:00
Marek Marczykowski-Górecki
26443e1dd2
tests: add function to create minimal OS in HVM
SystemTestsMixin.prepare_hvm_system_linux creates minimal Linux
installation necessary to launch simple shell script. It installs:
 - grub2
 - kernel from dom0 (the same as the running one)
 - dracut based initramfs, with provided script set as pre-pivot hook

Done in preparation for QubesOS/qubes-issues#1659 test
2016-02-26 10:59:20 +01:00
Marek Marczykowski-Górecki
0fb69d39ca
tests: qvm-sync-clock is asynchronouse, take it into account 2016-02-23 16:20:18 +01:00
Marek Marczykowski-Górecki
be231421de
tests: try to change name to conflicting value
QubesOS/qubes-issues#1723
2016-02-07 02:17:59 +01:00
Marek Marczykowski-Górecki
f13abc2ace
tests: rename domain when it is't defined libvirt
Regression test for QubesOS/qubes-issues#1632
2016-02-06 05:36:53 +01:00
Marek Marczykowski-Górecki
0d31306b90
tests: clearing 'updates pending' flag
QubesOS/qubes-issues#1685
2016-02-03 17:22:15 +01:00
Marek Marczykowski-Górecki
0d2e03389f
tests: qvm-open-in-vm and qvm-open-in-dvm tests for different file types
QubesOS/qubes-issues#1621
2016-01-29 21:31:49 +01:00
Marek Marczykowski-Górecki
be00d15d99
tests: do not crash when trying to log class setup/teardown fail
QubesOS/qubes-issues#1691
2016-01-29 21:30:11 +01:00
Marek Marczykowski-Górecki
84af7386f5
tests: support VMs cleaned up in tearDownClass, instead of tearDown
Usage: VMs with name created by self.make_vm_name(name,
class_teardown=True) will be cleaned up in tearDownClass. It should be
used only in setUpClass.

Fixes QubesOS/qubes-issues#1691
2016-01-26 03:34:27 +01:00
Marek Marczykowski-Górecki
176755d9e2
tests: DispVM cleanup
QubesOS/qubes-issues#1660
2016-01-20 02:48:46 +01:00
Marek Marczykowski-Górecki
ce75ba411f
tests: "empty" firewall propagation
Check if "empty" firewall is also properly propagated.

QubesOS/qubes-issues#1608
2016-01-18 02:09:17 +01:00
Marek Marczykowski-Górecki
caa75cbc18
tests: regression test for #1389
QubesOS/qubes-issues#1389
2016-01-14 04:28:17 +01:00
Marek Marczykowski-Górecki
f4d46c7855
tests: add a test for proper saving of DispVM firewall rules
Test if DispVM firewall rules are:
 - inherited from a calling VM
 - saved properly (so will be effective after firewall reload)
 - saved only for that DispVM (#1608)

QubesOS/qubes-issues#1608
2016-01-14 01:14:41 +01:00
Marek Marczykowski-Górecki
db136674a9
tests: workaround libvirt bug - domain ID desynchronization 2016-01-07 05:48:33 +01:00
Marek Marczykowski-Górecki
baffef0ef0
tests: fix qvm-move-to-vm error code checking
Currently error code is 28 (ENOSPC). But generally any non-zero is
expected result here.

Fix test for QubesOS/qubes-issues#1355
2016-01-07 05:48:33 +01:00
Marek Marczykowski-Górecki
24ad20cfe6
tests: add a simple dom0 backup test
Regression test for:
QubesOS/qubes-issues#1515

It assumes existing broken symlink in user dom0 home. Thanks for systemd
it is the case (`~/.local/share/systemd/user`).
2016-01-07 05:48:33 +01:00
Marek Marczykowski-Górecki
4af5a0503d
tests: qvm-revert-template-changes
Regression test for:
QubesOS/qubes-issues#1573
2016-01-07 05:48:32 +01:00
Marek Marczykowski-Górecki
f977858610
minor: add missing coding declaration 2016-01-07 05:48:32 +01:00
Bahtiar `kalkin-` Gadimov
fdd618b420
Move xen storage tests to own file
This allows to run just the general storage tests without all the slow xen
storage based tests.
2016-01-07 05:48:32 +01:00
Marek Marczykowski-Górecki
70546ac21a tests: add test for VM autostart on qrexec call 2015-12-28 01:07:48 +01:00
Marek Marczykowski-Górecki
1b5daea771
qvm-grow-root: add --allow-start option
In some (most) cases VM needs to be started to complete resize
operation. This may be unexpected, so make it clear and do not start the
VM when the user did not explicitly allow that.

Fixes QubesOS/qubes-issues#1268
2015-12-26 04:10:20 +01:00
Wojtek Porczyk
0dc0fd306f core3: test fixing
part of QubesOS/qubes-issues#1248
2015-12-23 14:34:53 +01:00
Marek Marczykowski-Górecki
3fafc5dc67
tests: fix race condition in network test
Wait for network configuration being applied before testing it.
2015-12-06 14:34:52 +01:00
Marek Marczykowski-Górecki
280cb8fdfb
tests: custom backup compression filter
QubesOS/qubes-issues#1459
2015-11-27 20:00:34 +01:00
Marek Marczykowski-Górecki
99272132a6
tests: test case for on the fly VM rename during backup restore
QubesOS/qubes-issues#869
2015-11-27 20:00:34 +01:00
Marek Marczykowski-Górecki
3065431058
tests: include NetVM in basic backup tests 2015-11-27 20:00:34 +01:00
Marek Marczykowski-Górecki
3e79ff6a37
tests: release qubes.xml lock while killing VMs
Otherwise hotplug scripts may deadlock on qvm-template-commit and
consequently do not release loop and device-mapper devices. Which means
also not releasing disk space for underlying images.

Fixes QubesOS/qubes-issues#1458
2015-11-27 20:00:34 +01:00
Marek Marczykowski-Górecki
aeec42dacf
tests: PV Grub: ensure that latest packages are installed
Flush yum case before that.
2015-11-25 03:16:24 +01:00
Marek Marczykowski-Górecki
64343572c1
tests: handle older df version in resize private.img tests
df --output=size isn't available in Debian (7, 8).
2015-11-25 03:15:23 +01:00
Marek Marczykowski-Górecki
a14e1cc86f
tests: move enter_keys_in_window to base SystemTestsMixin class
This ways it will be available also in DispVM tests (already referenced
there), and others.
2015-11-25 03:14:23 +01:00
Marek Marczykowski-Górecki
564ea5d64c
tests: check if qvm-move-to-vm properly fails in case of out of disk space
Regression test for QubesOS/qubes-issues#1355
2015-11-25 01:35:04 +01:00
Marek Marczykowski-Górecki
d7ab2d985d
tests: use wait_for_window/enter_keys_in_window wrappers when applicable
Reduce code duplication.
2015-11-25 01:35:04 +01:00
Marek Marczykowski-Górecki
db35e03aa7
tests: backup to VM tests
Regression tests for QubesOS/qubes-issues#1371 and
QubesOS/qubes-issues#1359

Fixes QubesOS/qubes-issues#1435
2015-11-25 01:35:04 +01:00
Marek Marczykowski-Górecki
736e278865
tests: fix wait_for_window function
The `show` parameter wasn't handled (show=False was assumed...)
2015-11-25 01:35:04 +01:00
Marek Marczykowski-Górecki
760786d999
tests: minor formating 2015-11-25 01:35:04 +01:00
Bahtiar `kalkin-` Gadimov
885dc5cd81 Rename storage dir to dir_path, type to driver
Bad idea to use attributes which are named after built in functions.
2015-11-21 14:46:23 +01:00
Bahtiar `kalkin-` Gadimov
989eab1d72 Add file image tests to tests/storage.py 2015-11-17 19:37:21 +01:00
Bahtiar `kalkin-` Gadimov
0ba0259d1a Extend documentation test/storage.py 2015-11-17 19:37:21 +01:00
Bahtiar `kalkin-` Gadimov
0bc0bc9045 XenStorage make sure subdirs exist in pool dir 2015-11-17 19:37:20 +01:00
Bahtiar `kalkin-` Gadimov
58f23ca392 Add configurable pool_dir to XenPool 2015-11-17 19:37:20 +01:00
Bahtiar `kalkin-` Gadimov
16d480cf4c Add storage add_pool & remove_pool 2015-11-17 19:37:19 +01:00
Bahtiar `kalkin-` Gadimov
26711e7e9a Use default pool_config if pool name is 'default' 2015-11-17 19:37:19 +01:00
Bahtiar `kalkin-` Gadimov
78891dd70f QubesVm save the name of the storage pool used 2015-11-17 19:37:19 +01:00
Bahtiar `kalkin-` Gadimov
d1685a13df Add storage.pool_exists 2015-11-17 19:37:19 +01:00
Bahtiar `kalkin-` Gadimov
8e0207a199 Rename QubesXenVmStorage to XenStorage 2015-11-17 19:37:19 +01:00
Bahtiar `kalkin-` Gadimov
bfaf37dae5 Add pool config parsing 2015-11-17 19:37:18 +01:00
Marek Marczykowski-Górecki
2ccfff438a
tests: use xterm instead of gnome-terminal in DispVM tests
There is no gnome-terminal in minimal template.
2015-11-15 02:53:48 +01:00
Marek Marczykowski-Górecki
74d9c62025
tests: improve qrexec confirmation handling
'xdotool search --sync' sometimes fails when searching for window. Fix
that by ensuring the windows is already visible when trying to enter
keys there.
2015-11-13 02:30:41 +01:00
Marek Marczykowski-Górecki
5acd27f61e
tests: increase allowed time delta for timezone tests
One more time, for slow systems... Let it be 30 seconds.
2015-11-11 04:30:00 +01:00
Marek Marczykowski-Górecki
cdc6d74c86
tests: PV Grub tests
QubesOS/qubes-issues#1354
2015-11-11 04:30:00 +01:00
Marek Marczykowski-Górecki
c595ac464b
tests: make sure that DispVM service call receive EOF
Even when the test fails. Otherwise the DispVM will stay alive.
2015-11-07 18:46:54 +01:00
Marek Marczykowski-Górecki
49141d444e
tests: resize private.img/root.img
QubesOS/qubes-issues#1268
2015-11-07 05:43:32 +01:00
Marek Marczykowski-Górecki
6051a89227
tests: add regression test for #1386
QubesOS/qubes-issues#1386
2015-11-07 05:03:54 +01:00
Marek Marczykowski-Górecki
a7b124d6da
tests: fix race condition in copy-paste test
Don't wait arbitrary time for paste to finish.
2015-11-03 02:47:08 +01:00
Marek Marczykowski-Górecki
c30c9c7d4e
tests: minor fixes to time sync tests
- don't crash when ClockVM wasn't set previously
- increase allowed delta (for slow systems)
2015-11-03 02:46:03 +01:00
Marek Marczykowski-Górecki
31ad72aa70
tests: better handle templates with no 'createrepo' installed 2015-11-03 02:44:25 +01:00
Marek Marczykowski-Górecki
44c340c046
tests: add wait_for_window function to reduce code duplication 2015-11-03 02:43:46 +01:00
Marek Marczykowski-Górecki
cf110c74e2
tests: fix cleanup in dom0 updates tests
The only directory to cleanup is cls.tmpdir. So make it simple, without
class property cleanup_paths, which for some reason didn't wasn't
emptied in tearDownClass.
2015-11-03 02:40:53 +01:00
Marek Marczykowski-Górecki
5160423065
tests: perform dom0 update check using VMs of different templates
QubesOS/qubes-issues#1282
QubesOS/qubes-issues#1029
2015-10-30 14:58:23 +01:00
Marek Marczykowski-Górecki
33255964c7
tests: handle Whonix in simple GUI tests
Whonix VMs have always hostname of 'host', so handle that when searching
for a window based on its title.
2015-10-30 14:09:52 +01:00
Marek Marczykowski-Górecki
f064a4c6ea
tests: improve qvm-run of GUI apps tests, include qubes-desktop-run 2015-10-27 23:16:37 +01:00
Marek Marczykowski-Górecki
9cb62f8f4d
tests: VM updates (direct and through updates proxy) 2015-10-27 23:16:10 +01:00
Marek Marczykowski-Górecki
e475e291a9
tests: more qrexec tests, this time for deadlocks
Tests for recently discovered deadlocks on write(2).

QubesOS/qubes-issues#1347
2015-10-25 15:23:12 +01:00
Wojtek Porczyk
dc3fcc3141 qubes/tests: port again the backported test runner
part of QubesOS/qubes-issues#1248
2015-10-17 00:20:44 +02:00
Marek Marczykowski-Górecki
9ea81c50ae
tests: add tests for 'qvm-prefs'
QubesOS/qubes-issues#1184
QubesOS/qubes-issues#1274
QubesOS/qubes-issues#1273
QubesOS/qubes-issues#1272
2015-10-05 05:52:21 +02:00
Marek Marczykowski-Górecki
d900b21dd8
tests: add test for #1256
QubesOS/qubes-issues#1256
2015-10-02 01:56:45 +02:00
Marek Marczykowski-Górecki
5043d17197
tests: fix misuse of self.assertNotRaises (#1163)
Fixes QubesOS/qubes-issues#1163
2015-09-30 22:34:12 +02:00
Marek Marczykowski-Górecki
c2cd84952e tests: backup compatibility with R2 (#1124)
QubesOS/qubes-issues#1124
2015-09-05 00:04:04 +02:00
Marek Marczykowski-Górecki
496a74f873 tests: add DispVM to backup compatibility test (r2b2)
Test for qubesos/qubes-issues#1124
2015-09-05 00:03:03 +02:00
Marek Marczykowski-Górecki
bbf22c4449
tests: add a test for aborted service call
Details here:
https://groups.google.com/d/msgid/qubes-users/20150807213935.GN3740%40mail-itl
2015-08-08 03:57:13 +02:00
Marek Marczykowski-Górecki
5199840927
tests: typo fix 2015-08-08 02:05:52 +02:00
Marek Marczykowski-Górecki
75bbd1a76b
tests: check firewall.xml path after VM rename 2015-08-05 01:04:44 +02:00
Marek Marczykowski-Górecki
a7e08e4584 tests: add qvm-clone test (#1032 case) 2015-07-08 04:26:11 +02:00
Marek Marczykowski-Górecki
50a9c62d0e tests: add test for qvm-sync-clock 2015-07-08 01:21:13 +02:00
Marek Marczykowski-Górecki
455535d036 tests: reload qubes.xml after creating VMs
Unfortunately it is still needed. For example to load default netvm
setting.
2015-07-08 01:20:25 +02:00
Marek Marczykowski-Górecki
6d1f40219c tests: code style fixes, no functional change 2015-07-07 21:41:54 +02:00
Wojtek Porczyk
a82bf7cc54 qubes/tests: Move unit tests inside qubes/, add runner 2015-06-29 17:39:24 +02:00
Wojtek Porczyk
c414ab6df0 tests: fix VMCollection tests 2015-06-29 17:39:24 +02:00
Wojtek Porczyk
41fef46db2 core3 move: QubesVM
This is a big commit and probably incomplete. Tests will follow.
2015-06-29 17:39:24 +02:00
Wojtek Porczyk
ef4f00dac0 qubes/vm: DeviceManager class for herding devices
collections.defaultdict was not enough, because it cannot pass any arguments to
factory. We need to pass domain object and device class to fire events on attach
and detach.
2015-06-29 17:39:24 +02:00
Wojtek Porczyk
855a434879 core3: event framework adjusted for global Qubes object
From now, global events are emitted by qubes.Qubes object and handlers are registered there.
2015-06-29 17:39:24 +02:00
Wojtek Porczyk
b623a71d87 core3 move: QubesVmCollection
This got split to qubes.Qubes and qubes.VMCollection.
From now on, VMCollection is a stupid bag. Some parts went elsewhere.
2015-06-29 17:39:23 +02:00
Wojtek Porczyk
6146c8e466 QubesVmLabel: XML parsing 2015-06-29 17:39:23 +02:00
Wojtek Porczyk
87ae0112eb qubes/vm: New XML format loading 2015-06-29 17:39:23 +02:00
Marek Marczykowski-Górecki
8134360614 tests: fix skipping whonix in timezone test 2015-06-27 05:05:34 +02:00