build: Return 77 from skipped tests.

This commit is contained in:
Richard W.M. Jones
2012-07-19 11:16:35 +01:00
parent 1b94ea204d
commit fc86db3b3b
23 changed files with 45 additions and 41 deletions

View File

@@ -23,7 +23,7 @@
test -d /dev/fd || {
echo "$0: Skipping this test because /dev/fd is missing."
exit 0
exit 77
}
set -e

View File

@@ -23,7 +23,7 @@
test -d /dev/fd || {
echo "$0: Skipping this test because /dev/fd is missing."
exit 0
exit 77
}
set -e

View File

@@ -20,7 +20,7 @@
if [ -n "$SKIP_TEST_MOUNT_LOCAL_SH" ]; then
echo "$0: skipping test because SKIP_TEST_MOUNT_LOCAL_SH is set."
exit 0
exit 77
fi
# Skip if no FUSE.
@@ -28,7 +28,7 @@ fi
test -w /dev/fuse || {
echo "$0: Skipping this test"
echo " because /dev/fuse is missing or not writable by the current user."
exit 0
exit 77
}
set -e

View File

@@ -25,12 +25,12 @@ set -e
if [ -n "$SKIP_TEST_FUSE_SH" ]; then
echo "$0: test skipped because environment variable is set."
exit 0
exit 77
fi
if [ ! -w /dev/fuse ]; then
echo "SKIPPING guestmount test, because there is no /dev/fuse."
exit 0
exit 77
fi
rm -f test.qcow2 test-copy.qcow2 test.pid

View File

@@ -22,17 +22,17 @@ set -e
if [ -n "$SKIP_TEST_FUSE_SH" ]; then
echo "$0: test skipped because environment variable is set."
exit 0
exit 77
fi
if [ ! -w /dev/fuse ]; then
echo "SKIPPING guestmount test, because there is no /dev/fuse."
exit 0
exit 77
fi
if ! setfacl --help >/dev/null 2>&1; then
echo "SKIPPING guestmount test, because setfacl is not installed."
exit 0
exit 77
fi
if [ -z "$top_builddir" ]; then

View File

@@ -20,7 +20,7 @@ set -e
if [ -z "$GJS" ]; then
echo "GObject bind tests skipped: gjs is missing"
exit 0
exit 77
fi
$GJS $srcdir/tests-misc.js 2>/dev/null

View File

@@ -20,7 +20,7 @@ set -e
if [ -z "$GJS" ]; then
echo "GObject bind tests skipped: gjs is missing"
exit 0
exit 77
fi
$GJS $srcdir/bindtests.js > bindtests.tmp

View File

@@ -39,7 +39,7 @@ let rec main () =
if value <> "" then (
printf "%s: test skipped because %s is set.\n"
Sys.executable_name name;
exit 0
exit 77
)
in

10
run.in
View File

@@ -116,9 +116,13 @@ else
rm -f $b/run.$pid
$libtool "$@" > $b/run.$pid 2>&1 || {
fail=$?
echo "$b/run --test" "$@"
cat $b/run.$pid
echo "$b/run: command failed with exit code $fail"
if [ "$fail" -eq 77 ]; then
cat $b/run.$pid
else
echo "$b/run --test" "$@"
cat $b/run.$pid
echo "$b/run: command failed with exit code $fail"
fi
}
rm -f $b/run.$pid
exit $fail

View File

@@ -22,12 +22,12 @@ set -e
if [ -n "$SKIP_TEST_VIRT_SYSPREP_SCRIPT_SH" ]; then
echo "$0: test skipped because environment variable is set."
exit 0
exit 77
fi
if [ ! -w /dev/fuse ]; then
echo "$0: SKIPPING test, because there is no /dev/fuse."
exit 0
exit 77
fi
# Check that multiple scripts can run.

View File

@@ -29,7 +29,7 @@ guestfish=../../fish/guestfish
# If btrfs is not available, bail.
if ! $guestfish -a /dev/null run : available btrfs; then
echo "$0: skipping test because btrfs is not available"
exit 0
exit 77
fi
rm -f test[1234].img

View File

@@ -39,7 +39,7 @@ $g->launch ();
# If btrfs is not available, bail.
unless (feature_available ($g, "btrfs")) {
warn "$0: skipping test because btrfs is not available\n";
exit 0;
exit 77;
}
$g->part_disk ("/dev/sda", "mbr");

View File

@@ -20,13 +20,13 @@ set -e
if [ ! -d "$QEMUDIR" ]; then
echo "$0: \$QEMUDIR not a directory, tests against upstream qemu skipped"
exit 0
exit 77
fi
QEMU="$QEMUDIR/x86_64-softmmu/qemu-system-x86_64"
if ! "$QEMU" --help >/dev/null 2>&1; then
echo "$0: $QEMU not executable, tests against upstream qemu skipped"
exit 0
exit 77
fi
"$QEMU" --version

View File

@@ -22,7 +22,7 @@ set -e
[ -n "$SKIP_TEST_LUKS_SH" ] && {
echo "test-luks-list.sh skipped (environment variable set)"
exit 0
exit 77
}
rm -f test1.img test.output

View File

@@ -22,7 +22,7 @@ set -e
[ -n "$SKIP_TEST_LUKS_SH" ] && {
echo "test-luks.sh skipped (environment variable set)"
exit 0
exit 77
}
rm -f test1.img

View File

