summaryrefslogtreecommitdiffhomepage
path: root/shell/hush_test
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-standalone/nofork_env.right9
-rwxr-xr-xshell/hush_test/hush-standalone/nofork_env.tests15
2 files changed, 24 insertions, 0 deletions
diff --git a/shell/hush_test/hush-standalone/nofork_env.right b/shell/hush_test/hush-standalone/nofork_env.right
new file mode 100644
index 000000000..3f16ff458
--- /dev/null
+++ b/shell/hush_test/hush-standalone/nofork_env.right
@@ -0,0 +1,9 @@
+ZVAR=1
+ZVAR=2
+ZVAR=3
+ZVAR=4
+ZVAR=5
+ZVAR=6
+ZVAR=7
+ZVAR=8
+Ok:0
diff --git a/shell/hush_test/hush-standalone/nofork_env.tests b/shell/hush_test/hush-standalone/nofork_env.tests
new file mode 100755
index 000000000..111e564d2
--- /dev/null
+++ b/shell/hush_test/hush-standalone/nofork_env.tests
@@ -0,0 +1,15 @@
+# ash had a bug where NOFORKed applet (env/printenv) was not seeing new exported variables
+
+(export ZVAR=1; printenv) | grep ^ZVAR=
+(ZVAR=2 printenv) | grep ^ZVAR=
+
+(export ZVAR=3; env) | grep ^ZVAR=
+(ZVAR=4 env) | grep ^ZVAR=
+
+export ZVAR=5; printenv | grep ^ZVAR=
+ZVAR=6 printenv | grep ^ZVAR=
+
+export ZVAR=7; env | grep ^ZVAR=
+ZVAR=8 env | grep ^ZVAR=
+
+echo Ok:$?