>From 51489dc444dc771e187936f622c56db503ee6bc8 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Fri, 22 Jan 2010 19:26:16 +0000
Subject: [PATCH] maint: ensure test independence from config macro format

* tests/cp/acl: Support USE_ACL not being defined.
* tests/mv/acl: Likewise. Also fix typo in skip message.
* tests/cp/preserve-slink-time: Support HAVE_UTIMENSAT being 0.
* tests/touch/no-dereference: Likewise.
* tests/ls/capability: Normalize so 1 is not required to be last char.
---
 tests/cp/acl                 |    2 +-
 tests/cp/preserve-slink-time |    4 ++--
 tests/ls/capability          |    2 +-
 tests/mv/acl                 |    4 ++--
 tests/touch/no-dereference   |    4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/cp/acl b/tests/cp/acl
index dc0c5cf..010348a 100755
--- a/tests/cp/acl
+++ b/tests/cp/acl
@@ -30,7 +30,7 @@ fi
 require_acl_
 
 # Skip this test if cp was built without ACL support:
-grep '^#define USE_ACL 0' $CONFIG_HEADER > /dev/null &&
+grep '^#define USE_ACL 1' $CONFIG_HEADER > /dev/null ||
   skip_test_ "insufficient ACL support"
 
 mkdir -p a b || framework_failure
diff --git a/tests/cp/preserve-slink-time b/tests/cp/preserve-slink-time
index cd01c89..88c1016 100755
--- a/tests/cp/preserve-slink-time
+++ b/tests/cp/preserve-slink-time
@@ -23,8 +23,8 @@ fi
 
 . $srcdir/test-lib.sh
 
-grep '^#define HAVE_UTIMENSAT' "$CONFIG_HEADER" > /dev/null ||
-grep '^#define HAVE_LUTIMES' "$CONFIG_HEADER" > /dev/null ||
+grep '^#define HAVE_UTIMENSAT 1' "$CONFIG_HEADER" > /dev/null ||
+grep '^#define HAVE_LUTIMES 1' "$CONFIG_HEADER" > /dev/null ||
   skip_test_ 'this system lacks the utimensat function'
 
 ln -s no-such dangle || framework_failure
diff --git a/tests/ls/capability b/tests/ls/capability
index e5844c2..df91aa5 100755
--- a/tests/ls/capability
+++ b/tests/ls/capability
@@ -24,7 +24,7 @@ fi
 . $srcdir/test-lib.sh
 require_root_
 
-grep '^#define HAVE_CAP 1$' $CONFIG_HEADER > /dev/null \
+grep '^#define HAVE_CAP 1' $CONFIG_HEADER > /dev/null \
   || skip_test_ "configured without libcap support"
 
 (setcap --help) 2>&1 |grep 'usage: setcap' > /dev/null \
diff --git a/tests/mv/acl b/tests/mv/acl
index f581992..16d7692 100755
--- a/tests/mv/acl
+++ b/tests/mv/acl
@@ -28,7 +28,7 @@ fi
 require_acl_
 
 # Skip this test if cp was built without ACL support:
-grep '^#define USE_ACL 0' $CONFIG_HEADER > /dev/null &&
+grep '^#define USE_ACL 1' $CONFIG_HEADER > /dev/null ||
   skip_test_ "insufficient ACL support"
 
 cleanup_() { rm -rf "$other_partition_tmpdir"; }
@@ -46,7 +46,7 @@ setfacl -m user:bin:rw $t1 || skip_partition=$other_partition_tmpdir
 acl1=`getfacl file` || skip_partition=.
 
 test $skip_partition != none &&
-  skip_test_ "'$skip' is not on a suitable file system for this test"
+  skip_test_ "'$skip_partition' is not on a suitable file system for this test"
 
 # move the access acl of a file
 mv file "$other_partition_tmpdir" || fail=1
diff --git a/tests/touch/no-dereference b/tests/touch/no-dereference
index c1a6748..8d80fa5 100755
--- a/tests/touch/no-dereference
+++ b/tests/touch/no-dereference
@@ -43,8 +43,8 @@ touch -h -r dangling file || fail=1
 test -f nowhere && fail=1
 
 # The remaining tests of -h require kernel support for changing symlink times.
-grep '^#define HAVE_UTIMENSAT' "$CONFIG_HEADER" > /dev/null ||
-grep '^#define HAVE_LUTIMES' "$CONFIG_HEADER" > /dev/null ||
+grep '^#define HAVE_UTIMENSAT 1' "$CONFIG_HEADER" > /dev/null ||
+grep '^#define HAVE_LUTIMES 1' "$CONFIG_HEADER" > /dev/null ||
   skip_test_ 'this system lacks the utimensat function'
 
 # Changing time of dangling symlink is okay.
-- 
1.6.2.5

Reply via email to