[Fuego] [PATCH] Add test cases for commands of busybox as follows: ash bunzip2 free wget

Wang Mingyu wangmy at cn.fujitsu.com
Fri May 18 14:41:13 UTC 2018


Signed-off-by: Wang Mingyu <wangmy at cn.fujitsu.com>
---
 engine/tests/Functional.busybox/busybox.tar.gz     | Bin 0 -> 171 bytes
 .../Functional.busybox/testsuits/busybox_ash.sh    |  15 ++++++++++++++
 .../testsuits/busybox_bunzip2.sh                   |  12 +++++++++++
 .../Functional.busybox/testsuits/busybox_free.sh   |  10 ++++++++++
 .../Functional.busybox/testsuits/busybox_wget.sh   |  22 +++++++++++++++++++++
 5 files changed, 59 insertions(+)
 create mode 100644 engine/tests/Functional.busybox/busybox.tar.gz
 create mode 100644 engine/tests/Functional.busybox/testsuits/busybox_ash.sh
 create mode 100644 engine/tests/Functional.busybox/testsuits/busybox_bunzip2.sh
 create mode 100644 engine/tests/Functional.busybox/testsuits/busybox_free.sh
 create mode 100644 engine/tests/Functional.busybox/testsuits/busybox_wget.sh

diff --git a/engine/tests/Functional.busybox/busybox.tar.gz b/engine/tests/Functional.busybox/busybox.tar.gz
new file mode 100644
index 0000000000000000000000000000000000000000..0bdac1768d26a5f9ec1583e93a3632d978808960
GIT binary patch
literal 171
zcmb2|=3qE<@m~}J^V>_-e1{AKS`x3 at 9aRbp6nO3!Qy?Lt?N})6y;1q#Tf- at u3%Udz
z{hy_o)~$I>_v5=mZzr|Q=qn6~Hi*1!vi{7qnck~U?b`G$B=YjLQ&U23PxCsXmK`>2
z#;!=0vx-Z~%jf at +->N-lKG*f5f$@iR;{K?dkMHRA-)Qk<x`ns=mXyLNd#~5dU|YN2
UR+<4B{JY2O#?pI`L4$z-0L$P at YXATM

literal 0
HcmV?d00001

diff --git a/engine/tests/Functional.busybox/testsuits/busybox_ash.sh b/engine/tests/Functional.busybox/testsuits/busybox_ash.sh
new file mode 100644
index 0000000..47cea2d
--- /dev/null
+++ b/engine/tests/Functional.busybox/testsuits/busybox_ash.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+workdir=$(pwd)
+test="ash"
+
+expect <<-EOF
+spawn busybox ash
+expect "*# "
+send_user " -> $test: Opened ash shell succeeded.\n"
+send "busybox pwd\r"
+expect "$workdir"
+send_user " -> $test: Executed pwd command ash shell succeeded.\n"
+send "exit\r"
+send_user " -> $test: Closing ash shell succeeded.\n pass $test\n"
+expect eof
+EOF
diff --git a/engine/tests/Functional.busybox/testsuits/busybox_bunzip2.sh b/engine/tests/Functional.busybox/testsuits/busybox_bunzip2.sh
new file mode 100644
index 0000000..0704b9a
--- /dev/null
+++ b/engine/tests/Functional.busybox/testsuits/busybox_bunzip2.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+test="bunzip2"
+
+echo "This is a test file">test1
+bzip2 test1
+if [ "`busybox bunzip2 -c test1.bz2`" == "This is a test file" ]
+then
+    echo "$test: test cases succeeded.\n pass $test"
+else
+    echo "$test: test cases failed."
+fi;
+rm -rf test1.bz2;
diff --git a/engine/tests/Functional.busybox/testsuits/busybox_free.sh b/engine/tests/Functional.busybox/testsuits/busybox_free.sh
new file mode 100644
index 0000000..4b5b192
--- /dev/null
+++ b/engine/tests/Functional.busybox/testsuits/busybox_free.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+test="free"
+
+busybox free
+if [ `echo $?` == 0 ]
+then
+    echo "$test: test cases succeeded.\n pass $test"
+else
+    echo "$test: test cases failed."
+fi;
diff --git a/engine/tests/Functional.busybox/testsuits/busybox_wget.sh b/engine/tests/Functional.busybox/testsuits/busybox_wget.sh
new file mode 100644
index 0000000..90fa83d
--- /dev/null
+++ b/engine/tests/Functional.busybox/testsuits/busybox_wget.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+test="wget"
+
+if [ -f /home/test/readme.txt ]; then rm -f /home/test/readme.txt ; fi
+busybox wget http://$test_tcpip_host:$test_port_host/$httproot_dir_host -P /home/test
+if ls  /home/test/ | grep ".*readme.*"
+then
+    echo "$test: ls  /home/test/ executed."
+else
+    echo "$test: ls  /home/test/ failed."
+fi;
+if cat /home/test/readme.txt | grep ".*jenkins.*"
+then
+    echo "$test: test cases succeeded.\n pass $test"
+else
+    echo "$test: test cases failed."
+fi;
+rm /home/test/readme.txt
+ls /
+
+
+
-- 
1.8.3.1





More information about the Fuego mailing list