aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-08-16 09:18:22 -0400
committerMike Frysinger <vapier@gentoo.org>2010-08-16 09:18:22 -0400
commit9d6dbcda73a1135fdec9906206ebb463445145a8 (patch)
tree584484115658caeaf6d17d900455a62d52c8d01f
parenttests: re-order set -x in SB_RUN (diff)
downloadsandbox-9d6dbcda73a1135fdec9906206ebb463445145a8.tar.gz
sandbox-9d6dbcda73a1135fdec9906206ebb463445145a8.tar.bz2
sandbox-9d6dbcda73a1135fdec9906206ebb463445145a8.zip
tests: check rmdir functionality
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--tests/Makefile.am1
-rwxr-xr-xtests/rmdir-1.sh8
-rwxr-xr-xtests/rmdir-2.sh14
-rw-r--r--tests/rmdir.at2
-rw-r--r--tests/testsuite.at1
5 files changed, 26 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 46728ba..bfa5a54 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -46,6 +46,7 @@ check_PROGRAMS = \
remove-0 \
rename-0 \
renameat-0 \
+ rmdir-0 \
signal_static-0 \
symlink-0 \
symlinkat-0 \
diff --git a/tests/rmdir-1.sh b/tests/rmdir-1.sh
new file mode 100755
index 0000000..5decf7a
--- /dev/null
+++ b/tests/rmdir-1.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+mkdir a || exit 1
+rmdir-0 0 a || exit 1
+[ ! -e a ]
diff --git a/tests/rmdir-2.sh b/tests/rmdir-2.sh
new file mode 100755
index 0000000..7cb4717
--- /dev/null
+++ b/tests/rmdir-2.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+# make sure symlinks don't fail
+
+export SANDBOX_LOG=$PWD/sb.log
+
+addwrite $PWD
+
+mkdir reject || exit 1
+adddeny $PWD/reject
+
+ln -s reject foo || exit 1
+rmdir-0 -1,ENOTDIR foo || exit 1
+[ -e foo ] || exit 1
+! test -e sb.log
diff --git a/tests/rmdir.at b/tests/rmdir.at
new file mode 100644
index 0000000..d364b4b
--- /dev/null
+++ b/tests/rmdir.at
@@ -0,0 +1,2 @@
+SB_CHECK(1)
+SB_CHECK(2)
diff --git a/tests/testsuite.at b/tests/testsuite.at
index ca0f09c..7d00504 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -29,6 +29,7 @@ sb_inc([openat_static])
sb_inc([remove])
sb_inc([rename])
sb_inc([renameat])
+sb_inc([rmdir])
sb_inc([sb_printf])
sb_inc([script])
sb_inc([signal_static])