From f5194e6b0a470d6fe05eaa39b57eb9d0770bbe38 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 Oct 2012 12:56:06 +0000 Subject: tests: Allow more tests to be skipped. Specifically tests which involve btrfs, because btrfs is currently broken upstream (RHBZ#863978). --- tests/btrfs/test-btrfs-devices.sh | 6 ++++++ tests/btrfs/test-btrfs-subvolume-default.pl | 3 +++ tests/charsets/test-charset-fidelity.c | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/tests/btrfs/test-btrfs-devices.sh b/tests/btrfs/test-btrfs-devices.sh index d1f1ce73..bba79837 100755 --- a/tests/btrfs/test-btrfs-devices.sh +++ b/tests/btrfs/test-btrfs-devices.sh @@ -26,6 +26,12 @@ set -e guestfish=../../fish/guestfish +# Allow the test to be skipped since btrfs is often broken. +if [ -n "$SKIP_TEST_BTRFS_DEVICES_SH" ]; then + echo "$0: skipping test because environment variable is set." + exit 77 +fi + # If btrfs is not available, bail. if ! $guestfish -a /dev/null run : available btrfs; then echo "$0: skipping test because btrfs is not available" diff --git a/tests/btrfs/test-btrfs-subvolume-default.pl b/tests/btrfs/test-btrfs-subvolume-default.pl index 1eb36768..b9557139 100755 --- a/tests/btrfs/test-btrfs-subvolume-default.pl +++ b/tests/btrfs/test-btrfs-subvolume-default.pl @@ -24,6 +24,9 @@ use warnings; use Sys::Guestfs; use Sys::Guestfs::Lib qw(feature_available); +# Allow the test to be skipped since btrfs is often broken. +exit 77 if $ENV{SKIP_TEST_BTRFS_SUBVOLUME_DEFAULT_PL}; + my $testimg = "test1.img"; unlink $testimg; diff --git a/tests/charsets/test-charset-fidelity.c b/tests/charsets/test-charset-fidelity.c index 7332c542..b358f2cd 100644 --- a/tests/charsets/test-charset-fidelity.c +++ b/tests/charsets/test-charset-fidelity.c @@ -77,12 +77,21 @@ static int feature_available (guestfs_h *g, const char *feature); int main (int argc, char *argv[]) { + char *str; guestfs_h *g; char tmp[] = "/tmp/charsetXXXXXX"; int fd; size_t i; struct filesystem *fs; + /* Allow this test to be skipped. */ + str = getenv ("SKIP_TEST_CHARSET_FIDELITY"); + if (str && STREQ (str, "1")) { + printf ("%s: test skipped because environment variable is set.\n", + argv[0]); + exit (77); + } + g = guestfs_create (); if (g == NULL) error (EXIT_FAILURE, 0, "failed to create handle"); -- cgit