Michael Goldish wrote:
----- "supriya kannery" <supriyak@xxxxxxxxxx> wrote:
Uri Lublin wrote:
supriya kannery wrote:
A patch for iterating over VM reboot
I think adding iterations capability belongs to the infrastructure,
not the test itself. Implement it once in the infrastructure,
There are two quick ways I can think of.
In both cases, the user needs to define something like "iterations = 4" in the config file, where desired.
Different tests can have different iteration values, depending on where the parameter is set.
1. Read the 'iterations' parameter in the control file, and pass its value as the 'iterations' parameter to job.run_test(), e.g.
iterations = int(dict.get("iterations", "1"))
current_status = job.run_test("kvm_runtest_new", params=dict, tag=dict.get("shortname"), iterations=iterations)
Hopefully the iteration number will be appended to the test tag (e.g. Fedora.8.32.reboot.1, Fedora.8.32.reboot.2...).
Michael,
Thanks! for pointing out how to use job.runtest().
Attaching a patch that implements the test iterations through
job.runtest(). Here, we are not appending shortname with iteration value
because the iteration values corresponding to each dict which we pass
through job.runtest() is received by tests.py and is being used to loop
over kvm_runtest_2 . And kvm_runtest_2 in turn calls the corresponding
test routine (boot, reboot, migration etc). That way the aim of looping
over the respective test type is accomplished.
But still I need to confirm whether this does the actual iteration over
rebooting of VM in a loop, because kvm_runtest _2 calls the "boot"
routine even for reboot test type. When iterating over reboot, my
expectation is that, qemu window shouldn't get killed, while the VM
should be rebooting multiple times.
Signed-off-by: Supriya Kannery <supriyak@xxxxxxxxxx>
Cc : Michael Goldish <mgoldish@xxxxxxxxxx>
--- kvm-autotest-tap/client/tests/kvm_runtest_2/control 2009-05-04 17:03:20.000000000 +0530
+++ kvm-autotest-tap/client/tests/kvm_runtest_2/control.mod 2009-05-04 17:02:52.000000000 +0530
@@ -99,7 +99,8 @@ for dict in list:
dependencies_satisfied = False
break
if dependencies_satisfied:
- current_status = job.run_test("kvm_runtest_2", params=dict, tag=dict.get("shortname"))
+ test_iterations=int(dict.get("iterations",1))
+ current_status = job.run_test("kvm_runtest_2", params=dict, tag=dict.get("shortname"),iterations=test_iterations)
else:
current_status = False
status_dict[dict.get("name")] = current_status