On 10/25/2012 07:38 AM, Plamen Dimitrov wrote:
On Wednesday 24 October 2012 15:10:04 you wrote:
On Wed, Oct 24, 2012 at 1:59 PM, Plamen Dimitrov

<[email protected]> wrote:
Dear autotest team,

Is there a way to add a subdir tag to a virtual test just like we can do
with a normal test? After looking at the source code I foung that there
is only tag which is automatically generated. After trying to modify the
long and short name parameters at a later point it did not work too. Is
there a quick and easy way to do this or it should be developed first?

It should be developed first, unfortunately. But maybe there's another
way to do what you want. I don't really like the idea of nested
tags/subfolders...

Could you share more details of what you would like to do?

I would simply need to run a given test multiple times like "reboot" or
"shutdown". I encountered the same trouble when trying to run the same test
sequentially on multiple virtual machines. A temporary fix that I did is adding
the virtual machine name to the "short_name". However, now when a test is run
often enough on the same machine I tried to turn it into a utility for the
other tests.

Oh, I see. Let me tell you what we do.

Although this seems reasonable, I encountered further problems.
They follow from the fact that a virtual test uses "env", "test.bindir" and
other parameters which are prepared by and for the "virt" main test and then
passed to it as an argument. Turning any virtual test into a utility then
requires to somehow reuse those outside of the "virt" test, perform similar
"env" processing, and even conflict with its original "env" preparation. Can we
then handle vm objects outside of a virt test? If not is there any other way
to make a virtual test be repeated as many times as needed?

The answer can be found here, on this session I forgot to migrate to the virt test wiki:

"""
https://github.com/autotest/autotest/wiki/CartesianConfig

Resolution Order
Outside of dependency re-ordering, the order of the resulting list follows in order of variant definition. To control the order, you must define a new variant block. For example, from the KVM test.cfg:

variants:
    - @first:
        only qemu_kvm_f17_quick..shutdown

    - @second:
        only qemu_kvm_f17_quick..unattended_install.cdrom.extra_cdrom_ks

    - @third:
        only qemu_kvm_f17_quick..ping

    - @forth:
        only qemu_kvm_f17_quick..shutdown

only first, second, third, forth
This will result in the order specified on the last line.
"""

In this case, as we don't want to have name clashes, we can omit the '@' symbol. As an example, I added the following to the tests.cfg file:

diff --git a/kvm/cfg/tests.cfg.sample b/kvm/cfg/tests.cfg.sample
index 46ac571..c1ad192 100644
--- a/kvm/cfg/tests.cfg.sample
+++ b/kvm/cfg/tests.cfg.sample
@@ -90,7 +90,13 @@ variants:
         only no_pci_assignable
         only smallpages
         only Fedora.17.64
-        only unattended_install.cdrom.extra_cdrom_ks, boot, shutdown
+        variants:
+            - 1:
+                only reboot
+            - 2:
+                only reboot
+            - 3:
+                only reboot


And here's what I got parsing it:

virttest/cartesian_config.py kvm/cfg/tests.cfg
dict    1:  1.virtio_blk.smp2.virtio_net.Fedora.17.64.reboot
dict    2:  2.virtio_blk.smp2.virtio_net.Fedora.17.64.reboot
dict    3:  3.virtio_blk.smp2.virtio_net.Fedora.17.64.reboot

I hope this helps!

Cheers,

Lucas

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to