summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-01-10 10:07:41 -0500
committerAndreas Gruenbacher <agruen@linbit.com>2014-01-13 13:18:39 +0100
commitc8f23c92177c5a82ab3699b1b0d4acbee9afb770 (patch)
tree72b6c7cf7a006babd2177055d8c61d1f6bd15375 /test
parent2d13383b7fbcc04fc16681caa4f43d9d9083cca1 (diff)
downloadacl-c8f23c92177c5a82ab3699b1b0d4acbee9afb770.tar.gz
modernize build system
This deletes the hand rolled build system and replaces it entirely with autotools. The overall diffstat shows that this is a clear win, and it makes the package build/install like every other autotool package out there which makes the lives of distro maintainers a lot easier. This should also be faster by virtue of using a non-recursive build. Things to note: - to generate autotools: ./autogen.sh - to see full compile output: make V=1 - to build specific targets: make attr getfattr ... - to run tests: make check - to create a release: make distcheck -j Other non-developer things: - man pages are no longer compressed as this is uncommon in the autotools world and distros don't need it anyways (they already handle it automatically for most pakages) - the minor # of the shared library is now based on the package version so it'll be much bigger ... this isn't a problem, and is actually a bugfix (older releases didn't change when they should have) (Again, this is all using the standard autotool targets.)
Diffstat (limited to 'test')
-rw-r--r--test/.gitignore1
-rw-r--r--test/Makefile50
-rw-r--r--test/Makemodule.am27
-rw-r--r--test/root/getfacl.test4
-rw-r--r--test/root/permissions.test3
-rw-r--r--test/root/restore.test4
-rw-r--r--test/root/setfacl.test4
-rwxr-xr-xtest/run8
8 files changed, 49 insertions, 52 deletions
diff --git a/test/.gitignore b/test/.gitignore
new file mode 100644
index 0000000..e6e5019
--- /dev/null
+++ b/test/.gitignore
@@ -0,0 +1 @@
+*.dir/
diff --git a/test/Makefile b/test/Makefile
deleted file mode 100644
index d2baac8..0000000
--- a/test/Makefile
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
-#
-# 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
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-
-TOPDIR = ..
-include $(TOPDIR)/include/builddefs
-
-TESTS = $(wildcard *.test)
-ROOT = $(wildcard root/*.test)
-NFS = $(wildcard nfs/*.test)
-LSRCFILES = sort-getfacl-output run make-tree $(TESTS) $(ROOT) $(NFS) \
- malformed-restore-double-owner.acl
-
-include $(BUILDRULES)
-
-default install install-dev install-lib:
-
-PATH := $(abspath ../getfacl/):$(abspath ../setfacl/):$(abspath ../chacl/):$(PATH)
-
-tests: $(TESTS)
-root-tests: $(ROOT)
-nfs-tests: $(NFS)
-
-$(TESTS):
- @echo "*** $@ ***"; perl run $@
-
-$(NFS):
- @echo "NFS specific tests"; echo "*** $@ ***"; perl run $@
-
-$(ROOT):
- @echo "Note: Tests must run as root"; echo "*** $@ ***"; perl run $@
-
-.PHONY: $(TESTS) $(NFS) $(ROOT)
-.NOTPARALLEL:
-
-
diff --git a/test/Makemodule.am b/test/Makemodule.am
new file mode 100644
index 0000000..7b8dafe
--- /dev/null
+++ b/test/Makemodule.am
@@ -0,0 +1,27 @@
+XFAIL_TESTS = \
+ test/nfs/nfsacl.test \
+ test/nfs/nfs-dir.test
+TESTS = \
+ test/cp.test \
+ test/getfacl-noacl.test \
+ test/getfacl-recursive.test \
+ test/malformed-restore.test \
+ test/misc.test \
+ test/sbits-restore.test \
+ test/setfacl-X.test \
+ test/utf8-filenames.test \
+ test/root/getfacl.test \
+ test/root/permissions.test \
+ test/root/restore.test \
+ test/root/setfacl.test \
+ $(XFAIL_TESTS)
+
+EXTRA_DIST += \
+ test/make-tree \
+ test/malformed-restore-double-owner.acl \
+ test/run \
+ test/sort-getfacl-output \
+ $(TESTS)
+
+AM_TESTS_ENVIRONMENT = PATH="$(abs_top_builddir):$$PATH";
+TEST_LOG_COMPILER = $(srcdir)/test/run
diff --git a/test/root/getfacl.test b/test/root/getfacl.test
index f84e25d..649ebae 100644
--- a/test/root/getfacl.test
+++ b/test/root/getfacl.test
@@ -1,6 +1,10 @@
Make sure that getfacl always adds at least one space between the permissions
in an acl entry and the effective permissions comment.
+Cry immediately if we are not running as root.
+
+ $ require_root
+
$ umask 022
$ mkdir d
$ groupadd loooooooooooooooooooooooonggroup
diff --git a/test/root/permissions.test b/test/root/permissions.test
index afaf5f0..9b9e3de 100644
--- a/test/root/permissions.test
+++ b/test/root/permissions.test
@@ -9,8 +9,7 @@ listed in parentheses.
Cry immediately if we are not running as root.
- $ id -u
- > 0
+ $ require_root
First, set up a temporary directory and create a regular file with
diff --git a/test/root/restore.test b/test/root/restore.test
index 6003cd4..63a9d01 100644
--- a/test/root/restore.test
+++ b/test/root/restore.test
@@ -1,6 +1,10 @@
Ensure setuid bit is restored when the owner changes
https://bugzilla.redhat.com/show_bug.cgi?id=467936#c7
+Cry immediately if we are not running as root.
+
+ $ require_root
+
$ touch passwd
$ chmod 755 passwd
$ chmod u+s passwd
diff --git a/test/root/setfacl.test b/test/root/setfacl.test
index 630e9fb..a46a9f4 100644
--- a/test/root/setfacl.test
+++ b/test/root/setfacl.test
@@ -1,5 +1,9 @@
Setfacl utility tests. Run these tests on a filesystem with ACL support.
+Cry immediately if we are not running as root.
+
+ $ require_root
+
$ mkdir d
$ chown bin:bin d
$ cd d
diff --git a/test/run b/test/run
index 0a12be6..fcbcf29 100755
--- a/test/run
+++ b/test/run
@@ -268,6 +268,14 @@ sub exec_test($$) {
return su($prog->[1]);
} elsif ($prog->[0] eq "sg") {
return sg($prog->[1]);
+ } elsif ($prog->[0] eq "require_root") {
+ my $ret = su("root");
+ if ($! != 0) {
+ print $ret->[0];
+ warn "required root failed; skipping test";
+ exit 77;
+ }
+ return [];
} elsif ($prog->[0] eq "export") {
my ($name, $value) = split /=/, $prog->[1];
# FIXME: need to evaluate $value, so that things like this will work: