aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2014-05-27 15:22:00 -0500
committerPeter Seebach <peter.seebach@windriver.com>2014-05-27 15:22:00 -0500
commit3ec77677c251efafc7a719c6b5c0e6e188563332 (patch)
tree8499a265751148f65b9cb1755bf07ac89e1608dc /test
parent2f71a021b725c1aa415439209a89327f0b997d02 (diff)
downloadpseudo-3ec77677c251efafc7a719c6b5c0e6e188563332.tar.gz
pseudo-3ec77677c251efafc7a719c6b5c0e6e188563332.tar.bz2
pseudo-3ec77677c251efafc7a719c6b5c0e6e188563332.zip
add a test for umask and filesystem modes
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-umask.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test-umask.sh b/test/test-umask.sh
new file mode 100755
index 0000000..48cb3b1
--- /dev/null
+++ b/test/test-umask.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+mode() {
+ ls -l "$1" | awk '{ print $1 }'
+}
+
+# Verify normal operation...
+umask 022
+touch a
+umask 0
+touch b
+
+case $(mode a) in
+-rw-r--r--*) ;;
+*) exit 1;;
+esac
+case $(mode b) in
+-rw-rw-rw-*) ;;
+*) exit 1;;
+esac
+
+export PSEUDO_DISABLED=1
+
+case $(mode a) in
+-rw-r--r--*) ;;
+*) exit 1;;
+esac
+case $(mode b) in
+-rw-r--r--*) ;;
+*) exit 1;;
+esac
+