aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-04-06 12:36:10 +0000
committerMike Frysinger <vapier@gentoo.org>2009-04-06 12:36:10 +0000
commit3c7167b508977997bb4ae43f12b34e60e9d3ba91 (patch)
tree8fa9467165daa79ad9f85daf0fd9360b1e8706b0
parentdc4178050a9e150d26fe7041191a5d124fcdf03c (diff)
downloadbusybox-w32-3c7167b508977997bb4ae43f12b34e60e9d3ba91.tar.gz
busybox-w32-3c7167b508977997bb4ae43f12b34e60e9d3ba91.tar.bz2
busybox-w32-3c7167b508977997bb4ae43f12b34e60e9d3ba91.zip
add tests for basic fd open/close/dupe
-rw-r--r--shell/hush_test/hush-misc/exec.right6
-rw-r--r--shell/hush_test/hush-misc/exec.tests30
2 files changed, 36 insertions, 0 deletions
diff --git a/shell/hush_test/hush-misc/exec.right b/shell/hush_test/hush-misc/exec.right
new file mode 100644
index 000000000..a0de6089a
--- /dev/null
+++ b/shell/hush_test/hush-misc/exec.right
@@ -0,0 +1,6 @@
1pass fd out open
2pass fd out dup
3pass fd out close
4pass fd in open
5pass fd in dup
6pass fd in close
diff --git a/shell/hush_test/hush-misc/exec.tests b/shell/hush_test/hush-misc/exec.tests
new file mode 100644
index 000000000..01a7f591c
--- /dev/null
+++ b/shell/hush_test/hush-misc/exec.tests
@@ -0,0 +1,30 @@
1# make sure we have a way of checking these things
2[ ! -e /dev/fd ] && exit 1
3
4[ -e /dev/fd/44 ] && exit 1
5exec 44>/dev/null
6[ -e /dev/fd/44 ] || exit 1
7echo pass fd out open
8
9[ -e /dev/fd/55 ] && exit 1
10exec 55>&44
11[ -e /dev/fd/55 ] || exit 1
12echo pass fd out dup
13
14exec 44>&-
15[ -e /dev/fd/44 ] && exit 1
16echo pass fd out close
17
18[ -e /dev/fd/66 ] && exit 1
19exec 66</dev/null
20[ -e /dev/fd/66 ] || exit 1
21echo pass fd in open
22
23[ -e /dev/fd/77 ] && exit 1
24exec 77<&66
25[ -e /dev/fd/77 ] || exit 1
26echo pass fd in dup
27
28exec 66<&-
29[ -e /dev/fd/66 ] && exit 1
30echo pass fd in close