Commit a0880b64 authored by Milan Broz's avatar Milan Broz

Add magic exit code for automake to count skipped tests.

parent 6e057c01
......@@ -38,7 +38,7 @@ add_device() {
modprobe scsi_debug $@
if [ $? -ne 0 ] ; then
echo "This kernel seems to not support proper scsi_debug module, test skipped."
exit 0
exit 77
fi
sleep 2
......@@ -47,7 +47,7 @@ add_device() {
if [ ! -e /sys/block/$DEV/alignment_offset ] ; then
echo "This kernel seems to not support topology info, test skipped."
cleanup
exit 0
exit 77
fi
DEV="/dev/$DEV"
......@@ -115,7 +115,7 @@ format_null()
if [ $(id -u) != 0 ]; then
echo "WARNING: You must be root to run this test, test skipped."
exit 0
exit 77
fi
modprobe --dry-run scsi_debug || exit 0
......
......@@ -1920,7 +1920,7 @@ int main(int argc, char *argv[])
if (getuid() != 0) {
printf("You must be root to run this test.\n");
exit(0);
exit(77);
}
for (i = 1; i < argc; i++) {
......
......@@ -74,7 +74,8 @@ function skip()
{
[ -n "$1" ] && echo "$1"
remove_mapping
exit 0
[ -z "$2" ] && exit $2
exit 77
}
function prepare()
......@@ -680,7 +681,7 @@ else
fi
# Interactive tests
which expect >/dev/null 2>&1 || skip "WARNING: expect tool missing, interactive test will be skipped."
which expect >/dev/null 2>&1 || skip "WARNING: expect tool missing, interactive test will be skipped." 0
prepare "[32] Interactive password retry from terminal." new
expect - >/dev/null 2>&1 <<EOF
......
......@@ -27,7 +27,7 @@ skip()
{
echo "TEST SKIPPED: $1"
cleanup
exit 0
exit 77
}
format() # key_bits expected [forced]
......
......@@ -23,7 +23,7 @@ add_device() {
modprobe scsi_debug $@
if [ $? -ne 0 ] ; then
echo "This kernel seems to not support proper scsi_debug module, test skipped."
exit 0
exit 77
fi
sleep 2
......@@ -49,14 +49,14 @@ function check_version()
if [ $(id -u) != 0 ]; then
echo "WARNING: You must be root to run this test, test skipped."
exit 0
exit 77
fi
modprobe --dry-run scsi_debug || exit 0
modprobe dm-crypt >/dev/null 2>&1
if ! check_version ; then
echo "Probably old kernel, test skipped."
exit 0
exit 77
fi
add_device dev_size_mb=16 sector_size=512 num_tgts=1 lbpu=1
......
......@@ -28,7 +28,7 @@ fail()
skip()
{
[ -n "$1" ] && echo "$1"
exit 0
exit 77
}
add_device() {
......
......@@ -23,7 +23,7 @@ HEXKEY_31="bb21158c733229347bd4e681891e213d94c685be6a5b84818afe7a78a6de7a"
function skip()
{
[ -n "$1" ] && echo "$1"
exit 0
exit 77
}
function remove_mapping()
......
......@@ -36,7 +36,7 @@ function fail()
function skip()
{
[ -n "$1" ] && echo "$1"
exit 0
exit 77
}
function prepare()
......
......@@ -28,7 +28,7 @@ function skip()
{
[ -n "$1" ] && echo "$1"
echo "Test skipped."
exit 0
exit 77
}
function test_one()
......
......@@ -40,7 +40,7 @@ fail()
skip()
{
[ -n "$1" ] && echo "$1"
exit 0
exit 77
}
add_device() {
......
......@@ -94,7 +94,7 @@ crypt_key() # hash keysize pwd/file name outkey [limit] [offset]
if [ $(id -u) != 0 ]; then
echo "WARNING: You must be root to run this test, test skipped."
exit 0
exit 77
fi
dmsetup create $DEV_NAME --table "0 10240 zero" >/dev/null 2>&1
......
......@@ -45,7 +45,7 @@ function fail()
function skip()
{
[ -n "$1" ] && echo "$1"
exit 0
exit 77
}
function add_scsi_device() {
......@@ -53,7 +53,7 @@ function add_scsi_device() {
modprobe scsi_debug $@
if [ $? -ne 0 ] ; then
echo "This kernel seems to not support proper scsi_debug module, test skipped."
exit 0
exit 77
fi
sleep 2
......
......@@ -28,7 +28,7 @@ function skip()
{
[ -n "$1" ] && echo "$1"
echo "Test skipped."
exit 0
exit 77
}
function test_one()
......
......@@ -30,7 +30,7 @@ function fail()
function skip()
{
[ -n "$1" ] && echo "$1"
exit 0
exit 77
}
function prepare() # $1 dev1_siz [$2 dev2_size]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment