Added new permanent permissions tests.
This commit is contained in:
		@@ -20,4 +20,4 @@ else
 | 
				
			|||||||
  fi
 | 
					  fi
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exit -1 # TODO: call actual zenity here
 | 
					exit 255 # TODO: call actual zenity here
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# clean what was left from previous tests
 | 
					# clean what was left from previous tests
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rm -f ./.pt.db
 | 
				
			||||||
rm -rf ./protected
 | 
					rm -rf ./protected
 | 
				
			||||||
mkdir protected
 | 
					mkdir protected
 | 
				
			||||||
touch ./protected/do-not-remove ./protected/should-be-removed ./protected/truth ./protected/perm000 ./protected/perm777 ./protected/should-be-renamed ./protected/do-not-rename
 | 
					touch ./protected/do-not-remove ./protected/should-be-removed ./protected/truth ./protected/perm000 ./protected/perm777 ./protected/should-be-renamed ./protected/do-not-rename
 | 
				
			||||||
@@ -17,7 +18,7 @@ PATH="$(realpath ./mock/):$PATH"
 | 
				
			|||||||
echo "Run $(date -u +%Y-%m-%dT%H:%M:%S) "
 | 
					echo "Run $(date -u +%Y-%m-%dT%H:%M:%S) "
 | 
				
			||||||
valgrind -s ../build/icfs -o default_permissions ./protected &
 | 
					valgrind -s ../build/icfs -o default_permissions ./protected &
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sleep 1
 | 
					sleep 5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# create files
 | 
					# create files
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -89,6 +90,18 @@ chmod 000 ./protected/perm000 2>/dev/null &&
 | 
				
			|||||||
  echo "[ICFS-TEST]: OK" ||
 | 
					  echo "[ICFS-TEST]: OK" ||
 | 
				
			||||||
  echo "[ICFS-TEST]: chmod cannot change permissions of protected/perm000 despite access being permitted!" # OK
 | 
					  echo "[ICFS-TEST]: chmod cannot change permissions of protected/perm000 despite access being permitted!" # OK
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# create files with permanent permissions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					zenity --set-fake-response yes
 | 
				
			||||||
 | 
					touch ./protected/friendly 2>/dev/null &&
 | 
				
			||||||
 | 
					  echo "[ICFS-TEST]: OK" ||
 | 
				
			||||||
 | 
					  echo "[ICFS-TEST]: touch cannot create protected/friendly despite access being permitted!" # OK
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					zenity --set-fake-response no # this should be ignored
 | 
				
			||||||
 | 
					touch ./protected/friendly-again 2>/dev/null &&
 | 
				
			||||||
 | 
					  echo "[ICFS-TEST]: OK" ||
 | 
				
			||||||
 | 
					  echo "[ICFS-TEST]: touch cannot create protected/friendly-again despite access being permitted!" # OK
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# unmount
 | 
					# unmount
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sleep 0.5
 | 
					sleep 0.5
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user