X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=tests%2Ftestsuite.at;h=37a4bd6e1a427a31422c12912dff9d223721c75b;hb=cd7bdd4076ca154575bbef85eb2157e59befcfe2;hp=d5c602393be5cc4ddb47985247f3fb544c051a66;hpb=643a8844a578ff146cfe746fe6091d29502b6c40;p=chaz%2Ftar diff --git a/tests/testsuite.at b/tests/testsuite.at index d5c6023..37a4bd6 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -1,23 +1,22 @@ # Process this file with autom4te to create testsuite. -*- Autotest -*- # Test suite for GNU tar. -# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Free Software -# Foundation, Inc. +# Copyright 2004-2008, 2010-2013 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This file is part of GNU tar. + +# GNU tar 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 3, or (at your option) -# any later version. +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. -# This program is distributed in the hope that it will be useful, +# GNU tar 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., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . # We need a recent Autotest. m4_version_prereq([2.52g]) @@ -117,6 +116,65 @@ m4_define([AT_TAR_MKHIER],[ install-sh -d $1 >/dev/null dnl m4_if([$2],,,&& genfile --file [$1]/[$2]) || AT_SKIP_TEST]) +dnl Skip test when utlity does not return expected return value +m4_define([AT_CHECK_UTIL],[ + $1 &> /dev/null + if test "$?" != $2; then + AT_SKIP_TEST + fi +]) + +m4_define([AT_XATTRS_UTILS_PREREQ],[ + file=$( mktemp -p . ) + AT_CHECK_UTIL(setfattr -n user.test -v test $file,0) + AT_CHECK_UTIL(getfattr $file,0) +]) +m4_define([AT_SELINUX_UTILS_PREREQ],[ + file=$( mktemp -p . ) + AT_CHECK_UTIL(restorecon $file, 0) + AT_CHECK_UTIL(chcon -h --user=unconfined_u $file,0) + rm -rf $file +]) +m4_define([AT_ACLS_UTILS_PREREQ],[ + file=$( mktemp -p . ) + AT_CHECK_UTIL(setfacl -m u:$UID:rwx $file,0) + AT_CHECK_UTIL(getfacl $file,0) + rm -rf $file +]) +m4_define([AT_CAPABILITIES_UTILS_PREREQ],[ + file=$( mktemp -p . ) + AT_CHECK_UTIL(setcap "= cap_chown=ei" $file,0) + AT_CHECK_UTIL(getcap $file,0) + rm -rf $file +]) +m4_define([AT_XATTRS_PREREQ],[ + AT_XATTRS_UTILS_PREREQ + file=$( mktemp -p . ) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + AT_SKIP_TEST + fi +]) +m4_define([AT_SELINUX_PREREQ],[ + AT_SELINUX_UTILS_PREREQ + file=$( mktemp -p . ) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + AT_SKIP_TEST + fi +]) +m4_define([AT_ACLS_PREREQ],[ + AT_ACLS_UTILS_PREREQ + file=$( mktemp -p . ) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + AT_SKIP_TEST + fi +]) + m4_include([sparsemvp.at]) AT_INIT @@ -225,6 +283,8 @@ m4_include([lustar01.at]) m4_include([lustar02.at]) m4_include([lustar03.at]) +m4_include([time01.at]) + m4_include([multiv01.at]) m4_include([multiv02.at]) m4_include([multiv03.at]) @@ -275,6 +335,20 @@ m4_include([remfiles03.at]) m4_include([sigpipe.at]) +m4_include([xattr01.at]) +m4_include([xattr02.at]) +m4_include([xattr03.at]) +m4_include([xattr04.at]) +m4_include([xattr05.at]) + +m4_include([acls01.at]) +m4_include([acls02.at]) + +m4_include([selnx01.at]) +m4_include([selacl01.at]) + +m4_include([capabs_raw01.at]) + m4_include([star/gtarfail.at]) m4_include([star/gtarfail2.at])