mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
build: Return 77 from skipped tests.
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
test -d /dev/fd || {
|
test -d /dev/fd || {
|
||||||
echo "$0: Skipping this test because /dev/fd is missing."
|
echo "$0: Skipping this test because /dev/fd is missing."
|
||||||
exit 0
|
exit 77
|
||||||
}
|
}
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
test -d /dev/fd || {
|
test -d /dev/fd || {
|
||||||
echo "$0: Skipping this test because /dev/fd is missing."
|
echo "$0: Skipping this test because /dev/fd is missing."
|
||||||
exit 0
|
exit 77
|
||||||
}
|
}
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
if [ -n "$SKIP_TEST_MOUNT_LOCAL_SH" ]; then
|
if [ -n "$SKIP_TEST_MOUNT_LOCAL_SH" ]; then
|
||||||
echo "$0: skipping test because SKIP_TEST_MOUNT_LOCAL_SH is set."
|
echo "$0: skipping test because SKIP_TEST_MOUNT_LOCAL_SH is set."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Skip if no FUSE.
|
# Skip if no FUSE.
|
||||||
@@ -28,7 +28,7 @@ fi
|
|||||||
test -w /dev/fuse || {
|
test -w /dev/fuse || {
|
||||||
echo "$0: Skipping this test"
|
echo "$0: Skipping this test"
|
||||||
echo " because /dev/fuse is missing or not writable by the current user."
|
echo " because /dev/fuse is missing or not writable by the current user."
|
||||||
exit 0
|
exit 77
|
||||||
}
|
}
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@@ -25,12 +25,12 @@ set -e
|
|||||||
|
|
||||||
if [ -n "$SKIP_TEST_FUSE_SH" ]; then
|
if [ -n "$SKIP_TEST_FUSE_SH" ]; then
|
||||||
echo "$0: test skipped because environment variable is set."
|
echo "$0: test skipped because environment variable is set."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -w /dev/fuse ]; then
|
if [ ! -w /dev/fuse ]; then
|
||||||
echo "SKIPPING guestmount test, because there is no /dev/fuse."
|
echo "SKIPPING guestmount test, because there is no /dev/fuse."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f test.qcow2 test-copy.qcow2 test.pid
|
rm -f test.qcow2 test-copy.qcow2 test.pid
|
||||||
|
|||||||
@@ -22,17 +22,17 @@ set -e
|
|||||||
|
|
||||||
if [ -n "$SKIP_TEST_FUSE_SH" ]; then
|
if [ -n "$SKIP_TEST_FUSE_SH" ]; then
|
||||||
echo "$0: test skipped because environment variable is set."
|
echo "$0: test skipped because environment variable is set."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -w /dev/fuse ]; then
|
if [ ! -w /dev/fuse ]; then
|
||||||
echo "SKIPPING guestmount test, because there is no /dev/fuse."
|
echo "SKIPPING guestmount test, because there is no /dev/fuse."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! setfacl --help >/dev/null 2>&1; then
|
if ! setfacl --help >/dev/null 2>&1; then
|
||||||
echo "SKIPPING guestmount test, because setfacl is not installed."
|
echo "SKIPPING guestmount test, because setfacl is not installed."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$top_builddir" ]; then
|
if [ -z "$top_builddir" ]; then
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ set -e
|
|||||||
|
|
||||||
if [ -z "$GJS" ]; then
|
if [ -z "$GJS" ]; then
|
||||||
echo "GObject bind tests skipped: gjs is missing"
|
echo "GObject bind tests skipped: gjs is missing"
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$GJS $srcdir/tests-misc.js 2>/dev/null
|
$GJS $srcdir/tests-misc.js 2>/dev/null
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ set -e
|
|||||||
|
|
||||||
if [ -z "$GJS" ]; then
|
if [ -z "$GJS" ]; then
|
||||||
echo "GObject bind tests skipped: gjs is missing"
|
echo "GObject bind tests skipped: gjs is missing"
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$GJS $srcdir/bindtests.js > bindtests.tmp
|
$GJS $srcdir/bindtests.js > bindtests.tmp
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ let rec main () =
|
|||||||
if value <> "" then (
|
if value <> "" then (
|
||||||
printf "%s: test skipped because %s is set.\n"
|
printf "%s: test skipped because %s is set.\n"
|
||||||
Sys.executable_name name;
|
Sys.executable_name name;
|
||||||
exit 0
|
exit 77
|
||||||
)
|
)
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|||||||
10
run.in
10
run.in
@@ -116,9 +116,13 @@ else
|
|||||||
rm -f $b/run.$pid
|
rm -f $b/run.$pid
|
||||||
$libtool "$@" > $b/run.$pid 2>&1 || {
|
$libtool "$@" > $b/run.$pid 2>&1 || {
|
||||||
fail=$?
|
fail=$?
|
||||||
echo "$b/run --test" "$@"
|
if [ "$fail" -eq 77 ]; then
|
||||||
cat $b/run.$pid
|
cat $b/run.$pid
|
||||||
echo "$b/run: command failed with exit code $fail"
|
else
|
||||||
|
echo "$b/run --test" "$@"
|
||||||
|
cat $b/run.$pid
|
||||||
|
echo "$b/run: command failed with exit code $fail"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
rm -f $b/run.$pid
|
rm -f $b/run.$pid
|
||||||
exit $fail
|
exit $fail
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ set -e
|
|||||||
|
|
||||||
if [ -n "$SKIP_TEST_VIRT_SYSPREP_SCRIPT_SH" ]; then
|
if [ -n "$SKIP_TEST_VIRT_SYSPREP_SCRIPT_SH" ]; then
|
||||||
echo "$0: test skipped because environment variable is set."
|
echo "$0: test skipped because environment variable is set."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -w /dev/fuse ]; then
|
if [ ! -w /dev/fuse ]; then
|
||||||
echo "$0: SKIPPING test, because there is no /dev/fuse."
|
echo "$0: SKIPPING test, because there is no /dev/fuse."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that multiple scripts can run.
|
# Check that multiple scripts can run.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ guestfish=../../fish/guestfish
|
|||||||
# If btrfs is not available, bail.
|
# If btrfs is not available, bail.
|
||||||
if ! $guestfish -a /dev/null run : available btrfs; then
|
if ! $guestfish -a /dev/null run : available btrfs; then
|
||||||
echo "$0: skipping test because btrfs is not available"
|
echo "$0: skipping test because btrfs is not available"
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f test[1234].img
|
rm -f test[1234].img
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ $g->launch ();
|
|||||||
# If btrfs is not available, bail.
|
# If btrfs is not available, bail.
|
||||||
unless (feature_available ($g, "btrfs")) {
|
unless (feature_available ($g, "btrfs")) {
|
||||||
warn "$0: skipping test because btrfs is not available\n";
|
warn "$0: skipping test because btrfs is not available\n";
|
||||||
exit 0;
|
exit 77;
|
||||||
}
|
}
|
||||||
|
|
||||||
$g->part_disk ("/dev/sda", "mbr");
|
$g->part_disk ("/dev/sda", "mbr");
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ set -e
|
|||||||
|
|
||||||
if [ ! -d "$QEMUDIR" ]; then
|
if [ ! -d "$QEMUDIR" ]; then
|
||||||
echo "$0: \$QEMUDIR not a directory, tests against upstream qemu skipped"
|
echo "$0: \$QEMUDIR not a directory, tests against upstream qemu skipped"
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
QEMU="$QEMUDIR/x86_64-softmmu/qemu-system-x86_64"
|
QEMU="$QEMUDIR/x86_64-softmmu/qemu-system-x86_64"
|
||||||
if ! "$QEMU" --help >/dev/null 2>&1; then
|
if ! "$QEMU" --help >/dev/null 2>&1; then
|
||||||
echo "$0: $QEMU not executable, tests against upstream qemu skipped"
|
echo "$0: $QEMU not executable, tests against upstream qemu skipped"
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"$QEMU" --version
|
"$QEMU" --version
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ set -e
|
|||||||
|
|
||||||
[ -n "$SKIP_TEST_LUKS_SH" ] && {
|
[ -n "$SKIP_TEST_LUKS_SH" ] && {
|
||||||
echo "test-luks-list.sh skipped (environment variable set)"
|
echo "test-luks-list.sh skipped (environment variable set)"
|
||||||
exit 0
|
exit 77
|
||||||
}
|
}
|
||||||
|
|
||||||
rm -f test1.img test.output
|
rm -f test1.img test.output
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ set -e
|
|||||||
|
|
||||||
[ -n "$SKIP_TEST_LUKS_SH" ] && {
|
[ -n "$SKIP_TEST_LUKS_SH" ] && {
|
||||||
echo "test-luks.sh skipped (environment variable set)"
|
echo "test-luks.sh skipped (environment variable set)"
|
||||||
exit 0
|
exit 77
|
||||||
}
|
}
|
||||||
|
|
||||||
rm -f test1.img
|
rm -f test1.img
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export LANG=C
|
|||||||
|
|
||||||
if [ -n "$SKIP_TEST_INSPECT_FSTAB_MD_SH" ]; then
|
if [ -n "$SKIP_TEST_INSPECT_FSTAB_MD_SH" ]; then
|
||||||
echo "$0: test skipped because environment variable is set."
|
echo "$0: test skipped because environment variable is set."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The first test requires a new Augeas lens for parsing mdadm.conf.
|
# 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)
|
f=$(grep mdadm_conf.aug ../../appliance/supermin.d/hostfiles | head -1)
|
||||||
if [ -z "$f" -o ! -f "$f" ]; then
|
if [ -z "$f" -o ! -f "$f" ]; then
|
||||||
echo "$0: test skipped because Augeas mdadm.conf lens is not available."
|
echo "$0: test skipped because Augeas mdadm.conf lens is not available."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
guestfish=../../fish/guestfish
|
guestfish=../../fish/guestfish
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ set -e
|
|||||||
|
|
||||||
if [ -n "$SKIP_TEST_LIST_FILESYSTEMS_SH" ]; then
|
if [ -n "$SKIP_TEST_LIST_FILESYSTEMS_SH" ]; then
|
||||||
echo "$0: test skipped because environment variable is set."
|
echo "$0: test skipped because environment variable is set."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f test.output
|
rm -f test.output
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ set -e
|
|||||||
|
|
||||||
if [ -n "$SKIP_TEST_MDADM_SH" ]; then
|
if [ -n "$SKIP_TEST_MDADM_SH" ]; then
|
||||||
echo "$0: test skipped because environment variable is set."
|
echo "$0: test skipped because environment variable is set."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f md-test1.img md-test2.img md-test3.img md-test4.img
|
rm -f md-test1.img md-test2.img md-test3.img md-test4.img
|
||||||
|
|||||||
@@ -101,13 +101,13 @@ main (int argc, char *argv[])
|
|||||||
if (skip && STREQ (skip, "1")) {
|
if (skip && STREQ (skip, "1")) {
|
||||||
fprintf (stderr, "%s: test skipped because environment variable set.\n",
|
fprintf (stderr, "%s: test skipped because environment variable set.\n",
|
||||||
argv[0]);
|
argv[0]);
|
||||||
exit (EXIT_SUCCESS);
|
exit (77);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (access ("/dev/fuse", W_OK) == -1) {
|
if (access ("/dev/fuse", W_OK) == -1) {
|
||||||
fprintf (stderr, "%s: test skipped because /dev/fuse is not writable.\n",
|
fprintf (stderr, "%s: test skipped because /dev/fuse is not writable.\n",
|
||||||
argv[0]);
|
argv[0]);
|
||||||
exit (EXIT_SUCCESS);
|
exit (77);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Choose the number of threads based on the amount of free memory. */
|
/* Choose the number of threads based on the amount of free memory. */
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ set -e
|
|||||||
|
|
||||||
if [ -n "$SKIP_TEST_NTFSCLONE_SH" ]; then
|
if [ -n "$SKIP_TEST_NTFSCLONE_SH" ]; then
|
||||||
echo "$0: test skipped because environment variable is set."
|
echo "$0: test skipped because environment variable is set."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f test1.img backup1 backup2
|
rm -f test1.img backup1 backup2
|
||||||
@@ -32,7 +32,7 @@ guestfish=../../fish/guestfish
|
|||||||
# Skip if ntfs-3g is not supported by the appliance.
|
# Skip if ntfs-3g is not supported by the appliance.
|
||||||
if ! $guestfish add /dev/null : run : available "ntfs3g"; then
|
if ! $guestfish add /dev/null : run : available "ntfs3g"; then
|
||||||
echo "$0: skipped because ntfs-3g is not supported by the appliance"
|
echo "$0: skipped because ntfs-3g is not supported by the appliance"
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Export the filesystems to the backup file.
|
# Export the filesystems to the backup file.
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ use POSIX;
|
|||||||
use Sys::Guestfs;
|
use Sys::Guestfs;
|
||||||
|
|
||||||
# Allow this test to be skipped.
|
# 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
|
# Use a temporary TMPDIR to ensure it's clean
|
||||||
my $tmpdir = tempdir (CLEANUP => 1);
|
my $tmpdir = tempdir (CLEANUP => 1);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
# the mkfs fails. It's not clear how to solve this cleanly. XXX
|
# the mkfs fails. It's not clear how to solve this cleanly. XXX
|
||||||
[ -n "$SKIP_TEST_RHBZ690819_SH" ] && {
|
[ -n "$SKIP_TEST_RHBZ690819_SH" ] && {
|
||||||
echo "$0 skipped (environment variable set)"
|
echo "$0 skipped (environment variable set)"
|
||||||
exit 0
|
exit 77
|
||||||
}
|
}
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -37,7 +37,7 @@ export LANG=C
|
|||||||
|
|
||||||
if [ -n "$SKIP_TEST_RHBZ690819_SH" ]; then
|
if [ -n "$SKIP_TEST_RHBZ690819_SH" ]; then
|
||||||
echo "$0: test skipped because environment variable is set."
|
echo "$0: test skipped because environment variable is set."
|
||||||
exit 0
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f test.img
|
rm -f test.img
|
||||||
|
|||||||
@@ -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);
|
my $env_name = "SKIP_TEST_SELINUX_" . uc ($test_type) . "_" . uc ($test_via);
|
||||||
if ($ENV{$env_name}) {
|
if ($ENV{$env_name}) {
|
||||||
print "$prog $test_type $test_via: test skipped because $env_name is set.\n";
|
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
|
# SELinux labelling won't work (and can be skipped) if SELinux isn't
|
||||||
@@ -58,7 +58,7 @@ if ($test_type eq "selinux") {
|
|||||||
chomp;
|
chomp;
|
||||||
if ($_ ne "Enforcing" && $_ ne "Permissive") {
|
if ($_ ne "Enforcing" && $_ ne "Permissive") {
|
||||||
print "$prog $test_type $test_via: test skipped because SELinux is not enabled.\n";
|
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") {
|
if ($test_via eq "fuse") {
|
||||||
unless (-w "/dev/fuse") {
|
unless (-w "/dev/fuse") {
|
||||||
print "$prog $test_type $test_via: test skipped because there is no /dev/fuse.\n";
|
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 ($test_type eq "xattrs" && $test_via eq "fuse") {
|
||||||
if (system ("setfattr --help >/dev/null 2>&1") != 0) {
|
if (system ("setfattr --help >/dev/null 2>&1") != 0) {
|
||||||
print "$prog $test_type $test_via: test skipped because 'setfattr' is not installed.\n";
|
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 ($test_type eq "selinux" && $test_via eq "fuse") {
|
||||||
if (system ("chcon --help >/dev/null 2>&1") != 0) {
|
if (system ("chcon --help >/dev/null 2>&1") != 0) {
|
||||||
print "$prog $test_type $test_via: test skipped because 'chcon' is not installed.\n";
|
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 "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=811217\n";
|
||||||
print "https://bugzilla.redhat.com/show_bug.cgi?id=812798#c42\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.
|
# 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";
|
print "$prog $test_type $test_via: test skipped because 'linuxxattrs' feature not available.\n";
|
||||||
$g->close ();
|
$g->close ();
|
||||||
unlink $testimg;
|
unlink $testimg;
|
||||||
exit 0
|
exit 77
|
||||||
}
|
}
|
||||||
|
|
||||||
$g->part_disk ("/dev/sda", "mbr");
|
$g->part_disk ("/dev/sda", "mbr");
|
||||||
|
|||||||
Reference in New Issue
Block a user