Commit Graph

2945 Commits

Author SHA1 Message Date
Wojtek Porczyk
bb5099dc9b Revert "tests: separate test component names with dot"
This reverts commit f7a47e6c66.

It is now unneeded since parser, which accepts old names.
Old names are more readable.
2015-02-19 21:32:55 +01:00
Wojtek Porczyk
5a9c390485 tests/run: fix log message formatting 2015-02-19 21:32:43 +01:00
Wojtek Porczyk
3e725efe15 tests/run: add command line parser to runner 2015-02-19 21:32:43 +01:00
Wojtek Porczyk
2b14bc88d0 core/modules: debug important VM changes 2015-02-19 21:32:43 +01:00
Wojtek Porczyk
241cf2e089 core/qubes.py: ensure that all default_*vm are present in collection
References to invalid qids are None'd. Failure to do so may cause KeyErrors even
on fixing ntpd service during instantiation of QubesVmCollection.
2015-02-19 21:32:43 +01:00
Marek Marczykowski-Górecki
c37390e33f tests: remove expectedFailure from test_051_qrexec_simple_eof_reverse
This is already fixed in R3 qrexec code.
2015-02-19 04:03:19 +01:00
Marek Marczykowski-Górecki
f7a47e6c66 tests: separate test component names with dot
This way the same name can be simply copy-pasted to command line - to
rerun a single test.
2015-02-19 03:55:31 +01:00
Marek Marczykowski-Górecki
7596f753d8 tests: add some timeout for process exit 2015-02-19 03:54:57 +01:00
Marek Marczykowski-Górecki
091d02b9a3 tests: reload qubes.xml after save
This is to make sure that QubesVmCollection state is consistent with
qubes.xml - unfortunately some changes are applied to Qubes*Vm object
only at load time (for example connected_vms collections).
2015-02-19 03:52:35 +01:00
Marek Marczykowski-Górecki
f7a06ae29b tests: missing imports 2015-02-18 22:49:47 +01:00
Marek Marczykowski-Górecki
bdae560770 backup: fix deadlock on error while receiving backup from a VM
When qfile-dom0-unpacker detects an error, it sends error report to
stdout and terminate (so stdout is closed). That close should be
transferred to the VM process (as EOF on its stdin), which will signal
it to stop sending the data and handle error report.
Also qrexec-client holds the connection until both stdin and
stdout are closed.
So when that EOF is missing, tar2qfile will not detect error report and
still tries to send the data and qrexec-client will hold the
connection while receiving process is long dead.

To prevent that deadlock from happening, close FD in python code, so
qfile-dom0-unpacker will be the last owner of write end of the pipe.
When it closes its stdout, qrexec-client will receive EOF at its stdin.
2015-02-18 21:41:22 +01:00
Marek Marczykowski-Górecki
affb39f435 Merge remote-tracking branch 'woju/master' 2015-02-18 15:11:05 +01:00
Wojtek Porczyk
d81ae01d48 tests: add logging
Test suite now logs to three places:
 * syslog
 * ${HOME}/qubes-tests.log
 * /dev/kmsg (only start and errors; this is handy while debugging Oopses by
   correlating them with tests)
