diff options
author | Denys Vlasenko | 2016-10-02 17:55:51 +0200 |
---|---|---|
committer | Denys Vlasenko | 2016-10-02 17:55:51 +0200 |
commit | c4cf542c575068d55368e771abf6c358bfebf5d3 (patch) | |
tree | b916ff4bea0671437b80257fa82283ad8e09faab /shell/hush_test/hush-redir/redir1.tests | |
parent | 1b73f8471a3694d2e6b035bb7f04e1f4df943f03 (diff) | |
download | busybox-c4cf542c575068d55368e771abf6c358bfebf5d3.zip busybox-c4cf542c575068d55368e771abf6c358bfebf5d3.tar.gz |
sh testsuite: create hush-redir/* and move files around
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test/hush-redir/redir1.tests')
-rwxr-xr-x | shell/hush_test/hush-redir/redir1.tests | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/shell/hush_test/hush-redir/redir1.tests b/shell/hush_test/hush-redir/redir1.tests new file mode 100755 index 0000000..ef2fbfb --- /dev/null +++ b/shell/hush_test/hush-redir/redir1.tests @@ -0,0 +1,40 @@ +rm shell_test_$$ 2>/dev/null +var=bad +>shell_test_$$ var=ok +echo "Test 0: var:$var" +test -f shell_test_$$ && echo "File created:ok" + +rm shell_test_$$ 2>/dev/null +var=bad +var=ok >shell_test_$$ +echo "Test 1: var:$var" +test -f shell_test_$$ && echo "File created:ok" + +rm shell_test_$$ 2>/dev/null +var=ok +true | var=bad >shell_test_$$ +echo "Test 2: var:$var" +test -f shell_test_$$ && echo "File created:ok" + +rm shell_test_$$ 2>/dev/null +var=bad +{ var=ok >shell_test_$$; } +echo "Test 3: var:$var" +test -f shell_test_$$ && echo "File created:ok" + +rm shell_test_$$ 2>/dev/null +var=ok +{ var=bad >shell_test_$$; } & +# cant use usleep as it isnt standard in $PATH -- +# we fail when testing busybox compiled solely as "hush" +wait +echo "Test 4: var:$var" +test -f shell_test_$$ && echo "File created:ok" + +rm shell_test_$$ 2>/dev/null +var=ok +( var=bad >shell_test_$$ ) +echo "Test 5: var:$var" +test -f shell_test_$$ && echo "File created:ok" + +rm shell_test_$$ 2>/dev/null |