5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-20 14:03:50 +03:00

18 Commits

Author SHA1 Message Date
Thomas Lamprecht
db70021bcf config2command test: mock kernel_has_vhost_net
just return true for now, the use is guarded by an 'is_native($arch)'
check anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-12-20 10:44:15 +01:00
Thomas Lamprecht
e1bdc0debc config2command test: diff: use /proc/self/fd
/dev/fd works only through some compatibility hacks in some shells,
use the correct one for Linux: /proc/self/fd/*

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-12-20 10:38:09 +01:00
Thomas Lamprecht
66c539947a config2command test: mock kvm_version too
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-12-20 10:27:21 +01:00
Thomas Lamprecht
8256220068 t/cfg2cmd: ensure tests can pass again
the change to use a real diff to check tests, with it's nicer output
for failing cases, failed to ensure that the test system knew if a
case passed - earlier done indirectly by 'is_deeply', thus add a
manual 'pass' call if the tes was OK.
Further, the firs test failing aborted everything, which isn't to
nice, normally it's much more convenient if all test get run and one
can view at the results of all of them. So put the diff in an eval
and fail/note the test manually.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-12-11 10:45:03 +01:00
Wolfgang Bumiller
3dc780c643 t/cfg2cmd: replace is_deeply with diff
(The diff() sub is copied from our pve-common's network
interfaces test scripts)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-12-11 10:44:04 +01:00
Wolfgang Bumiller
a774013569 t/cfg2cmd: mock iscsi initiator name
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-12-11 10:44:04 +01:00
Thomas Lamprecht
7b963e5762 add config to command tests
To have a better safety net for not introducing regressions and also
some functional checks as the QEMU command defines the layout
behavior of the VM.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-12-11 10:44:04 +01:00
Dominik Csapak
28831e1014 add new tests for 'runningmachine' and rollback
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-17 15:49:31 +02:00
Dominik Csapak
c6737ef18b ensure correct machine type gets saved on snapshot
instead of overwriting the 'machine' config in the snapshot,
use its own 'runningmachine' config only for the snapshot

this way, we do not lose the machine type if it was
explicitely set during the snapshot, but deleted afterwards

we also have to adapt the tests for this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-17 15:48:05 +02:00
Emmanuel Kasper
5fd0910be3 Add tests for parse_ovf function
This includes:
 * a test script
 * the manifests generated by exports from a VmWare Workstation
 *  disk images are generated from qemu-img, with a 2KB size
(it is possible to inspect the disk images with od -bc
they contain a VMDK header and the rest are null characters)
2017-09-25 13:31:55 +02:00
Dietmar Maurer
d79a3e5411 snapshot-test.pm: ignore existing replication config 2017-06-28 13:29:33 +02:00
Dietmar Maurer
3097a06bca add regression tests for get_replicatable_volumes 2017-06-14 07:02:43 +02:00
Fabian Grünbichler
101a1b3f95 tests: fix broken snapshot create tests
by mocking de/activate vmstate volumes. these were broken by
3a8deb551f2c7648865437961b3593d11bf0591b, which introduced
activating/deactivating vmstate volumes for KRBD

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-05-17 13:58:18 +02:00
Fabian Grünbichler
d47ea4d05a tests: fix broken snapshot delete tests
these broke when the additional "snapshot-delete" lock was
introduced

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-05-17 13:58:18 +02:00
Fabian Grünbichler
1c4afc63cd tests: exit with -1 in case of failures
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-05-17 13:58:18 +02:00
Fabian Grünbichler
b2c9558da8 Rework snapshot code, has_feature
Drop snapshot_create, snapshot_delete and snapshot_rollback
in favour of PVE::AbstractConfig. Qemu-specific parts are
implemented in __snapshot_XX methods in PVE::QemuConfig.

has_feature is made an implementation of the abstract
has_feature, and thus moves to PVE::QemuConfig.

Note: a new hook method needed to be introduced to be called
before creating a volume snapshot, after creating a volume
snapshot, and after unfreezing the guestfs after creating a
volume snapshot. The base method in PVE::AbstractConfig is a
noop, the implemention in PVE::QemuConfig runs the necessary
Qemu monitor commands.
2016-03-08 11:42:37 +01:00
Fabian Grünbichler
ffda963f46 Refactor basic config-related methods
Drop load_config, write_config, lock_config[_xx],
check_lock, check_protection, is_template and config_file
in favour of implementions in PVE::AbstractConfig.

Implement guest_type, __config_max_unused_disks,
config_file_lock and cfs_config_path from
PVE::AbstractConfig in PVE::QemuConfig.
2016-03-08 11:41:59 +01:00
Fabian Grünbichler
a157d0fd17 Add regression tests for snapshotting
these are modelled after the existing snapshot tests for LXC
and should serve as a baseline for refactoring the Qemu
snapshot code using PVE::AbstractConfig
2016-03-04 11:23:23 +01:00