aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-03-30 19:58:20 -0400
committerMike Frysinger <vapier@gentoo.org>2009-03-31 01:12:28 -0400
commit02288b2c0fa1b0976359bd8c7d96e84f9d69f0ce (patch)
treeb1143225b7811a6c0f856f1edd767efa1eb07411 /tests
parentlibsandbox: handle more *at functions (diff)
downloadsandbox-02288b2c0fa1b0976359bd8c7d96e84f9d69f0ce.tar.gz
sandbox-02288b2c0fa1b0976359bd8c7d96e84f9d69f0ce.tar.bz2
sandbox-02288b2c0fa1b0976359bd8c7d96e84f9d69f0ce.zip
tests: add basic functionality tests
Make sure many of the functions work in their simplest form: - link - linkat - mkdirat - mkfifo - mkfifoat - mknod - mknodat - rename - renameat - symlink - symlinkat Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am20
-rwxr-xr-xtests/link-1.sh8
-rw-r--r--tests/link.at1
-rwxr-xr-xtests/linkat-1.sh8
-rw-r--r--tests/linkat.at1
-rwxr-xr-xtests/mkdirat-1.sh6
-rw-r--r--tests/mkdirat.at1
-rwxr-xr-xtests/mkfifo-1.sh6
-rw-r--r--tests/mkfifo.at1
-rwxr-xr-xtests/mkfifoat-1.sh6
-rw-r--r--tests/mkfifoat.at1
-rwxr-xr-xtests/mknod-1.sh6
-rw-r--r--tests/mknod.at1
-rwxr-xr-xtests/mknodat-1.sh6
-rw-r--r--tests/mknodat.at1
-rwxr-xr-xtests/rename-1.sh8
-rw-r--r--tests/rename.at1
-rwxr-xr-xtests/renameat-1.sh8
-rw-r--r--tests/renameat.at1
-rwxr-xr-xtests/symlink-1.sh8
-rw-r--r--tests/symlink.at1
-rwxr-xr-xtests/symlinkat-1.sh8
-rw-r--r--tests/symlinkat.at1
-rw-r--r--tests/testsuite.at11
24 files changed, 102 insertions, 18 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c0e3d0e..d75e1e6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -54,24 +54,8 @@ check_PROGRAMS = \
sb_printf_tst
dist_check_SCRIPTS = \
- access-1.sh \
- chmod-1.sh \
- chown-1.sh \
- fchmodat-1.sh \
- fchownat-1.sh \
- fchownat-2.sh \
- lchown-1.sh \
- mkdir-1.sh \
- mkdir-2.sh \
- mkdir-3.sh \
- open-1.sh \
- script-0 \
- script-1.sh \
- script-2.sh \
- script-3.sh \
- script-4.sh \
- script-5.sh \
- script-6.sh
+ $(wildcard *-?.sh) \
+ script-0
sb_printf_tst_CFLAGS = -I$(top_srcdir)/libsbutil -I$(top_srcdir)/libsbutil/include
sb_printf_tst_LDADD = $(top_builddir)/libsbutil/libsbutil.la
diff --git a/tests/link-1.sh b/tests/link-1.sh
new file mode 100755
index 0000000..2fdb415
--- /dev/null
+++ b/tests/link-1.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+touch file
+link-0 0 file link || exit 1
+[ -e file -a -e link ]
diff --git a/tests/link.at b/tests/link.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/link.at
@@ -0,0 +1 @@
+SB_CHECK(1)
diff --git a/tests/linkat-1.sh b/tests/linkat-1.sh
new file mode 100755
index 0000000..d56da9a
--- /dev/null
+++ b/tests/linkat-1.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+touch file
+linkat-0 0 AT_FDCWD file AT_FDCWD link 0 || exit 1
+[ -e file -a -e link ]
diff --git a/tests/linkat.at b/tests/linkat.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/linkat.at
@@ -0,0 +1 @@
+SB_CHECK(1)
diff --git a/tests/mkdirat-1.sh b/tests/mkdirat-1.sh
new file mode 100755
index 0000000..5bf2a70
--- /dev/null
+++ b/tests/mkdirat-1.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+exec mkdirat-0 0 AT_FDCWD dir 0777
diff --git a/tests/mkdirat.at b/tests/mkdirat.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/mkdirat.at
@@ -0,0 +1 @@
+SB_CHECK(1)
diff --git a/tests/mkfifo-1.sh b/tests/mkfifo-1.sh
new file mode 100755
index 0000000..c63127a
--- /dev/null
+++ b/tests/mkfifo-1.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+exec mkfifo-0 0 fifo 0777
diff --git a/tests/mkfifo.at b/tests/mkfifo.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/mkfifo.at
@@ -0,0 +1 @@
+SB_CHECK(1)
diff --git a/tests/mkfifoat-1.sh b/tests/mkfifoat-1.sh
new file mode 100755
index 0000000..80179a0
--- /dev/null
+++ b/tests/mkfifoat-1.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+exec mkfifoat-0 0 AT_FDCWD fifo 0777
diff --git a/tests/mkfifoat.at b/tests/mkfifoat.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/mkfifoat.at
@@ -0,0 +1 @@
+SB_CHECK(1)
diff --git a/tests/mknod-1.sh b/tests/mknod-1.sh
new file mode 100755
index 0000000..c9a5013
--- /dev/null
+++ b/tests/mknod-1.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+exec mknod-0 0 node 0666 0
diff --git a/tests/mknod.at b/tests/mknod.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/mknod.at
@@ -0,0 +1 @@
+SB_CHECK(1)
diff --git a/tests/mknodat-1.sh b/tests/mknodat-1.sh
new file mode 100755
index 0000000..bb299fd
--- /dev/null
+++ b/tests/mknodat-1.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+exec mknodat-0 0 AT_FDCWD node 0666 0
diff --git a/tests/mknodat.at b/tests/mknodat.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/mknodat.at
@@ -0,0 +1 @@
+SB_CHECK(1)
diff --git a/tests/rename-1.sh b/tests/rename-1.sh
new file mode 100755
index 0000000..8404a44
--- /dev/null
+++ b/tests/rename-1.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+touch old
+rename-0 0 old new || exit 1
+[ ! -e old -a -e new ]
diff --git a/tests/rename.at b/tests/rename.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/rename.at
@@ -0,0 +1 @@
+SB_CHECK(1)
diff --git a/tests/renameat-1.sh b/tests/renameat-1.sh
new file mode 100755
index 0000000..5fd933f
--- /dev/null
+++ b/tests/renameat-1.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+touch old
+renameat-0 0 AT_FDCWD old AT_FDCWD new || exit 1
+[ ! -e old -a -e new ]
diff --git a/tests/renameat.at b/tests/renameat.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/renameat.at
@@ -0,0 +1 @@
+SB_CHECK(1)
diff --git a/tests/symlink-1.sh b/tests/symlink-1.sh
new file mode 100755
index 0000000..9a3ba56
--- /dev/null
+++ b/tests/symlink-1.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+touch file
+symlink-0 0 file sym || exit 1
+[ -e file -a -L sym ]
diff --git a/tests/symlink.at b/tests/symlink.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/symlink.at
@@ -0,0 +1 @@
+SB_CHECK(1)
diff --git a/tests/symlinkat-1.sh b/tests/symlinkat-1.sh
new file mode 100755
index 0000000..24a3d99
--- /dev/null
+++ b/tests/symlinkat-1.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# basic functionality check
+
+addwrite $PWD
+
+touch file
+symlinkat-0 0 file AT_FDCWD sym || exit 1
+[ -e file -a -L sym ]
diff --git a/tests/symlinkat.at b/tests/symlinkat.at
new file mode 100644
index 0000000..081d7d2
--- /dev/null
+++ b/tests/symlinkat.at
@@ -0,0 +1 @@
+SB_CHECK(1)
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 99ffd88..cc2247c 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -12,7 +12,18 @@ sb_inc([fchmodat])
sb_inc([fchownat])
sb_inc([lchown])
sb_inc([libsigsegv])
+sb_inc([link])
+sb_inc([linkat])
sb_inc([mkdir])
+sb_inc([mkdirat])
+sb_inc([mkfifo])
+sb_inc([mkfifoat])
+sb_inc([mknod])
+sb_inc([mknodat])
sb_inc([open])
+sb_inc([rename])
+sb_inc([renameat])
sb_inc([sb_printf])
sb_inc([script])
+sb_inc([symlink])
+sb_inc([symlinkat])