]> git.proxmox.com Git - qemu-server.git/commit
create test environment for migration
authorFabian Ebner <f.ebner@proxmox.com>
Tue, 1 Dec 2020 12:07:02 +0000 (13:07 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 15 Dec 2020 14:21:37 +0000 (15:21 +0100)
commit48831384b86b4a3f8f9a1d4db8e4af75135ebce5
tree9a8bbf359fb882b6d7bf113f806fea8a572e0db6
parenteb3acec88a861d6e973b00311b38b77656530097
create test environment for migration

and the associated parts for 'qm start'.

Each test will first populate the MigrationTest/run directory
with the relevant configuration files and files keeping track of the
state of everything necessary. Second, the mock-script for migration
is executed, which in turn will execute the 'qm start' mock-script
(if it's an online test that gets far enough). The scripts will simulate
a migration and update the relevant files in the MigrationTest/run directory.
Finally, the main test script will evaluate the state.

The main checks are the volume IDs on the source and target and the VM
configuration itself. Additional checks are the vm_status and expected_calls,
keeping track if certain calls have been made.

The rationale behind creating two mock-scripts is two-fold:
1. It removes the need to hard code responses for the tunnel
   and to recycle logic for determining and allocating migration volumes.
   Some of that logic already happens in the API part, so it was necessary
   to mock the whole CLI-Handler.
2. It allows testing the code relevant for migration in 'qm start' as well,
   and it should even be possible to test different versions of the
   mock-scripts against each other. With a bit of extra work and things
   like 'git worktree', it might even be possible to automate this.

The helper get_patched config is useful to change pre-defined configuration
files on the fly, avoiding the new to explicitly define whole configurations to
test for something in many cases.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
test/Makefile
test/MigrationTest/QemuMigrateMock.pm [new file with mode: 0644]
test/MigrationTest/QmMock.pm [new file with mode: 0644]
test/MigrationTest/Shared.pm [new file with mode: 0644]
test/run_qemu_migrate_tests.pl [new file with mode: 0755]