[kvm-unit-tests RFC] Add ability to specify groups which won't be run by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm looking at adding a powerpc test to kvm-unit-tests which has a high
potential of bringing down the host.

Thus I would like to be able to specify that it not be run by default when
all tests are being run, that is the user has to specifically run that test
on its own to ensure that they are sure that they want to run it.

The way I was thinking of doing this is by having some prefix for the
groups parameter in the unittests.cfg file, for example an underscore,
which specifies that this test group not be run when no groups parameter is
passed to run_tests.sh (i.e. all tests are being run). That is the user
will have to specifically specify that individual test group at invocation
to have it run.

Would you be open to having me add this to the generic test infrastructure?

I am open to comments or any other way you would prefer this be done. This
just seemed like the easiest option to me.

Example of patch below using underscore prefix as condition.
---
 scripts/runtime.bash | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 0503cf0..fbd415c 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -52,6 +52,12 @@ function run()
         return
     fi
 
+    if grep -q "^_" <<<$groups && ( [ -z "$only_group" ] || ( [ -n \
+			    "$only_group" ] && ! grep -qw "$only_group" \
+			    <<<$groups) ); then
+	    return;
+    fi
+
     if [ -n "$arch" ] && [ "$arch" != "$ARCH" ]; then
         echo "`SKIP` $1 ($arch only)"
         return 2
-- 
2.5.5

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux