Skip to contentSkip to conversation

Add command basename, busybox and bzcat to the testset.

PATCH In review Wang Mingyu 2 participants 8 messages Jun 8, 2018 – Jun 11, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add command basename, busybox and bzcat to the testset.

---
 .../tests/Functional.busybox/tests/busybox_basename.sh   | 13 +++++++++++++
 engine/tests/Functional.busybox/tests/busybox_busybox.sh | 13 +++++++++++++
 engine/tests/Functional.busybox/tests/busybox_bzcat.sh   | 16 ++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_basename.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_busybox.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_bzcat.sh
engine/tests/Functional.busybox/tests/busybox_basename.sh new file +13 -0
new file mode 100644
index 0000000..78fc3c6
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command basename
+#  1) Option none
+
+test="basename"
+
+if [ $(busybox basename ./test_dir/test1) = "test1" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_busybox.sh new file +13 -0
new file mode 100644
index 0000000..d29ea13
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command busybox
+#  1) Option none
+
+test="busybox"
+
+if busybox | grep ^BusyBox 
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_bzcat.sh new file +16 -0
new file mode 100644
index 0000000..0531d19
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command bzcat
+#  1) Option none
+
+test="bzcat"
+
+echo "This is a test file">test1
+bzip2 test1
+if [ "$(busybox bzcat test1.bz2)" = "This is a test file" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf test1.bz2;
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 Add command echo, egrep, env and expr to the testset.

---
 .../tests/Functional.busybox/tests/busybox_echo.sh | 13 +++++++
 .../Functional.busybox/tests/busybox_egrep.sh      | 28 +++++++++++++++
 .../tests/Functional.busybox/tests/busybox_env.sh  | 42 ++++++++++++++++++++++
 .../tests/Functional.busybox/tests/busybox_expr.sh | 13 +++++++
 4 files changed, 96 insertions(+)
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_echo.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_egrep.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_env.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_expr.sh
engine/tests/Functional.busybox/tests/busybox_echo.sh new file +13 -0
new file mode 100644
index 0000000..c29ed2f
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command echo
+#  1) Option none
+
+test="echo"
+
+if [ "$(busybox echo "hello world")" = "hello world" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_egrep.sh new file +28 -0
new file mode 100644
index 0000000..9b4e8a4
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command egrep
+#  1) Option: -i
+
+test="egrep"
+
+echo -e "test file\nextended grep\nExtended Grep" >test1
+busybox egrep 'test|extended' ./test1 > log1
+if [ "$(head -n 1 log1)" = "test file" ] && [ "$(tail -n 1 log1)" = "extended grep" ]
+then
+    echo " -> $test: Egrep output verification#1 succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm log1
+    rm -rf test1
+    exit
+fi;
+
+busybox egrep -i 'test|extended' ./test1 > log2
+if [ "$(head -n 1 log2)" = "test file" ] && [ "$(head -n 2 log2 | tail -n 1)" = "extended grep" ] &&  [ "$(tail -n 1 log2)" = "Extended Grep" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm log1 log2;
+rm -rf test1;
engine/tests/Functional.busybox/tests/busybox_env.sh new file +42 -0

42 lines not on this page · raw message

engine/tests/Functional.busybox/tests/busybox_expr.sh new file +13 -0
new file mode 100644
index 0000000..fa07462
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command expr
+#  1) Option none
+
+test="expr"
+
+if busybox expr 3 \< 5 == 1 && busybox expr 3 \< 2 = 0 && busybox expr length "HELLO WORLD" = 11
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 1/1 Add command date , dd, deallocvt, df, dirname, dmesg and du to the testset.

In reply to Wang Mingyu
---
 .../tests/Functional.busybox/tests/busybox_date.sh | 14 ++++++++++
 .../tests/Functional.busybox/tests/busybox_dd.sh   | 30 ++++++++++++++++++++++
 .../Functional.busybox/tests/busybox_deallocvt.sh  | 16 ++++++++++++
 .../tests/Functional.busybox/tests/busybox_df.sh   | 13 ++++++++++
 .../Functional.busybox/tests/busybox_dirname.sh    | 13 ++++++++++
 .../Functional.busybox/tests/busybox_dmesg.sh      | 13 ++++++++++
 .../tests/Functional.busybox/tests/busybox_du.sh   | 17 ++++++++++++
 7 files changed, 116 insertions(+)
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_date.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_dd.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_deallocvt.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_df.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_dirname.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_dmesg.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_du.sh
engine/tests/Functional.busybox/tests/busybox_date.sh new file +14 -0
new file mode 100644
index 0000000..412890e
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command date
+#  1) Option none
+
+test="date"
+
+TZ="UTC" 
+if busybox date -d "@1" | grep "Thu Jan  1 00:00:01 UTC 1970"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_dd.sh new file +30 -0
new file mode 100644
index 0000000..2aa89b4
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command dd
+#  1) Option none
+
+test="dd"
+
+echo "hello world" > test1
+touch test2
+busybox dd if=test1 of=test2 2>>log
+
+if  tail -n 1 log | grep "0+1\ records\ out" && head -n 1 log | grep "0+1\ records\ in"
+then
+    echo " -> $test: grep succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -fr test1 test2
+    rm log
+    exit
+fi;
+
+if [ "$(busybox more test2)" = "hello world" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+
+rm -fr test1 test2;
+rm log;
engine/tests/Functional.busybox/tests/busybox_deallocvt.sh new file +16 -0
new file mode 100644
index 0000000..88941cc
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command deallocvt
+#  1) Option none
+
+test="deallocvt"
+
+openvt -f -c 4 ls
+sleep 1
+busybox deallocvt 4
+if [ $? = 0 ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_df.sh new file +13 -0
new file mode 100644
index 0000000..5eff7ca
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command df
+#  1) Option none
+
+test="df"
+
+if busybox df | head -n 1 | grep 1K-blocks 
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_dirname.sh new file +13 -0
new file mode 100644
index 0000000..a3b6d2c
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command dirname
+#  1) Option none
+
+test="dirname"
+
+if [ "$(busybox dirname ./test_dir/test1)" = "./test_dir" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_dmesg.sh new file +13 -0
new file mode 100644
index 0000000..fdf0546
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command dmesg
+#  1) Option none
+
+test="dmesg"
+
+if busybox dmesg | grep "Linux version" 
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_du.sh new file +17 -0
new file mode 100644
index 0000000..332322c
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command du
+#  1) Option: -k
+
+test="du"
+
+mkdir test_dir
+touch ./test_dir/test1
+touch ./test_dir/test2
+if busybox du -k test_dir | grep "0.*test_dir"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf test_dir;
Signature · 1 line
1.8.3.1
#3 lore raw

Re: [Fuego] [PATCH] Add command date , dd, deallocvt, df, dirname, dmesg and du to the testset.

This one also had some trailing whitespace issues.

Please check these scripts with:
grep " $" *

in the tests directory, and make sure no line have trailing whitespace before making patches.

Applied with whitespace fixes.
-- Tim

Quoted 206 lines

-----Original Message-----
From: [email protected] [mailto:fuego- [email protected]] On Behalf Of Wang Mingyu
Sent: Friday, June 08, 2018 8:15 AM
To: [email protected]
Subject: [Fuego] [PATCH] Add command date , dd, deallocvt, df, dirname, dmesg and du to the testset.

---
 .../tests/Functional.busybox/tests/busybox_date.sh | 14 ++++++++++
 .../tests/Functional.busybox/tests/busybox_dd.sh   | 30
++++++++++++++++++++++
 .../Functional.busybox/tests/busybox_deallocvt.sh  | 16 ++++++++++++
 .../tests/Functional.busybox/tests/busybox_df.sh   | 13 ++++++++++
 .../Functional.busybox/tests/busybox_dirname.sh    | 13 ++++++++++
 .../Functional.busybox/tests/busybox_dmesg.sh      | 13 ++++++++++
 .../tests/Functional.busybox/tests/busybox_du.sh   | 17 ++++++++++++
 7 files changed, 116 insertions(+)
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_date.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_dd.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_deallocvt.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_df.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_dirname.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_dmesg.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_du.sh
engine/tests/Functional.busybox/tests/busybox_date.sh new file +14 -0
new file mode 100644
index 0000000..412890e
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command date
+#  1) Option none
+
+test="date"
+
+TZ="UTC"
+if busybox date -d "@1" | grep "Thu Jan  1 00:00:01 UTC 1970"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_dd.sh new file +12 -0
new file mode 100644
index 0000000..2aa89b4
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command dd
+#  1) Option none
+
+test="dd"
+
+echo "hello world" > test1
+touch test2
+busybox dd if=test1 of=test2 2>>log
+
+if  tail -n 1 log | grep "0+1\ records\ out" && head -n 1 log | grep "0+1\

records\ in"

engine/tests/Functional.busybox/tests/busybox_dd.sh new file +18 -0
+then
+    echo " -> $test: grep succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -fr test1 test2
+    rm log
+    exit
+fi;
+
+if [ "$(busybox more test2)" = "hello world" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+
+rm -fr test1 test2;
+rm log;
engine/tests/Functional.busybox/tests/busybox_deallocvt.sh new file +16 -0
new file mode 100644
index 0000000..88941cc
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command deallocvt
+#  1) Option none
+
+test="deallocvt"
+
+openvt -f -c 4 ls
+sleep 1
+busybox deallocvt 4
+if [ $? = 0 ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_df.sh new file +13 -0
new file mode 100644
index 0000000..5eff7ca
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command df
+#  1) Option none
+
+test="df"
+
+if busybox df | head -n 1 | grep 1K-blocks
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_dirname.sh new file +13 -0
new file mode 100644
index 0000000..a3b6d2c
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command dirname
+#  1) Option none
+
+test="dirname"
+
+if [ "$(busybox dirname ./test_dir/test1)" = "./test_dir" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_dmesg.sh new file +13 -0
new file mode 100644
index 0000000..fdf0546
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command dmesg
+#  1) Option none
+
+test="dmesg"
+
+if busybox dmesg | grep "Linux version"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_du.sh new file +17 -1
new file mode 100644
index 0000000..332322c
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command du
+#  1) Option: -k
+
+test="du"
+
+mkdir test_dir
+touch ./test_dir/test1
+touch ./test_dir/test2
+if busybox du -k test_dir | grep "0.*test_dir"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf test_dir;
--

1.8.3.1

_______________________________________________
Fuego mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/fuego

#4 lore raw

PATCH 1/1 Add new test cases to testset as follows: cat chgrp chmod chown chroot chvt clear cmp cp cut

In reply to Wang Mingyu
---
 .../tests/Functional.busybox/tests/busybox_cat.sh  | 16 +++++++
 .../Functional.busybox/tests/busybox_chgrp1.sh     | 27 ++++++++++++
 .../Functional.busybox/tests/busybox_chgrp2.sh     | 32 ++++++++++++++
 .../Functional.busybox/tests/busybox_chmod1.sh     | 49 ++++++++++++++++++++++
 .../Functional.busybox/tests/busybox_chmod2.sh     | 32 ++++++++++++++
 .../Functional.busybox/tests/busybox_chown1.sh     | 34 +++++++++++++++
 .../Functional.busybox/tests/busybox_chown2.sh     | 43 +++++++++++++++++++
 .../Functional.busybox/tests/busybox_chroot.sh     | 34 +++++++++++++++
 .../tests/Functional.busybox/tests/busybox_chvt.sh | 22 ++++++++++
 .../Functional.busybox/tests/busybox_clear.sh      | 14 +++++++
 .../tests/Functional.busybox/tests/busybox_cmp.sh  | 37 ++++++++++++++++
 .../tests/Functional.busybox/tests/busybox_cp.sh   | 35 ++++++++++++++++
 .../tests/Functional.busybox/tests/busybox_cut.sh  | 13 ++++++
 13 files changed, 388 insertions(+)
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_cat.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_chgrp1.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_chgrp2.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_chmod1.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_chmod2.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_chown1.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_chown2.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_chroot.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_chvt.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_clear.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_cmp.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_cp.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_cut.sh
engine/tests/Functional.busybox/tests/busybox_cat.sh new file +16 -0
new file mode 100644
index 0000000..424528d
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command cat
+#  1) Option none
+
+test="cat"
+
+echo "hello" > test1
+echo "world" > test2
+if [ "$(busybox cat test1 test2 | head -n 1)" = "hello" ] && [ "$(busybox cat test1 test2 | tail -n 1)" = "world" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf test1 test2;
engine/tests/Functional.busybox/tests/busybox_chgrp1.sh new file +27 -0
new file mode 100644
index 0000000..8c7fcf6
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chgrp
+#  1) Option: none
+
+test="chgrp1"
+
+mkdir test_dir
+touch test_dir/test1
+group=$(id -n -g | cut -b -8)
+if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f4 | cut -b -8)" = "$group" ]
+then
+    echo " -> $test: Group info display succedded."
+else
+    echo " -> $test: FAIL"
+    rm -rf test_dir
+    exit
+fi;
+
+if [ "$(chgrp bin ./test_dir/test1; busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f4 | cut -b -8)" = "bin" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf test_dir
+
engine/tests/Functional.busybox/tests/busybox_chgrp2.sh new file +32 -0
new file mode 100644
index 0000000..fc7073b
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chgrp
+#  1) Option: -R
+
+test="chgrp2"
+
+mkdir test_dir
+touch test_dir/test1
+touch test_dir/test2
+group=$(id -n -g | cut -b -8)
+busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f4 | cut -b -8 > log1
+if [ "$(head -n 1 log1)" = "$group" ] && [  "$(tail -n 1 log1)" = "$group" ]
+then
+    echo " -> $test: Group info display succedded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm log1
+    rm -rf test_dir
+    exit
+fi
+
+busybox chgrp -R bin ./test_dir
+busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f4 | cut -b -8 > log2
+if [ "$(head -n 1 log2)" = "bin" ] && [ "$(tail -n 1 log2)" = "bin" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+rm log1 log2
+rm -rf test_dir
engine/tests/Functional.busybox/tests/busybox_chmod1.sh new file +49 -0

49 lines not on this page · raw message

engine/tests/Functional.busybox/tests/busybox_chmod2.sh new file +32 -0
new file mode 100644
index 0000000..ca48f79
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chmod
+#  1) Option: -R
+
+test="chmod2"
+
+mkdir test_dir
+touch test_dir/test1
+touch test_dir/test2
+busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,9 > log1
+
+if [ "$(head -n 1 log1 | cut -b 12-16)" = "test1" ] && [ "$(tail -n 1 log1 | cut -b 12-16)" = "test2" ]
+then
+    echo " -> $test: test_dir contents verification succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf ./test_dir;
+    rm log1;
+    exit
+fi;
+
+busybox chmod -R a-r ./test_dir
+busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,9 > log2
+if [ "$(head -n 1 log2 | cut -b 1,2,5,8,12-16)" = "----test1" ] && [ "$(tail -n 1 log2 | cut -b 1,2,5,8,12-16)" = "----test2" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm log1 log2;
+rm -rf ./test_dir;
engine/tests/Functional.busybox/tests/busybox_chown1.sh new file +34 -0
new file mode 100644
index 0000000..8d17a72
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chown
+#  1) Option none
+
+test="chown1"
+
+mkdir test_dir
+touch test_dir/test1
+if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,3,4,9 | cut -b 12-26)" = "root root test1" ] 
+then
+    echo " -> $test: test_dir contents verification succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf ./test_dir;
+    exit
+fi;
+
+if [ "$(busybox chown bin ./test_dir/test1; busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,3,4,9 | cut -b 12-26)" = "bin root test1" ]
+then
+    echo " -> $test: test_dir contents verification succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf ./test_dir;
+    exit
+fi;
+
+if [ "$(busybox chown bin.bin ./test_dir/test1; busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,3,4,9 | cut -b 12-26)" = "bin bin test1" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf ./test_dir;
engine/tests/Functional.busybox/tests/busybox_chown2.sh new file +43 -0

43 lines not on this page · raw message

engine/tests/Functional.busybox/tests/busybox_chroot.sh new file +34 -0
new file mode 100644
index 0000000..e9bb8a2
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chroot
+#  1) Option none
+
+test="chroot"
+
+test_dir=test_dir
+
+mkdir -p $test_dir
+mkdir -p $test_dir/bin
+mkdir -p $test_dir/lib64
+mkdir -p $test_dir/lib
+cp -v /bin/ls $test_dir/bin/
+list="$(ldd /bin/ls | egrep -o '/lib.*\.[0-9]')"
+for i in $list; do 
+   j=${i:1:5}
+   if $j = lib64
+   then    
+       echo "lib64"
+       cp  -v "$i" $test_dir/lib64/
+   else 
+       echo "lib"
+       cp  -v "$i" $test_dir/lib/
+   fi
+done
+busybox chroot $test_dir /bin/ls
+if [ $? = 0 ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -fr $test_dir
engine/tests/Functional.busybox/tests/busybox_chvt.sh new file +22 -0
new file mode 100644
index 0000000..b31bf81
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chvt
+#  1) Option none
+
+test="chvt"
+
+anum=$(tty | cut -b 9-10)
+if [ $anum -eq 1 ]
+then
+    bnum=$(($anum+1))
+else
+    bnum=$(($anum-1))
+fi
+busybox chvt $bnum
+if [ $? = 0 ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+busybox chvt $anum
engine/tests/Functional.busybox/tests/busybox_clear.sh new file +14 -0
new file mode 100644
index 0000000..aaa1d06
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command clear
+#  1) Option none
+
+test="clear"
+
+busybox clear
+if [ $? = 0 ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_cmp.sh new file +37 -0
new file mode 100644
index 0000000..0322ba1
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command cmp
+#  1) Option: -l -s
+
+test="cmp"
+
+mkdir test_dir
+echo "This is test file 1." > ./test_dir/test1
+echo "This is test file 2." > ./test_dir/test2
+if [ "$(busybox cmp test_dir/test1 test_dir/test2)" = "test_dir/test1 test_dir/test2 differ: char 19, line 1" ]
+then
+    echo " -> $test: command cmp succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf test_dir
+    exit
+fi
+
+
+
+if [ "$(busybox cmp -l test_dir/test1 test_dir/test2)" = "19  61  62" ] 
+then
+    echo " -> $test: command cmp -l succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf test_dir
+    exit
+fi
+
+if [ "$(busybox cmp -s test_dir/test1 test_dir/test2)" = "" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf test_dir
engine/tests/Functional.busybox/tests/busybox_cp.sh new file +35 -0
new file mode 100644
index 0000000..2eea250
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command cp
+#  1) Option: -i
+
+test="cp"
+
+mkdir test_dir_src
+mkdir test_dir_dest
+echo "cp test" > test_dir_src/test1
+busybox cp test_dir_src/test1 test_dir_dest/
+if [ "$(cat test_dir_dest/test1)" = "cp test" ]
+then
+    echo " -> $test: cp succeed."
+else
+    echo " -> &test: TEST-FAIL"
+    rm -rf test_dir_src
+    rm -rf test_dir_dest
+    exit
+fi;
+
+yes | busybox cp -i test_dir_dest/test1 test_dir_src/ 2>cp.log 
+if cat cp.log | grep "cp: overwrite 'test_dir_src/test1'?" 
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo "-> $test: TEST-FAIL"
+    rm cp.log
+    rm -rf test_dir_src
+    rm -rf test_dir_dest
+    exit
+fi
+rm cp.log
+rm -rf test_dir_src
+rm -rf test_dir_dest
engine/tests/Functional.busybox/tests/busybox_cut.sh new file +13 -0
new file mode 100644
index 0000000..228e12c
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command cut
+#  1) Option: -f -d
+
+test="cut"
+
+if [ "$(echo "Hello world" | busybox cut -f 1 -d ' ')" = "Hello" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
Signature · 1 line
1.8.3.1
#5 lore raw

Re: [Fuego] [PATCH] Add new test cases to testset as follows: cat chgrp chmod chown chroot chvt clear cmp cp cut

This had trailing line whitespace, as well as an empty last line (see below).

I fixes this, but please check this in the future.

applied.
-- Tim

Quoted 554 lines

-----Original Message-----
From: [email protected] [mailto:fuego- [email protected]] On Behalf Of Wang Mingyu
Sent: Friday, June 08, 2018 8:15 AM
To: [email protected]
Subject: [Fuego] [PATCH] Add new test cases to testset as follows: cat chgrp chmod chown chroot chvt clear cmp cp cut

---
 .../tests/Functional.busybox/tests/busybox_cat.sh  | 16 +++++++
 .../Functional.busybox/tests/busybox_chgrp1.sh     | 27 ++++++++++++
 .../Functional.busybox/tests/busybox_chgrp2.sh     | 32 ++++++++++++++
 .../Functional.busybox/tests/busybox_chmod1.sh     | 49
++++++++++++++++++++++
 .../Functional.busybox/tests/busybox_chmod2.sh     | 32 ++++++++++++++
 .../Functional.busybox/tests/busybox_chown1.sh     | 34 +++++++++++++++
 .../Functional.busybox/tests/busybox_chown2.sh     | 43
+++++++++++++++++++
 .../Functional.busybox/tests/busybox_chroot.sh     | 34 +++++++++++++++
 .../tests/Functional.busybox/tests/busybox_chvt.sh | 22 ++++++++++
 .../Functional.busybox/tests/busybox_clear.sh      | 14 +++++++
 .../tests/Functional.busybox/tests/busybox_cmp.sh  | 37
++++++++++++++++
 .../tests/Functional.busybox/tests/busybox_cp.sh   | 35
++++++++++++++++
 .../tests/Functional.busybox/tests/busybox_cut.sh  | 13 ++++++
 13 files changed, 388 insertions(+)
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_cat.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_chgrp1.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_chgrp2.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_chmod1.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_chmod2.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_chown1.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_chown2.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_chroot.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_chvt.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_clear.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_cmp.sh
 create mode 100644 engine/tests/Functional.busybox/tests/busybox_cp.sh
 create mode 100644

engine/tests/Functional.busybox/tests/busybox_cut.sh

engine/tests/Functional.busybox/tests/busybox_cat.sh new file +10 -0
new file mode 100644
index 0000000..424528d
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command cat
+#  1) Option none
+
+test="cat"
+
+echo "hello" > test1
+echo "world" > test2
+if [ "$(busybox cat test1 test2 | head -n 1)" = "hello" ] && [ "$(busybox cat

test1 test2 | tail -n 1)" = "world" ]

engine/tests/Functional.busybox/tests/busybox_cat.sh new file +6 -0
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf test1 test2;
engine/tests/Functional.busybox/tests/busybox_chgrp1.sh new file +20 -0
new file mode 100644
index 0000000..8c7fcf6
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chgrp
+#  1) Option: none
+
+test="chgrp1"
+
+mkdir test_dir
+touch test_dir/test1
+group=$(id -n -g | cut -b -8)
+if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f4 | cut -b -8)" = "$group" ]
+then
+    echo " -> $test: Group info display succedded."
+else
+    echo " -> $test: FAIL"
+    rm -rf test_dir
+    exit
+fi;
+
+if [ "$(chgrp bin ./test_dir/test1; busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f4

| cut -b -8)" = "bin" ]

engine/tests/Functional.busybox/tests/busybox_chgrp1.sh new file +7 -0
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf test_dir
+
engine/tests/Functional.busybox/tests/busybox_chgrp2.sh new file +32 -0
new file mode 100644
index 0000000..fc7073b
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chgrp
+#  1) Option: -R
+
+test="chgrp2"
+
+mkdir test_dir
+touch test_dir/test1
+touch test_dir/test2
+group=$(id -n -g | cut -b -8)
+busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f4 | cut -b -8 > log1
+if [ "$(head -n 1 log1)" = "$group" ] && [  "$(tail -n 1 log1)" = "$group" ]
+then
+    echo " -> $test: Group info display succedded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm log1
+    rm -rf test_dir
+    exit
+fi
+
+busybox chgrp -R bin ./test_dir
+busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f4 | cut -b -8 > log2
+if [ "$(head -n 1 log2)" = "bin" ] && [ "$(tail -n 1 log2)" = "bin" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+rm log1 log2
+rm -rf test_dir
engine/tests/Functional.busybox/tests/busybox_chmod1.sh new file +33 -0
new file mode 100644
index 0000000..0395745
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chmod
+#  1) Option: g+x
+#  2) Option: o+x
+#  3) Option: a-x
+
+test="chmod1"
+
+mkdir test_dir
+touch test_dir/test1
+
+if [ $(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f9) = "test1" ]
+then
+    echo " -> $test: test_dir contents verification succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf ./test_dir
+    exit
+fi;
+
+busybox chmod g+x ./test_dir/test1
+if [ "$(busybox ls -l ./test_dir | cut -b 1-3)" = "-rw" ]
+then
+    echo " -> $test: Changed file permissions verification2 succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf ./test_dir
+    exit
+fi;
+
+busybox chmod o+x ./test_dir/test1
+if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,9  | cut -b 9-16)" = "-x

test1" ]

engine/tests/Functional.busybox/tests/busybox_chmod1.sh new file +10 -0
+then
+    echo " -> $test: Changed file permissions verification3 succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf ./test_dir
+    exit
+fi;
+
+busybox chmod a-x ./test_dir/test1
+if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,9 | cut -b 1,4,7,10-16 )" =

"---- test1" ]

engine/tests/Functional.busybox/tests/busybox_chmod1.sh new file +6 -0
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf ./test_dir;
engine/tests/Functional.busybox/tests/busybox_chmod2.sh new file +13 -0
new file mode 100644
index 0000000..ca48f79
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chmod
+#  1) Option: -R
+
+test="chmod2"
+
+mkdir test_dir
+touch test_dir/test1
+touch test_dir/test2
+busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,9 > log1
+
+if [ "$(head -n 1 log1 | cut -b 12-16)" = "test1" ] && [ "$(tail -n 1 log1 | cut -b

12-16)" = "test2" ]

engine/tests/Functional.busybox/tests/busybox_chmod2.sh new file +12 -0
+then
+    echo " -> $test: test_dir contents verification succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf ./test_dir;
+    rm log1;
+    exit
+fi;
+
+busybox chmod -R a-r ./test_dir
+busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,9 > log2
+if [ "$(head -n 1 log2 | cut -b 1,2,5,8,12-16)" = "----test1" ] && [ "$(tail -n 1

log2 | cut -b 1,2,5,8,12-16)" = "----test2" ]

engine/tests/Functional.busybox/tests/busybox_chmod2.sh new file +7 -0
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm log1 log2;
+rm -rf ./test_dir;
engine/tests/Functional.busybox/tests/busybox_chown1.sh new file +10 -0
new file mode 100644
index 0000000..8d17a72
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chown
+#  1) Option none
+
+test="chown1"
+
+mkdir test_dir
+touch test_dir/test1
+if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,3,4,9 | cut -b 12-26)" =

"root root test1" ]

engine/tests/Functional.busybox/tests/busybox_chown1.sh new file +9 -0
+then
+    echo " -> $test: test_dir contents verification succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf ./test_dir;
+    exit
+fi;
+
+if [ "$(busybox chown bin ./test_dir/test1; busybox ls -l ./test_dir | tr -s ' ' |

cut -d' ' -f1,3,4,9 | cut -b 12-26)" = "bin root test1" ]

engine/tests/Functional.busybox/tests/busybox_chown1.sh new file +9 -0
+then
+    echo " -> $test: test_dir contents verification succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf ./test_dir;
+    exit
+fi;
+
+if [ "$(busybox chown bin.bin ./test_dir/test1; busybox ls -l ./test_dir | tr -s '

' | cut -d' ' -f1,3,4,9 | cut -b 12-26)" = "bin bin test1" ]

engine/tests/Functional.busybox/tests/busybox_chown1.sh new file +6 -0
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf ./test_dir;
engine/tests/Functional.busybox/tests/busybox_chown2.sh new file +12 -0
new file mode 100644
index 0000000..87c928a
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chown
+#  1) Option: -R
+
+test="chown2"
+
+mkdir test_dir
+touch test_dir/test1
+touch test_dir/test2
+busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,3,4,9 > log1
+if [ "$(head -n 1 log1 | cut -b 12-26)" = "root root test1" ] && [ "$(tail -n 1

log1 | cut -b 12-26)" = "root root test2" ]

engine/tests/Functional.busybox/tests/busybox_chown2.sh new file +12 -0
+then
+    echo " -> $test: test_dir contents verification succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm log1
+    rm -rf ./test_dir
+    exit
+fi;
+
+busybox chown -R bin ./test_dir
+busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,3,4,9 > log2
+if [ "$(head -n 1 log2 | cut -b 12-26)" = "bin root test1" ] && [ "$(tail -n 1 log2

| cut -b 12-26)" = "bin root test2" ]

engine/tests/Functional.busybox/tests/busybox_chown2.sh new file +12 -0
+then
+    echo " -> $test: test_dir contents verification succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm log1 log2
+    rm -rf ./test_dir
+    exit
+fi;
+
+busybox chown -R bin.bin ./test_dir
+busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f1,3,4,9 > log3
+if [ "$(head -n 1 log3 | cut -b 12-26)" = "bin bin test1" ] && [ "$(tail -n 1 log3 |

cut -b 12-26)" = "bin bin test2" ]

engine/tests/Functional.busybox/tests/busybox_chown2.sh new file +7 -0
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm log1 log2 log3;
+rm -rf ./test_dir;
engine/tests/Functional.busybox/tests/busybox_chroot.sh new file +34 -0
new file mode 100644
index 0000000..e9bb8a2
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chroot
+#  1) Option none
+
+test="chroot"
+
+test_dir=test_dir
+
+mkdir -p $test_dir
+mkdir -p $test_dir/bin
+mkdir -p $test_dir/lib64
+mkdir -p $test_dir/lib
+cp -v /bin/ls $test_dir/bin/
+list="$(ldd /bin/ls | egrep -o '/lib.*\.[0-9]')"
+for i in $list; do
+   j=${i:1:5}
+   if $j = lib64
+   then
+       echo "lib64"
+       cp  -v "$i" $test_dir/lib64/
+   else
+       echo "lib"
+       cp  -v "$i" $test_dir/lib/
+   fi
+done
+busybox chroot $test_dir /bin/ls
+if [ $? = 0 ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -fr $test_dir
engine/tests/Functional.busybox/tests/busybox_chvt.sh new file +22 -0
new file mode 100644
index 0000000..b31bf81
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command chvt
+#  1) Option none
+
+test="chvt"
+
+anum=$(tty | cut -b 9-10)
+if [ $anum -eq 1 ]
+then
+    bnum=$(($anum+1))
+else
+    bnum=$(($anum-1))
+fi
+busybox chvt $bnum
+if [ $? = 0 ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+busybox chvt $anum
engine/tests/Functional.busybox/tests/busybox_clear.sh new file +14 -0
new file mode 100644
index 0000000..aaa1d06
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command clear
+#  1) Option none
+
+test="clear"
+
+busybox clear
+if [ $? = 0 ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_cmp.sh new file +11 -0
new file mode 100644
index 0000000..0322ba1
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command cmp
+#  1) Option: -l -s
+
+test="cmp"
+
+mkdir test_dir
+echo "This is test file 1." > ./test_dir/test1
+echo "This is test file 2." > ./test_dir/test2
+if [ "$(busybox cmp test_dir/test1 test_dir/test2)" = "test_dir/test1

test_dir/test2 differ: char 19, line 1" ]

engine/tests/Functional.busybox/tests/busybox_cmp.sh new file +26 -0
+then
+    echo " -> $test: command cmp succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf test_dir
+    exit
+fi
+
+
+
+if [ "$(busybox cmp -l test_dir/test1 test_dir/test2)" = "19  61  62" ]
+then
+    echo " -> $test: command cmp -l succeeded."
+else
+    echo " -> $test: TEST-FAIL"
+    rm -rf test_dir
+    exit
+fi
+
+if [ "$(busybox cmp -s test_dir/test1 test_dir/test2)" = "" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf test_dir
engine/tests/Functional.busybox/tests/busybox_cp.sh new file +35 -0
new file mode 100644
index 0000000..2eea250
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command cp
+#  1) Option: -i
+
+test="cp"
+
+mkdir test_dir_src
+mkdir test_dir_dest
+echo "cp test" > test_dir_src/test1
+busybox cp test_dir_src/test1 test_dir_dest/
+if [ "$(cat test_dir_dest/test1)" = "cp test" ]
+then
+    echo " -> $test: cp succeed."
+else
+    echo " -> &test: TEST-FAIL"
+    rm -rf test_dir_src
+    rm -rf test_dir_dest
+    exit
+fi;
+
+yes | busybox cp -i test_dir_dest/test1 test_dir_src/ 2>cp.log
+if cat cp.log | grep "cp: overwrite 'test_dir_src/test1'?"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo "-> $test: TEST-FAIL"
+    rm cp.log
+    rm -rf test_dir_src
+    rm -rf test_dir_dest
+    exit
+fi
+rm cp.log
+rm -rf test_dir_src
+rm -rf test_dir_dest
engine/tests/Functional.busybox/tests/busybox_cut.sh new file +13 -1
new file mode 100644
index 0000000..228e12c
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command cut
+#  1) Option: -f -d
+
+test="cut"
+
+if [ "$(echo "Hello world" | busybox cut -f 1 -d ' ')" = "Hello" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
--

1.8.3.1

_______________________________________________
Fuego mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/fuego

#6 lore raw

PATCH 1/1 Add test case to skip list which uses command tr.

In reply to Wang Mingyu
---
 engine/tests/Functional.busybox/fuego_test.sh | 1 +
 1 file changed, 1 insertion(+)
engine/tests/Functional.busybox/fuego_test.sh +1 -0
index f3183b6..70a6ec1 100755
@@ -33,6 +33,7 @@ function test_pre_check {
     echo "Tests skipped depending on the availability of a command on the target"
     touch ${LOGDIR}/skiplist.txt
     skip_if_command_unavailable expect "busybox_ash.sh"
+    skip_if_command_unavailable tr "busybox_chgrp1.sh busybox_chgrp2.sh busybox_chmod1.sh busybox_chmod2.sh busybox_chown1.sh busybox_chown2.sh"
 }
 
 function test_deploy {
Signature · 1 line
1.8.3.1
#7 lore raw
In reply to Wang Mingyu
Quoted 52 lines

-----Original Message-----
From: Wang Mingyu
Sent: Friday, June 08, 2018 8:15 AM
To: [email protected]
Subject: [Fuego] [PATCH] Add command basename, busybox and bzcat to the testset.

---
 .../tests/Functional.busybox/tests/busybox_basename.sh   | 13
+++++++++++++
 engine/tests/Functional.busybox/tests/busybox_busybox.sh | 13
+++++++++++++
 engine/tests/Functional.busybox/tests/busybox_bzcat.sh   | 16
++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_basename.sh
 create mode 100644
engine/tests/Functional.busybox/tests/busybox_busybox.sh
 create mode 100644

engine/tests/Functional.busybox/tests/busybox_bzcat.sh

engine/tests/Functional.busybox/tests/busybox_basename.sh new file +13 -0
new file mode 100644
index 0000000..78fc3c6
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command basename
+#  1) Option none
+
+test="basename"
+
+if [ $(busybox basename ./test_dir/test1) = "test1" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_busybox.sh new file +0 -0
new file mode 100644
index 0000000..d29ea13

engine/tests/Functional.busybox/tests/busybox_busybox.sh line 8

Quoted 8 lines
engine/tests/Functional.busybox/tests/busybox_busybox.sh new file +8 -0
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command busybox
+#  1) Option none
+
+test="busybox"
+
+if busybox | grep ^BusyBox

The patch had a trailing white space here, which I removed.

Otherwise, it's OK. I applied the patch.
-- Tim

Quoted 37 lines
engine/tests/Functional.busybox/tests/busybox_busybox.sh new file +5 -0
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
engine/tests/Functional.busybox/tests/busybox_bzcat.sh new file +16 -1
new file mode 100644
index 0000000..0531d19
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+#  The testscript checks the following options of the command bzcat
+#  1) Option none
+
+test="bzcat"
+
+echo "This is a test file">test1
+bzip2 test1
+if [ "$(busybox bzcat test1.bz2)" = "This is a test file" ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm -rf test1.bz2;
--

1.8.3.1

_______________________________________________
Fuego mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/fuego