All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fuego] [PATCH] busybox : add support for command readlink/reset/rm/rmdir/route
@ 2018-07-31  9:06 Wang Mingyu
  2018-07-31  9:06 ` [Fuego] [PATCH] busybox : add support for command sed/sh/sleep/sort/strings/swapoff/swapon/sync Wang Mingyu
  2018-08-18  4:57 ` [Fuego] [PATCH] busybox : add support for command readlink/reset/rm/rmdir/route Tim Bird
  0 siblings, 2 replies; 6+ messages in thread
From: Wang Mingyu @ 2018-07-31  9:06 UTC (permalink / raw)
  To: fuego

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 .../Functional.busybox/tests/busybox_readlink.sh   | 17 +++++++++
 .../Functional.busybox/tests/busybox_reset.sh      | 13 +++++++
 .../tests/Functional.busybox/tests/busybox_rm.sh   | 41 ++++++++++++++++++++++
 .../Functional.busybox/tests/busybox_rmdir.sh      | 24 +++++++++++++
 .../Functional.busybox/tests/busybox_route.sh      | 25 +++++++++++++
 5 files changed, 120 insertions(+)
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_readlink.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_reset.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_rm.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_rmdir.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_route.sh

diff --git a/engine/tests/Functional.busybox/tests/busybox_readlink.sh b/engine/tests/Functional.busybox/tests/busybox_readlink.sh
new file mode 100644
index 0000000..bd34bc8
--- /dev/null
+++ b/engine/tests/Functional.busybox/tests/busybox_readlink.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command readlink
+#  1) Option none
+
+test="readlink"
+
+mkdir test_dir1 test_dir2
+touch test_dir1/test1
+ln -s test_dir1/test1 test_dir2/test2
+if [ "$(busybox readlink test_dir2/test2)" = "test_dir1/test1" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf test_dir1 test_dir2;
diff --git a/engine/tests/Functional.busybox/tests/busybox_reset.sh b/engine/tests/Functional.busybox/tests/busybox_reset.sh
new file mode 100644
index 0000000..6126ed7
--- /dev/null
+++ b/engine/tests/Functional.busybox/tests/busybox_reset.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command reset
+#  1) Option none
+
+test="reset"
+
+if busybox reset 
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
diff --git a/engine/tests/Functional.busybox/tests/busybox_rm.sh b/engine/tests/Functional.busybox/tests/busybox_rm.sh
new file mode 100644
index 0000000..38fd865
--- /dev/null
+++ b/engine/tests/Functional.busybox/tests/busybox_rm.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command rm
+#  1) Option: -r -f
+
+test="rm"
+
+mkdir -p test_dir/test_dir1
+touch test_dir/test1
+ls -l test_dir > log
+if head -n 2 log | head -n 2 | grep "\-rw.*test1" && tail -n 1 log | grep "d.*test_dir1"
+then
+    echo " -> $test: mkdir test_dir verification succeeded."
+else
+    echo " -> $test: mkdir test_dir verification failed."
+    echo " -> $test: TEST-FAIL"
+    rm -rf test_dir
+    rm log
+    exit
+fi;
+
+busybox rm -f test_dir/test1
+if ls -l test_dir | grep "d.*test_dir1"
+then
+    echo " -> &test: rm verification#2 succeeded."
+else
+    echo " -> &test: rm verification#2 failed."
+    echo " -> &test: TEST-FAIL"
+    rm -rf test_dir
+    rm log
+    exit
+fi;
+
+busybox rm -rf test_dir
+if [ "$(ls -l | grep test_dir)" = "" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm log
diff --git a/engine/tests/Functional.busybox/tests/busybox_rmdir.sh b/engine/tests/Functional.busybox/tests/busybox_rmdir.sh
new file mode 100644
index 0000000..857288f
--- /dev/null
+++ b/engine/tests/Functional.busybox/tests/busybox_rmdir.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command rmdir
+#  1) Option none
+
+test="rmdir"
+
+mkdir test_dir
+if ls -l | grep test_dir
+then
+    echo " -> $test: mkdir test_dir verification succeeded."
+else
+    echo " -> $test: mkdir test_dir verification failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi;
+
+busybox rmdir test_dir
+if [ "$(ls -l | grep test_dir)" = "" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
diff --git a/engine/tests/Functional.busybox/tests/busybox_route.sh b/engine/tests/Functional.busybox/tests/busybox_route.sh
new file mode 100644
index 0000000..c3b64b5
--- /dev/null
+++ b/engine/tests/Functional.busybox/tests/busybox_route.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command route
+
+test="route"
+
+busybox route add -net 22.0.0.0 netmask 255.0.0.0 reject
+
+if busybox route | grep 22.0.0.0
+then
+    echo " -> $test: busybox route add succedded."
+else
+    echo " -> $test: busybox route add failed."
+    echo " -> $test: TEST-FAIL"
+fi;
+
+busybox route del -net 22.0.0.0 netmask 255.0.0.0 reject
+
+if ! busybox route | grep 22.0.0.0
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: busybox route del failed."
+    echo " -> $test: TEST-FAIL"
+fi;
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-08-18  4:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31  9:06 [Fuego] [PATCH] busybox : add support for command readlink/reset/rm/rmdir/route Wang Mingyu
2018-07-31  9:06 ` [Fuego] [PATCH] busybox : add support for command sed/sh/sleep/sort/strings/swapoff/swapon/sync Wang Mingyu
2018-08-07  1:11   ` Tim.Bird
2018-08-07  9:41     ` Wang, Mingyu
2018-08-07 12:56       ` Tim.Bird
2018-08-18  4:57 ` [Fuego] [PATCH] busybox : add support for command readlink/reset/rm/rmdir/route Tim Bird

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.