aboutsummaryrefslogtreecommitdiffstats
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
parent2f71a021b725c1aa415439209a89327f0b997d02 (diff)
downloadpseudo-3ec77677c251efafc7a719c6b5c0e6e188563332.tar.gz
pseudo-3ec77677c251efafc7a719c6b5c0e6e188563332.tar.bz2
pseudo-3ec77677c251efafc7a719c6b5c0e6e188563332.zip
add a test for umask and filesystem modes
-rw-r--r--ChangeLog.txt1
-rwxr-xr-xtest/test-umask.sh32
2 files changed, 33 insertions, 0 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index cffc2e9..7820e4f 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,6 +1,7 @@
2014-05-27:
* (seebs) start noticing umask, mask it out from open or mkdir
calls rather than relying on underlying open/mkdir to do it.
+ * (seebs) add a test for umask and filesystem-vs-db modes.
2014-05-16:
* (seebs) fchmodat: don't drop flags, report failures, to improve
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
+