Return-Path: From: Wang Mingyu Date: Fri, 18 May 2018 07:41:13 -0700 Message-ID: <1526654473-99883-1-git-send-email-wangmy@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Fuego] [PATCH] Add test cases for commands of busybox as follows: ash bunzip2 free wget List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org Signed-off-by: Wang Mingyu --- 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@9aRbp6nO3!Qy?Lt?N})6y;1q#Tf-@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@+->N-lKG*f5f$@iR;{K?dkMHRA-)Qk $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