2015-02-11 16:34:35 +01:00
Marek Marczykowski-Górecki
ef1bf9b33b dispvm: fix setting up DispVM based on non-default template
Replace 'vmdir' symlink instead of creating new one inside of 'vmdir'
directory.
2015-02-11 15:02:33 +01:00
Marek Marczykowski-Górecki
246de96dcd core: make vm.rootcow_img a property 2015-02-11 13:59:57 +01:00
Wojtek Porczyk
b6530200c9 tests: fix after Marek's review 2015-02-11 13:15:35 +01:00
Wojtek Porczyk
7f75ed4d73 tests: runner backported from core3 2015-02-10 23:24:24 +01:00
Wojtek Porczyk
226e257d2a tests: refactored 2015-02-10 23:24:24 +01:00
Marek Marczykowski-Górecki
cf41d94754 core: implement VM suspend
Required for proper host sleep when netvm is running.
2015-02-10 06:45:47 +01:00
Marek Marczykowski-Górecki
e67e9a4be1 Revert part of "core: remove kernel properties from DispVM and Dom0 (#948)"
This reverts DispVM part of commit 72cf3a8201.
2015-02-09 22:29:23 +01:00
Marek Marczykowski-Górecki
726d5686ac tests: disable qrexec_filecopy_self test
When vchan connection is established back to the source domain, gntalloc
crashes with this message:
[    9.937990] BUG: Bad page map in process qrexec-agent  pte:80000000f9d41167 pmd:131c3067
[    9.938010] page:ffffea00036a6638 count:1 mapcount:-1 mapping:          (null) index:0xffffffffffffffff
[    9.938018] page flags: 0x4000000000000c14(referenced|dirty|reserved|private)
[    9.938033] addr:00007fa856d47000 vm_flags:140400fb anon_vma:          (null) mapping:ffff880011efe940 index:11
[    9.938042] vma->vm_ops->fault:           (null)
[    9.938057] vma->vm_file->f_op->mmap: gntalloc_mmap+0x0/0x1c0 [xen_gntalloc]
[    9.938066] CPU: 0 PID: 1108 Comm: qrexec-agent Tainted: G           O 3.12.23-1.pvops.qubes.x86_64 #1
[    9.938074]  ffff8800131f3818 ffff88001316fc78 ffffffff814db550 00007fa856d47000
[    9.938085]  ffff88001316fcb8 ffffffff81139413 ffff880011efe940 ffff8800131c3a38
[    9.938096]  ffffea00036a6638 00007fa856d47000 00007fa856d57000 ffff88001316fe18
[    9.938107] Call Trace:
[    9.938117]  [<ffffffff814db550>] dump_stack+0x45/0x56
[    9.938126]  [<ffffffff81139413>] print_bad_pte+0x1a3/0x240
[    9.938133]  [<ffffffff8113ac9e>] unmap_page_range+0x6ee/0x7d0
[    9.938142]  [<ffffffff8113adf6>] unmap_single_vma+0x76/0xa0
[    9.938149]  [<ffffffff8113be09>] unmap_vmas+0x49/0x90
[    9.938157]  [<ffffffff8114443c>] exit_mmap+0x9c/0x170
[    9.938166]  [<ffffffff8105950c>] mmput+0x5c/0x110
[    9.938175]  [<ffffffff8105d74c>] do_exit+0x27c/0xa20
[    9.938184]  [<ffffffff810908ef>] ? vtime_account_user+0x4f/0x60
[    9.938194]  [<ffffffff81116502>] ? context_tracking_user_exit+0x52/0xc0
[    9.938203]  [<ffffffff8105ed2a>] do_group_exit+0x3a/0xa0
[    9.938211]  [<ffffffff8105ed9f>] SyS_exit_group+0xf/0x10
[    9.938220]  [<ffffffff814ea907>] tracesys+0xdd/0xe2
2015-02-09 22:09:15 +01:00
Marek Marczykowski-Górecki
c663b1dd2d tests: add simple HVM tests 2015-02-09 06:18:57 +01:00
Marek Marczykowski-Górecki
bc35b99549 tests: update DispVM test
Apparently 'l' and 'n' characters aren't passed correctly by xdotool
(some keymap problem?). Do not use them in test text.
2015-02-09 06:17:43 +01:00
Marek Marczykowski-Górecki
27be178a04 tests: add tests for qrexec exit code 2015-02-09 06:08:48 +01:00
Marek Marczykowski-Górecki
086e88183e Explicitly enable emulated GPU
Previously it was enabled only because of bug in libvirt. Now it is
fixed (9e0e0224438b79073bf404627fed8e2889669374), so config needs to be
updated.
2015-02-09 06:04:31 +01:00
Marek Marczykowski-Górecki
adfc4e0ac9 core: disks handling cleanup, fix them for TemplateHVM
Move rootcow_img to storage class, remove clean_volatile_img. And most
importantly - set source_template in QubesHVm.create_on_disk.
2015-02-09 06:02:20 +01:00
Marek Marczykowski-Górecki
2def43517a core/hvm: handle verbose option for guid 2015-02-09 05:39:44 +01:00
Marek Marczykowski-Górecki
5d9fa977e2 Ensure that qvm-shutdown is called while libvirtd is still running 2015-02-09 03:47:45 +01:00
Marek Marczykowski-Górecki
393bb00471 core: update reporting for missing VT-x 2015-02-09 03:46:53 +01:00
Marek Marczykowski-Górecki
869675c15c core: convert memory/cpu stats to libvirt API 2015-02-09 03:28:01 +01:00
Marek Marczykowski-Górecki
f9b2636c73 tests: dom0 update 2015-02-09 03:26:57 +01:00
Marek Marczykowski-Górecki
48fd2669cb raise correct exception 2015-02-07 01:14:22 +01:00
Marek Marczykowski-Górecki
4e26588bb3 core/hvm: remove xenstore code
QubesDB does not require setting up directory (and permissions), so just
remove the function.
2015-02-07 01:12:29 +01:00
Marek Marczykowski-Górecki
89f8f219bf core: changes in libvirt config for libvirt-1.2.12 2015-02-05 06:31:00 +01:00
Marek Marczykowski-Górecki
17a92dd179 tests: fix checking of ping return code
Switch ==1 to !=0 - ping can exit with different errors (timeout,
resolve failed etc), but we don't care what was the reason.
2015-02-02 04:50:37 +01:00
Marek Marczykowski-Górecki
26a9dcda66 tests: actually install network tests 2015-02-02 04:50:26 +01:00
Marek Marczykowski-Górecki
2554d6aee3 Ensure that qubes-netvm.service is started after libvirtd 2015-02-02 04:49:56 +01:00
Marek Marczykowski-Górecki
c74fda802c Use tmpfile.d to create /var/run subdirs
This way it will be done much earlier, so qubes-db can be started before
qubes-core.service - which will solve startup dependency loop problem.
2015-02-02 04:48:42 +01:00
Marek Marczykowski-Górecki
db95153619 doc: typo fix 2015-01-30 01:40:41 +01:00
Marek Marczykowski-Górecki
72cf3a8201 core: remove kernel properties from DispVM and Dom0 (#948)
Qubes does not keep track of those kernel versions.

Conflicts:
	core-modules/01QubesDisposableVm.py
2015-01-30 01:40:40 +01:00
Marek Marczykowski-Górecki
2f7b3adeec doc: qvm-create-default-dvm (#940) 2015-01-30 01:39:59 +01:00
Marek Marczykowski-Górecki
c2675c00e7 doc: sync qvm-service documentation 2015-01-30 01:39:59 +01:00
Marek Marczykowski-Górecki
59a5ae9415 doc: add qvm-services: set-default-route, set-dns-server 2015-01-30 01:39:59 +01:00
Marek Marczykowski-Górecki
6b05d5b392 Add qvm-trim-template tool
Based on work done by Matt McCutchen <matt@mattmccutchen.net>, details
here:
https://groups.google.com/d/msgid/qubes-users/1417939737.2033.24.camel%40localhost
2015-01-30 01:39:59 +01:00
Marek Marczykowski-Górecki
49d510dc65 core: prevent permissions error when VM was started by root
When VM is started by root, config file is created with root owner and
user has no write access to it. As the directory is user-writable,
delete the file first.

Conflicts:
	core-modules/000QubesVm.py
2015-01-30 01:39:57 +01:00
Marek Marczykowski-Górecki
52334bc414 core: fix firewall update code
Do not load qubes.xml again, it can cause race conditions between two
instances of the same VM objects.
Especially when VM is starting ProxyVM to which it is connected,
firewall rules could not be loaded.
2015-01-30 01:38:56 +01:00
Marek Marczykowski-Górecki
c489a81dfa tests: networking 2015-01-30 01:38:56 +01:00
Marek Marczykowski-Górecki
25c425920c qvm-tools: fix error reporting in qvm-kill 2015-01-30 01:38:56 +01:00
Marek Marczykowski-Górecki
73301a67c8 core: fix vm.run(..., passio=False) handling
Long time ago passio=True was used to replace current process with
qrexec-client directly (qvm-run --pass-io was the called), but this
behaviour is not used anymore (qvm-run was the only user). And this
option was left untouched, with misleading name - one would assume that
using passio=False should disallow any I/O, but this isn't the case.

Especially qvm-sync-clock is calling clockvm.run('...', wait=True),
default value for passio=False. This causes to output data from
untrusted VM, without sanitising terminal sequences, which can be fatal.

This patch changes passio semantic to actually do what it means - when
set to True - VM process will be able to interact with
stdin/stdout/stderr. But when set to False, all those FDs will be
connected to /dev/null.

Conflicts:
	core-modules/000QubesVm.py
2015-01-30 01:38:52 +01:00
Marek Marczykowski-Górecki
1da8ab5823 core: Add missing import 2015-01-08 03:55:02 +01:00