xtests for higher order bits

Finally, re-do the permissions extended tests to include the setuid, setgid, and sticky bits, and rename the last two existing ones to match the others (files with the same names as their permissions).
This commit is contained in:
Benjamin Sago 2017-05-30 15:32:11 +01:00
parent a2901c63cf
commit c4447e35b6
3 changed files with 36 additions and 17 deletions

25
Vagrantfile vendored
View File

@ -274,26 +274,25 @@ Vagrant.configure(2) do |config|
# Awkward permission testcases.
# Differences in the way chmod handles setting setuid and setgid
# when you dont already own the file mean that we need to use sudo
# to change permissions to those.
config.vm.provision :shell, privileged: false, inline: <<-EOF
set -xe
mkdir "#{test_dir}/permissions"
touch "#{test_dir}/permissions/all-permissions"
chmod 777 "#{test_dir}/permissions/all-permissions"
mkdir "#{test_dir}/permissions/forbidden-directory"
chmod 000 "#{test_dir}/permissions/forbidden-directory"
touch -t #{some_date} "#{test_dir}/permissions/forbidden-directory"
sudo chown #{user}:#{user} "#{test_dir}/permissions/forbidden-directory"
touch "#{test_dir}/permissions/no-permissions"
chmod 000 "#{test_dir}/permissions/no-permissions"
mkdir "#{test_dir}/permissions/forbidden-directory"
chmod 000 "#{test_dir}/permissions/forbidden-directory"
for perms in 001 002 004 010 020 040 100 200 400; do
touch "#{test_dir}/permissions/$perms"
chmod $perms "#{test_dir}/permissions/$perms"
for perms in 000 001 002 004 010 020 040 100 200 400 644 755 777 1000 1001 2000 2010 4000 4100 7666 7777; do
touch "#{test_dir}/permissions/$perms"
sudo chown #{user}:#{user} "#{test_dir}/permissions/$perms"
sudo chmod $perms "#{test_dir}/permissions/$perms"
sudo touch -t #{some_date} "#{test_dir}/permissions/$perms"
done
touch -t #{some_date} "#{test_dir}/permissions/"*
sudo chown #{user}:#{user} "#{test_dir}/permissions/"*
EOF

View File

@ -1,5 +1,6 @@
/testcases/permissions/forbidden-directory: Permission denied (os error 13)
Permissions Size User Group Date Modified Name
.--------- 0 cassowary cassowary  1 Jan 12:34 000
.--------x 0 cassowary cassowary  1 Jan 12:34 001
.-------w- 0 cassowary cassowary  1 Jan 12:34 002
.------r-- 0 cassowary cassowary  1 Jan 12:34 004
@ -9,6 +10,15 @@
.--x------ 0 cassowary cassowary  1 Jan 12:34 100
.-w------- 0 cassowary cassowary  1 Jan 12:34 200
.r-------- 0 cassowary cassowary  1 Jan 12:34 400
.rwxrwxrwx 0 cassowary cassowary  1 Jan 12:34 all-permissions
.rw-r--r-- 0 cassowary cassowary  1 Jan 12:34 644
.rwxr-xr-x 0 cassowary cassowary  1 Jan 12:34 755
.rwxrwxrwx 0 cassowary cassowary  1 Jan 12:34 777
.--------T 0 cassowary cassowary  1 Jan 12:34 1000
.--------t 0 cassowary cassowary  1 Jan 12:34 1001
.-----S--- 0 cassowary cassowary  1 Jan 12:34 2000
.-----s--- 0 cassowary cassowary  1 Jan 12:34 2010
.--S------ 0 cassowary cassowary  1 Jan 12:34 4000
.--s------ 0 cassowary cassowary  1 Jan 12:34 4100
.rwSrwSrwT 0 cassowary cassowary  1 Jan 12:34 7666
.rwsrwsrwt 0 cassowary cassowary  1 Jan 12:34 7777
d--------- - cassowary cassowary  1 Jan 12:34 forbidden-directory
.--------- 0 cassowary cassowary  1 Jan 12:34 no-permissions

View File

@ -1,5 +1,6 @@
/testcases/permissions/forbidden-directory: Permission denied (os error 13)
Permissions Size User Group Date Modified Name
.--------- 0 cassowary cassowary  1 Jan 12:34 000
.--------x 0 cassowary cassowary  1 Jan 12:34 001
.-------w- 0 cassowary cassowary  1 Jan 12:34 002
.------r-- 0 cassowary cassowary  1 Jan 12:34 004
@ -9,6 +10,15 @@
.--x------ 0 cassowary cassowary  1 Jan 12:34 100
.-w------- 0 cassowary cassowary  1 Jan 12:34 200
.r-------- 0 cassowary cassowary  1 Jan 12:34 400
.rwxrwxrwx 0 cassowary cassowary  1 Jan 12:34 all-permissions
.rw-r--r-- 0 cassowary cassowary  1 Jan 12:34 644
.rwxr-xr-x 0 cassowary cassowary  1 Jan 12:34 755
.rwxrwxrwx 0 cassowary cassowary  1 Jan 12:34 777
.--------T 0 cassowary cassowary  1 Jan 12:34 1000
.--------t 0 cassowary cassowary  1 Jan 12:34 1001
.-----S--- 0 cassowary cassowary  1 Jan 12:34 2000
.-----s--- 0 cassowary cassowary  1 Jan 12:34 2010
.--S------ 0 cassowary cassowary  1 Jan 12:34 4000
.--s------ 0 cassowary cassowary  1 Jan 12:34 4100
.rwSrwSrwT 0 cassowary cassowary  1 Jan 12:34 7666
.rwsrwsrwt 0 cassowary cassowary  1 Jan 12:34 7777
d--------- - cassowary cassowary  1 Jan 12:34 forbidden-directory
.--------- 0 cassowary cassowary  1 Jan 12:34 no-permissions