summaryrefslogtreecommitdiff
path: root/tests/touch
diff options
context:
space:
mode:
Diffstat (limited to 'tests/touch')
-rwxr-xr-xtests/touch/60-seconds.sh2
-rwxr-xr-xtests/touch/dangling-symlink.sh2
-rwxr-xr-xtests/touch/empty-file.sh2
-rwxr-xr-xtests/touch/fail-diag.sh2
-rwxr-xr-xtests/touch/fifo.sh2
-rwxr-xr-xtests/touch/no-create-missing.sh8
-rwxr-xr-xtests/touch/no-dereference.sh12
-rwxr-xr-xtests/touch/no-rights.sh2
-rwxr-xr-xtests/touch/not-owner.sh2
-rwxr-xr-xtests/touch/now-owned-by-other.sh9
-rwxr-xr-xtests/touch/obsolescent.sh2
-rwxr-xr-xtests/touch/read-only.sh4
-rwxr-xr-xtests/touch/relative.sh2
-rwxr-xr-xtests/touch/trailing-slash.sh2
14 files changed, 24 insertions, 29 deletions
diff --git a/tests/touch/60-seconds.sh b/tests/touch/60-seconds.sh
index 3f90fbb2..f0d5b89e 100755
--- a/tests/touch/60-seconds.sh
+++ b/tests/touch/60-seconds.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# touch -t would mistakenly reject a time specifying "60" seconds
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/touch/dangling-symlink.sh b/tests/touch/dangling-symlink.sh
index 0d63edba..9adfd4bd 100755
--- a/tests/touch/dangling-symlink.sh
+++ b/tests/touch/dangling-symlink.sh
@@ -2,7 +2,7 @@
# Make sure touch can create a file through a dangling symlink.
# This was broken in the 4.0[e-i] test releases.
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/touch/empty-file.sh b/tests/touch/empty-file.sh
index 6a654839..e6d1b334 100755
--- a/tests/touch/empty-file.sh
+++ b/tests/touch/empty-file.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Make sure touch can set the mtime on an empty file.
-# Copyright (C) 1998-2013 Free Software Foundation, Inc.
+# Copyright (C) 1998-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/touch/fail-diag.sh b/tests/touch/fail-diag.sh
index 0be1b6e5..191ec30c 100755
--- a/tests/touch/fail-diag.sh
+++ b/tests/touch/fail-diag.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure touch gives reasonable diagnostics
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/touch/fifo.sh b/tests/touch/fifo.sh
index a67637f5..71ae7791 100755
--- a/tests/touch/fifo.sh
+++ b/tests/touch/fifo.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Make sure touch works on fifos without hanging.
-# Copyright (C) 2000-2013 Free Software Foundation, Inc.
+# Copyright (C) 2000-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/touch/no-create-missing.sh b/tests/touch/no-create-missing.sh
index fe60282c..7ce63b1b 100755
--- a/tests/touch/no-create-missing.sh
+++ b/tests/touch/no-create-missing.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Ensure that touch -c no-such-file no longer fails (it did in 4.1.8).
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,13 +24,11 @@ touch -c no-file > /dev/null 2>&1 || fail=1
touch -cm no-file > /dev/null 2>&1 || fail=1
touch -ca no-file > /dev/null 2>&1 || fail=1
-test="$abs_top_builddir/src/test"
-
# If >&- works, test "touch -c -" etc.
# >&- apparently does not work in HP-UX 11.23.
# This test is ineffective unless /dev/stdout also works.
-if "$test" -w /dev/stdout >/dev/null &&
- "$test" ! -w /dev/stdout >&-; then
+if env test -w /dev/stdout >/dev/null &&
+ env test ! -w /dev/stdout >&-; then
touch -c - >&- 2> /dev/null || fail=1
touch -cm - >&- 2> /dev/null || fail=1
touch -ca - >&- 2> /dev/null || fail=1
diff --git a/tests/touch/no-dereference.sh b/tests/touch/no-dereference.sh
index c7697782..0f4fdca9 100755
--- a/tests/touch/no-dereference.sh
+++ b/tests/touch/no-dereference.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Ensure that touch -h works.
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ ln -s file link || framework_failure_
touch -h no-file 2> err && fail=1
test -s err || fail=1
touch -h -c no-file 2> err || fail=1
-test -s err && fail=1
+compare /dev/null err || fail=1
# -h works on regular files
touch -h file || fail=1
@@ -49,7 +49,7 @@ grep '^#define HAVE_LUTIMES 1' "$CONFIG_HEADER" > /dev/null ||
touch -h dangling 2> err
case $? in
0) test -f nowhere && fail=1
- test -s err && fail=1;;
+ compare /dev/null err || fail=1;;
1) grep 'Function not implemented' err \
&& skip_ 'this system lacks the utimensat function'
fail=1;;
@@ -69,14 +69,12 @@ esac
# Test interactions with -.
touch -h - > file || fail=1
-test="$abs_top_builddir/src/test"
-
# If >&- works, test "touch -ch -" etc.
# >&- apparently does not work in HP-UX 11.23.
# This test is ineffective unless /dev/stdout also works.
# If stdout is open, it is not a symlink.
-if "$test" -w /dev/stdout >/dev/null &&
- "$test" ! -w /dev/stdout >&-; then
+if env test -w /dev/stdout >/dev/null &&
+ env test ! -w /dev/stdout >&-; then
touch -h - >&- && fail=1
touch -h -c - >&- || fail=1
fi
diff --git a/tests/touch/no-rights.sh b/tests/touch/no-rights.sh
index 135810cb..085c8307 100755
--- a/tests/touch/no-rights.sh
+++ b/tests/touch/no-rights.sh
@@ -2,7 +2,7 @@
# Make sure touch can update the times on a file that is neither
# readable nor writable.
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/touch/not-owner.sh b/tests/touch/not-owner.sh
index a111ef3a..c822f0b5 100755
--- a/tests/touch/not-owner.sh
+++ b/tests/touch/not-owner.sh
@@ -2,7 +2,7 @@
# Make sure that touch gives reasonable diagnostics when applied
# to an unwritable directory owned by some other user.
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/touch/now-owned-by-other.sh b/tests/touch/now-owned-by-other.sh
index 4c88fc94..d01097ed 100755
--- a/tests/touch/now-owned-by-other.sh
+++ b/tests/touch/now-owned-by-other.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Demonstrate that "touch -d now writable-but-owned-by-other" works.
-# Copyright (C) 2008-2013 Free Software Foundation, Inc.
+# Copyright (C) 2008-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,16 +20,15 @@
print_ver_ touch
require_root_
-group_num=$(id -g $NON_ROOT_USERNAME)
-
# Create a file owned by root, and writable by $NON_ROOT_USERNAME.
echo > root-owned || framework_failure_
-chgrp +$group_num . root-owned || framework_failure_
+chgrp +$NON_ROOT_GID . root-owned || framework_failure_
chmod g+w root-owned
# Ensure that the current directory is searchable by $NON_ROOT_USERNAME.
chmod g+x .
-setuidgid $NON_ROOT_USERNAME env PATH="$PATH" touch -d now root-owned || fail=1
+chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
+ touch -d now root-owned || fail=1
Exit $fail
diff --git a/tests/touch/obsolescent.sh b/tests/touch/obsolescent.sh
index 3f1d9b0f..7dd1418b 100755
--- a/tests/touch/obsolescent.sh
+++ b/tests/touch/obsolescent.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Test touch with obsolescent 8- or 10-digit time stamps.
-# Copyright (C) 2000-2013 Free Software Foundation, Inc.
+# Copyright (C) 2000-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/touch/read-only.sh b/tests/touch/read-only.sh
index e9f2bd9f..d2397385 100755
--- a/tests/touch/read-only.sh
+++ b/tests/touch/read-only.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# ensure that touch can operate on read-only files
-# Copyright (C) 2005-2013 Free Software Foundation, Inc.
+# Copyright (C) 2005-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
print_ver_ touch
skip_if_root_
-: > read-only || framework_failure_
+> read-only || framework_failure_
chmod 444 read-only || framework_failure_
diff --git a/tests/touch/relative.sh b/tests/touch/relative.sh
index eeb56853..396c2f11 100755
--- a/tests/touch/relative.sh
+++ b/tests/touch/relative.sh
@@ -2,7 +2,7 @@
# Demonstrate using a combination of --reference and --date to
# set the time of a file back by an arbitrary amount.
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/touch/trailing-slash.sh b/tests/touch/trailing-slash.sh
index 4dbd2776..7e6eb908 100755
--- a/tests/touch/trailing-slash.sh
+++ b/tests/touch/trailing-slash.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Ensure that touch honors trailing slash.
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by