@@ -23,7 +23,7 @@ export LANG=C
if [ -n "$SKIP_TEST_INSPECT_FSTAB_MD_SH" ]; then
echo "$0: test skipped because environment variable is set."
exit 0
exit 77
fi
# The first test requires a new Augeas lens for parsing mdadm.conf.
@@ -32,7 +32,7 @@ fi
f=$(grep mdadm_conf.aug ../../appliance/supermin.d/hostfiles | head -1)
if [ -z "$f" -o ! -f "$f" ]; then
echo "$0: test skipped because Augeas mdadm.conf lens is not available."
exit 0
exit 77
fi
guestfish=../../fish/guestfish

View File

@@ -22,7 +22,7 @@ set -e
if [ -n "$SKIP_TEST_LIST_FILESYSTEMS_SH" ]; then
echo "$0: test skipped because environment variable is set."
exit 0
exit 77
fi
rm -f test.output

View File

@@ -22,7 +22,7 @@ set -e
if [ -n "$SKIP_TEST_MDADM_SH" ]; then
echo "$0: test skipped because environment variable is set."
exit 0
exit 77
fi
rm -f md-test1.img md-test2.img md-test3.img md-test4.img

View File

@@ -101,13 +101,13 @@ main (int argc, char *argv[])
if (skip && STREQ (skip, "1")) {
fprintf (stderr, "%s: test skipped because environment variable set.\n",
argv[0]);
exit (EXIT_SUCCESS);
exit (77);
}
if (access ("/dev/fuse", W_OK) == -1) {
fprintf (stderr, "%s: test skipped because /dev/fuse is not writable.\n",
argv[0]);
exit (EXIT_SUCCESS);
exit (77);
}
/* Choose the number of threads based on the amount of free memory. */

View File

@@ -22,7 +22,7 @@ set -e
if [ -n "$SKIP_TEST_NTFSCLONE_SH" ]; then
echo "$0: test skipped because environment variable is set."
exit 0
exit 77
fi
rm -f test1.img backup1 backup2
@@ -32,7 +32,7 @@ guestfish=../../fish/guestfish
# Skip if ntfs-3g is not supported by the appliance.
if ! $guestfish add /dev/null : run : available "ntfs3g"; then
echo "$0: skipped because ntfs-3g is not supported by the appliance"
exit 0
exit 77
fi
# Export the filesystems to the backup file.

View File

@@ -26,7 +26,7 @@ use POSIX;
use Sys::Guestfs;
# Allow this test to be skipped.
exit 0 if $ENV{SKIP_TEST_LAUNCH_RACE_PL};
exit 77 if $ENV{SKIP_TEST_LAUNCH_RACE_PL};
# Use a temporary TMPDIR to ensure it's clean
my $tmpdir = tempdir (CLEANUP => 1);

View File

@@ -29,7 +29,7 @@
# the mkfs fails. It's not clear how to solve this cleanly. XXX
[ -n "$SKIP_TEST_RHBZ690819_SH" ] && {
echo "$0 skipped (environment variable set)"
exit 0
exit 77
}
set -e
@@ -37,7 +37,7 @@ export LANG=C
if [ -n "$SKIP_TEST_RHBZ690819_SH" ]; then
echo "$0: test skipped because environment variable is set."
exit 0
exit 77
fi
rm -f test.img

View File

@@ -48,7 +48,7 @@ die unless $test_via eq "direct" || $test_via eq "fuse";
my $env_name = "SKIP_TEST_SELINUX_" . uc ($test_type) . "_" . uc ($test_via);
if ($ENV{$env_name}) {
print "$prog $test_type $test_via: test skipped because $env_name is set.\n";
exit 0
exit 77
}
# SELinux labelling won't work (and can be skipped) if SELinux isn't
@@ -58,7 +58,7 @@ if ($test_type eq "selinux") {
chomp;
if ($_ ne "Enforcing" && $_ ne "Permissive") {
print "$prog $test_type $test_via: test skipped because SELinux is not enabled.\n";
exit
exit 77
}
}
@@ -66,7 +66,7 @@ if ($test_type eq "selinux") {
if ($test_via eq "fuse") {
unless (-w "/dev/fuse") {
print "$prog $test_type $test_via: test skipped because there is no /dev/fuse.\n";
exit
exit 77
}
}
@@ -74,7 +74,7 @@ if ($test_via eq "fuse") {
if ($test_type eq "xattrs" && $test_via eq "fuse") {
if (system ("setfattr --help >/dev/null 2>&1") != 0) {
print "$prog $test_type $test_via: test skipped because 'setfattr' is not installed.\n";
exit
exit 77
}
}
@@ -82,7 +82,7 @@ if ($test_type eq "xattrs" && $test_via eq "fuse") {
if ($test_type eq "selinux" && $test_via eq "fuse") {
if (system ("chcon --help >/dev/null 2>&1") != 0) {
print "$prog $test_type $test_via: test skipped because 'chcon' is not installed.\n";
exit
exit 77
}
}
@@ -95,7 +95,7 @@ if ($test_type eq "selinux" && $test_via eq "fuse") {
print "don't work well together:\n";
print "https://bugzilla.redhat.com/show_bug.cgi?id=811217\n";
print "https://bugzilla.redhat.com/show_bug.cgi?id=812798#c42\n";
exit;
exit 77;
}
# Create a filesystem that could support xattrs and SELinux labels.
@@ -115,7 +115,7 @@ unless (feature_available ($g, "linuxxattrs")) {
print "$prog $test_type $test_via: test skipped because 'linuxxattrs' feature not available.\n";
$g->close ();
unlink $testimg;
exit 0
exit 77
}
$g->part_disk ("/dev/sda", "mbr");