summaryrefslogtreecommitdiff
path: root/tests/setup-document-saver.sh
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-11-07 16:46:58 -0300
committerPerberos <[email protected]>2011-11-07 16:46:58 -0300
commit528c1e5ff51e213936e800fc5a9a25da99c0bdf2 (patch)
tree77f8aa456b09367ba81f04d4562fc935f898a951 /tests/setup-document-saver.sh
downloadpluma-528c1e5ff51e213936e800fc5a9a25da99c0bdf2.tar.bz2
pluma-528c1e5ff51e213936e800fc5a9a25da99c0bdf2.tar.xz
initial
Diffstat (limited to 'tests/setup-document-saver.sh')
-rwxr-xr-xtests/setup-document-saver.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/setup-document-saver.sh b/tests/setup-document-saver.sh
new file mode 100755
index 00000000..4e35d327
--- /dev/null
+++ b/tests/setup-document-saver.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# This script is used to setup some special directory structures, permissions
+# for the saver test
+
+UNOWNED_DIRECTORY="/tmp/gedit-document-saver-unowned"
+UNOWNED_FILE="/tmp/gedit-document-saver-unowned/gedit-document-saver-test.txt"
+
+UNOWNED_GROUP="/tmp/gedit-document-saver-unowned-group.txt"
+
+if [ -f "$UNOWNED_FILE" ]; then
+ sudo rm "$UNOWNED_FILE"
+fi
+
+if [ -d "$UNOWNED_DIRECTORY" ]; then
+ sudo rmdir "$UNOWNED_DIRECTORY"
+fi
+
+mkdir "$UNOWNED_DIRECTORY"
+touch "$UNOWNED_FILE"
+
+sudo chown nobody "$UNOWNED_DIRECTORY"
+
+sudo touch "$UNOWNED_GROUP"
+sudo chgrp root "$UNOWNED_GROUP"
+sudo chmod u+w,g+w,o-rwx "$UNOWNED_GROUP"
+sudo chown $USER "$UNOWNED_GROUP"