Commit Graph

24 Commits

Author SHA1 Message Date
Uri Lublin
603b100ba1 migrate.py: do not run with snapshot
Instead, create a new image with backing-file of the original image
(a "permanent" snapshot), use it during the test and remove it at the end.

Also use 'writeback' cache instead of 'unsafe'.

Signed-off-by: Uri Lublin <uril@redhat.com>

squash: actually remove the snapshot. mention cache change
2020-02-20 21:45:00 +02:00
Uri Lublin
eafde16358 migrate.py: a helper function for shell commands
Signed-off-by: Uri Lublin <uril@redhat.com>
2020-02-20 19:18:10 +02:00
Uri Lublin
dd9b5bd483 migrate.py: print qemu command line
Signed-off-by: Uri Lublin <uril@redhat.com>
2020-02-20 19:18:10 +02:00
Uri Lublin
5d82ed42d0 migrate.py: enable kvm
I LOVE KVM
(or Make the guest run faster)

Signed-off-by: Uri Lublin <uril@redhat.com>
2020-02-20 19:18:10 +02:00
Uri Lublin
77ae94a214 migrate.py: python3: when there is no output do not print the heading
Also don't try to decode a possibly None value.

Signed-off-by: Uri Lublin <uril@redhat.com>
2020-02-20 19:18:10 +02:00
Uri Lublin
7318565ecc migrate.py: python3: raw_input and more
There is no raw_input() in python3 -- define it as input()

Use decode() when writing subprocess output to the log, to make
sure the argument for write is a string (in python3
stdout.read() returns bytes).

There is no has_key in python3 -- use "in" instead

Signed-off-by: Uri Lublin <uril@redhat.com>
2020-02-20 14:10:09 +02:00
Uri Lublin
d109bd3577 migrate.py: python3: print
Add parenthesis to all print calls

Signed-off-by: Uri Lublin <uril@redhat.com>
2020-02-13 15:50:55 +02:00
Uri Lublin
189c38f04f migrate.py: remove unused variable err
Signed-off-by: Uri Lublin <uril@redhat.com>
2020-02-13 15:50:55 +02:00
Victor Toso
e86d4e3e48 tests: migrate: fix migration with --vdagent option
Before this patch, running the test with --vdagent option would error
in the second migration attempt with:

 | qemu-system-x86_64: Unknown savevm section or instance
 | '0000:00:04.0/virtio-console' 0. Make sure that your current VM setup
 | matches your saved VM setup, including any hotplugged devices

The reason is that target host created for migration was lacking the
configuration for vdagent that is present in the first source/target
migration VMs.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2019-10-04 13:32:13 +02:00
Victor Toso
6777ec31f1 tests: migrate: wait user launch client option
Useful to test different clients running different tools (gdb,
valgrind).

Signed-off-by: Victor Toso <victortoso@redhat.com>
2019-10-04 13:31:55 +02:00
Victor Toso
878d3bd1ab tests: migrate: default to not launch client
This supports doing migration without any client to be connected.
If tester wants client, it needs to pass an option to --client.

Change of default still is to keep the test as simple as possible
when no arguments are given.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2019-10-04 13:31:20 +02:00
Victor Toso
bc928ad2a8 tests: migrate: add counter for tests
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-09-25 14:44:53 +02:00
Victor Toso
37507c928a tests: migrate: add option --wait-user-input
The iterate() method already considers it. This is useful if one wants
to attach gdb on qemu for instance.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-09-25 14:44:53 +02:00
Victor Toso
4241806de7 tests: migrate: bool instead of on/off option in cmd line
Simpler. Make the default to be False as well as
 1) No args should run as simple as possible
 2) True is currently broken

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-09-25 14:44:53 +02:00
Victor Toso
0d351864b1 tests: migrate: remove multiple client option
Not supported feature to be tested so reduce unused/untested code for
now.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-09-25 14:44:48 +02:00
Victor Toso
6ca34325f5 tests: migrate: fix relative qmp.py path
Moved in qemu, see:

 | commit 8f8fd9edba4bd6768da2c8e2bea49ad5c16ced1a
 | Author: Cleber Rosa <crosa@redhat.com>
 | Date:   Wed Feb 6 11:29:01 2019 -0500
 |
 |     Introduce a Python module structure
 |
 |     This is a simple move of Python code that wraps common QEMU
 |     functionality, and are used by a number of different tests and
 |     scripts.
 |
 |     By treating that code as a real Python module, we can more easily:
 |      * reuse code
 |      * have a proper place for the module's own unittests
 |      * apply a more consistent style
 |      * generate documentation

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-09-25 14:44:07 +02:00
Victor Toso
973779961f tests: migrate: add support to run with remote-viewer
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-09-25 14:44:07 +02:00
Victor Toso
a0a310befe tests: migrate: use uri for default's spicy client
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-09-25 14:44:07 +02:00
Victor Toso
f82cf87e65 tests: migrate: remove spicec option
Removed, see:

 | commit 1876971442
 | Author: Christophe Fergeau <cfergeau@redhat.com>
 | Date:   Fri Nov 21 11:01:17 2014 +0100
 |
 |     client: Remove client code
 |
 |     The client has been superseded by virt-viewer (
 |     http://virt-manager.org/download/sources/virt-viewer/ )
 |     and is no longer being maintained.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-09-25 14:44:07 +02:00
Alon Levy
13a6c8b3a1 tests/migrate.py: add --vdagent
Adds the required options to provide a vdagent to the guest in both source and target qemu
instances.

This will be the last update of the in spice git tests directory, I've moved those tests
to the repository spice-tests. The longer term goal remains autotest integration, but since
this test (and some minor others for qemu) need a home it is:

http://cgit.freedesktop.org/~alon/spice-tests/

(I'm reluctant to put it under spice/ because of my wish to go to autotest, but still, there
they are. Nothing as permanent as the temporary).

Independent (of external modules, i.e. qemu) tests (server/tests) should remain in tree.
2011-08-23 17:01:14 +03:00
Alon Levy
26851b8ae6 server/tests/migrate.py: make executable 2011-08-23 17:01:14 +03:00
Alon Levy
b5d204b6ef tests/migrate: update to use argparse and run spicy by default
Most helpful change is that it prints help if you do --help.
It can take --image parameter, and --client parameter, defaults to spicy.

Incidentally, spicy switch host seems broken - if you run with --client spicec
(assuming spicec is in the PATH), it works fine, but using the default spicy (or
--client spicy) it fails after a single switch.
2011-07-05 14:24:41 +02:00
Alon Levy
2f9d1e7715 tests/migrate.py: refactor to allow importing for later use 2011-02-11 19:13:03 +02:00
Alon Levy
fc3637bf32 tests/migrate.py: add a migration test 2011-01-15 20:54:48 +02:00