tests: Skip PSPP permissions test if permissions don't work as expected.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 16 May 2023 01:36:53 +0000 (18:36 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 16 May 2023 01:36:53 +0000 (18:36 -0700)
If permissions don't work from shell, then we can't expect them to work
from PSPP.

Thanks to Marshall DeBerry for reporting the problem.

tests/data/file.at

index e48fe05a65c95e190c9891a008b8b69f84bfc4b3..4e19bcc464e6f0fb95dcbe95042ae9b5b3698f23 100644 (file)
@@ -39,9 +39,15 @@ AT_CLEANUP
 
 AT_SETUP([Write error - no permission])
 
-mkdir  directory
-touch directory/foobar.sav
-chmod 000 directory
+AT_CHECK([
+    mkdir directory
+    touch directory/foobar.sav
+    chmod 000 directory
+])
+
+# If we can write to the directory, then permissions just don't work
+# properly.  (Perhaps we're running as root.)
+AT_SKIP_IF([: > directory/foo])
 
 AT_DATA([file.sps], [dnl
 DATA LIST NOTABLE/x 1.