From aa8001fbfaf9d7b7327031b03d3e1f0fe8fba2c9 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 15 May 2013 00:31:34 -0500 Subject: [PATCH] test-imagex-ntfs: Skip tests when initial mount does not even work --- debian/wimlib-dev.dirs | 2 -- debian/wimlib.dirs | 2 -- tests/test-imagex-ntfs | 22 +++++++++++----------- 3 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 debian/wimlib-dev.dirs delete mode 100644 debian/wimlib.dirs diff --git a/debian/wimlib-dev.dirs b/debian/wimlib-dev.dirs deleted file mode 100644 index 44188162..00000000 --- a/debian/wimlib-dev.dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib -usr/include diff --git a/debian/wimlib.dirs b/debian/wimlib.dirs deleted file mode 100644 index 14f5b95d..00000000 --- a/debian/wimlib.dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib -usr/bin diff --git a/tests/test-imagex-ntfs b/tests/test-imagex-ntfs index ff67985a..e1c8195e 100755 --- a/tests/test-imagex-ntfs +++ b/tests/test-imagex-ntfs @@ -30,16 +30,16 @@ do_unmount() { } __do_mount() { - options="$3" - if [ -z "$options" ]; then - options="no_def_opts,silent" - else - options="$options,no_def_opts,silent" - fi - if ! ntfs-3g -o $options $1 $2; then - error "Could not mount NTFS volume \"$1\" on \"$2\"! Make sure ntfs-3g is "\ - "installed, and that you are either running the tests as root or have ntfs-3g "\ - "installed setuid root, so that we can mount a NTFS volume." + if ! ntfs-3g -o "no_def_opts,silent" $1 $2; then + if [ $UID -ne 0 ] && [ "$3" = "nofail" ]; then + echo "WARNING: skipping NTFS tests because we aren't able to " + echo "mount a NTFS volume (perhaps ntfs-3g is not installed setuid root?)" + exit 0 + else + error "Could not mount NTFS volume \"$1\" on \"$2\"! Make sure ntfs-3g is "\ + "installed, and that you are either running the tests as root or have ntfs-3g "\ + "installed setuid root, so that we can mount a NTFS volume." + fi fi } @@ -61,7 +61,7 @@ init() { mkdir in.mnt out.mnt do_mkntfs in.ntfs do_mkntfs out.ntfs - do_mount in.ntfs in.mnt + do_mount in.ntfs in.mnt nofail } cleanup() { -- 2.43.0