diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-07-04 17:13:50 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-07-04 17:13:50 +0300 |
commit | 71cd8e3a743046573744123777061b64881bf372 (patch) | |
tree | 82522befe647f4fff186a5630cad0cad33f8ef53 /tests/mkdir | |
parent | c18578632fd3c9e513e613a86ba2b7c4ebee6c45 (diff) | |
download | coreutils-upstream.tar.gz |
Imported Upstream version 8.24upstream/8.24upstream
Diffstat (limited to 'tests/mkdir')
-rwxr-xr-x | tests/mkdir/p-1.sh | 2 | ||||
-rwxr-xr-x | tests/mkdir/p-2.sh | 2 | ||||
-rwxr-xr-x | tests/mkdir/p-3.sh | 5 | ||||
-rwxr-xr-x | tests/mkdir/p-acl.sh | 2 | ||||
-rwxr-xr-x | tests/mkdir/p-slashdot.sh | 2 | ||||
-rwxr-xr-x | tests/mkdir/p-thru-slink.sh | 2 | ||||
-rwxr-xr-x | tests/mkdir/p-v.sh | 2 | ||||
-rwxr-xr-x | tests/mkdir/parents.sh | 4 | ||||
-rwxr-xr-x | tests/mkdir/perm.sh | 4 | ||||
-rwxr-xr-x | tests/mkdir/restorecon.sh | 5 | ||||
-rwxr-xr-x | tests/mkdir/selinux.sh | 2 | ||||
-rwxr-xr-x | tests/mkdir/smack-no-root.sh | 2 | ||||
-rwxr-xr-x | tests/mkdir/smack-root.sh | 2 | ||||
-rwxr-xr-x | tests/mkdir/special-1.sh | 4 | ||||
-rwxr-xr-x | tests/mkdir/t-slash.sh | 2 | ||||
-rwxr-xr-x | tests/mkdir/writable-under-readonly.sh | 2 |
16 files changed, 23 insertions, 21 deletions
diff --git a/tests/mkdir/p-1.sh b/tests/mkdir/p-1.sh index e08fd33d..5ed74dce 100755 --- a/tests/mkdir/p-1.sh +++ b/tests/mkdir/p-1.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test "mkdir -p". -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2015 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/mkdir/p-2.sh b/tests/mkdir/p-2.sh index 874a56af..c13a91fd 100755 --- a/tests/mkdir/p-2.sh +++ b/tests/mkdir/p-2.sh @@ -1,7 +1,7 @@ #!/bin/sh # Just like p-1, but with an absolute path. -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2015 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/mkdir/p-3.sh b/tests/mkdir/p-3.sh index 6d55adee..199e7e1d 100755 --- a/tests/mkdir/p-3.sh +++ b/tests/mkdir/p-3.sh @@ -3,7 +3,7 @@ # causes immediate failure. Also, ensure that we don't create # subsequent, relative command-line arguments in the wrong place. -# Copyright (C) 2005-2014 Free Software Foundation, Inc. +# Copyright (C) 2005-2015 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 @@ -27,7 +27,8 @@ mkdir no-acce2s || framework_failure_ mkdir -p no-acce3s/d || framework_failure_ p=$(pwd) -(cd no-access && chmod 0 . && mkdir -p "$p/a/b" u/v) 2> /dev/null && fail=1 +(cd no-access && chmod 0 . && mkdir -p "$p/a/b" u/v) 2> /dev/null +test $? -eq 1 || fail=1 test -d "$p/a/b" || fail=1 # Same as above, but with a following *absolute* name, it should succeed diff --git a/tests/mkdir/p-acl.sh b/tests/mkdir/p-acl.sh index dd4473a9..a4a29727 100755 --- a/tests/mkdir/p-acl.sh +++ b/tests/mkdir/p-acl.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test "mkdir -p" with default ACLs. -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2015 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/mkdir/p-slashdot.sh b/tests/mkdir/p-slashdot.sh index bbca9ad7..e318547e 100755 --- a/tests/mkdir/p-slashdot.sh +++ b/tests/mkdir/p-slashdot.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure that mkdir -p works with arguments specified with a trailing "/.". -# Copyright (C) 2005-2014 Free Software Foundation, Inc. +# Copyright (C) 2005-2015 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/mkdir/p-thru-slink.sh b/tests/mkdir/p-thru-slink.sh index a884a386..ffa4450b 100755 --- a/tests/mkdir/p-thru-slink.sh +++ b/tests/mkdir/p-thru-slink.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure that mkdir -p foo/bar works when foo is a symbolic link to a directory -# Copyright (C) 2005-2014 Free Software Foundation, Inc. +# Copyright (C) 2005-2015 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/mkdir/p-v.sh b/tests/mkdir/p-v.sh index a6a51cbc..963038f4 100755 --- a/tests/mkdir/p-v.sh +++ b/tests/mkdir/p-v.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test mkdir -pv. -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2015 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/mkdir/parents.sh b/tests/mkdir/parents.sh index 786f08f9..ebdb5271 100755 --- a/tests/mkdir/parents.sh +++ b/tests/mkdir/parents.sh @@ -1,7 +1,7 @@ #!/bin/sh # make sure mkdir's -p options works properly -# Copyright (C) 2000-2014 Free Software Foundation, Inc. +# Copyright (C) 2000-2015 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 @@ -26,7 +26,7 @@ mkdir -m 700 e-dir || framework_failure_ # Make sure 'mkdir -p existing-dir' succeeds # and that 'mkdir existing-dir' fails. mkdir -p e-dir || fail=1 -mkdir e-dir > /dev/null 2>&1 && fail=1 +returns_ 1 mkdir e-dir > /dev/null 2>&1 || fail=1 # Create an existing directory. umask 077 diff --git a/tests/mkdir/perm.sh b/tests/mkdir/perm.sh index bf0f6a8e..ff0a57dc 100755 --- a/tests/mkdir/perm.sh +++ b/tests/mkdir/perm.sh @@ -2,7 +2,7 @@ # Verify that mkdir's '-m MODE' option works properly # with various umask settings. -# Copyright (C) 2000-2014 Free Software Foundation, Inc. +# Copyright (C) 2000-2015 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 @@ -59,7 +59,7 @@ for p in empty -p; do # If we're not using -p, then create the parent manually, # and adjust expectations accordingly. - test x$p = x && \ + test x$p = x && { mkdir -m =,u=rwx parent || fail=1 parent_perms=drwx------ diff --git a/tests/mkdir/restorecon.sh b/tests/mkdir/restorecon.sh index 14a8b899..7d6a671b 100755 --- a/tests/mkdir/restorecon.sh +++ b/tests/mkdir/restorecon.sh @@ -1,7 +1,7 @@ #!/bin/sh # test mkdir, mknod, mkfifo -Z -# Copyright (C) 2013-2014 Free Software Foundation, Inc. +# Copyright (C) 2013-2015 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 @@ -17,7 +17,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src -print_ver_ mkdir +print_ver_ mkdir mknod mkfifo require_selinux_ @@ -38,6 +38,7 @@ if restorecon restored 2>/dev/null; then mkdir -Z single || fail=1 # Run these as separate processes in case global context # set for an arg, impacts on another arg + # TODO: Have the defaultcon() vary over these directories for dir in single_p single_p/existing multi/ple; do mkdir -Zp "$dir" || fail=1 done diff --git a/tests/mkdir/selinux.sh b/tests/mkdir/selinux.sh index 983ceb57..4d3cbce7 100755 --- a/tests/mkdir/selinux.sh +++ b/tests/mkdir/selinux.sh @@ -1,7 +1,7 @@ #!/bin/sh # ensure that an invalid context doesn't cause a segfault -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 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/mkdir/smack-no-root.sh b/tests/mkdir/smack-no-root.sh index 527940b3..fac16ede 100755 --- a/tests/mkdir/smack-no-root.sh +++ b/tests/mkdir/smack-no-root.sh @@ -3,7 +3,7 @@ # Derived from tests/mkdir/selinux.sh. # Ensure that an unsettable SMACK label doesn't cause a segfault. -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2014-2015 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/mkdir/smack-root.sh b/tests/mkdir/smack-root.sh index 8d7ec9b7..772eb60a 100755 --- a/tests/mkdir/smack-root.sh +++ b/tests/mkdir/smack-root.sh @@ -3,7 +3,7 @@ # Derived from tests/mkdir/selinux.sh. # Ensure that SMACK label gets set. -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2014-2015 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/mkdir/special-1.sh b/tests/mkdir/special-1.sh index 8c65a757..a6ba642f 100755 --- a/tests/mkdir/special-1.sh +++ b/tests/mkdir/special-1.sh @@ -1,7 +1,7 @@ #!/bin/sh # verify that mkdir honors special bits in MODE -# Copyright (C) 2000-2014 Free Software Foundation, Inc. +# Copyright (C) 2000-2015 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 @@ -36,7 +36,7 @@ rmdir $tmp || fail=1 tmp2=$tmp/sub # This should fail. -mkdir -m$set_mode_string $tmp2 2> /dev/null && fail=1 +returns_ 1 mkdir -m$set_mode_string $tmp2 2> /dev/null || fail=1 # Now test the --parents option. mkdir --parents -m$set_mode_string $tmp2 || fail=1 diff --git a/tests/mkdir/t-slash.sh b/tests/mkdir/t-slash.sh index d9e8d3eb..e16db501 100755 --- a/tests/mkdir/t-slash.sh +++ b/tests/mkdir/t-slash.sh @@ -2,7 +2,7 @@ # Ensure that mkdir works with arguments specified with and without # a trailing slash. -# Copyright (C) 2000-2014 Free Software Foundation, Inc. +# Copyright (C) 2000-2015 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/mkdir/writable-under-readonly.sh b/tests/mkdir/writable-under-readonly.sh index e7c4a9ca..c2f81c5a 100755 --- a/tests/mkdir/writable-under-readonly.sh +++ b/tests/mkdir/writable-under-readonly.sh @@ -1,7 +1,7 @@ #!/bin/sh # FIXME: convert this to a root-only test. -# Copyright (C) 2005-2014 Free Software Foundation, Inc. +# Copyright (C) 2005-2015 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 |