busybox:modify the following 5 points in all scripts.
PATCH 1/1 busybox:modify the following 5 points in all scripts.
1. do not use echo -e
2. succedded->succeeded
3. add indication for all failures
4. if [$? = 0] modification
5. delete the whitespace at the end of the line
--- engine/tests/Functional.busybox/fuego_test.sh | 2 +- .../Functional.busybox/tests/busybox_chgrp1.sh | 5 ++-- .../Functional.busybox/tests/busybox_chgrp2.sh | 3 ++- .../Functional.busybox/tests/busybox_chmod1.sh | 7 ++++-- .../Functional.busybox/tests/busybox_chmod2.sh | 1 + .../Functional.busybox/tests/busybox_chown1.sh | 4 +++- .../Functional.busybox/tests/busybox_chown2.sh | 8 +++---- .../Functional.busybox/tests/busybox_chroot.sh | 3 +-- .../tests/Functional.busybox/tests/busybox_chvt.sh | 5 ++-- .../Functional.busybox/tests/busybox_clear.sh | 3 +-- .../tests/Functional.busybox/tests/busybox_cmp.sh | 2 ++ .../tests/Functional.busybox/tests/busybox_cp.sh | 7 ++---- .../tests/Functional.busybox/tests/busybox_dd.sh | 1 + .../Functional.busybox/tests/busybox_deallocvt.sh | 3 +-- .../Functional.busybox/tests/busybox_egrep.sh | 1 + .../tests/Functional.busybox/tests/busybox_free.sh | 3 +-- .../tests/Functional.busybox/tests/busybox_grep.sh | 6 +++-- .../Functional.busybox/tests/busybox_gunzip.sh | 3 ++- .../tests/Functional.busybox/tests/busybox_gzip.sh | 27 ++++++++++++---------- 19 files changed, 52 insertions(+), 42 deletions(-)
engine/tests/Functional.busybox/fuego_test.sh +1 -1
@@ -44,7 +44,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 busybox_gunzip.sh busybox_gzip.sh" + skip_if_command_unavailable tr "busybox_chgrp1.sh busybox_chgrp2.sh busybox_chmod1.sh busybox_chmod2.sh busybox_chown1.sh busybox_chown2.sh" skip_if_not_root "busybox_chroot.sh" }
engine/tests/Functional.busybox/tests/busybox_chgrp1.sh +3 -2
@@ -10,9 +10,10 @@ touch test_dir/test1 group=$(id -n -g | cut -b -8) if [ "$(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f4 | cut -b -8)" = "$group" ] then - echo " -> $test: Group info display succedded." + echo " -> $test: Group info display succeeded." else - echo " -> $test: FAIL" + echo " -> $test: Group info display failed." + echo " -> $test: TEST-FAIL" rm -rf test_dir exit fi;
engine/tests/Functional.busybox/tests/busybox_chgrp2.sh +2 -1
@@ -12,8 +12,9 @@ group=$(id -n -g | cut -b -8) busybox ls -l ./test_dir | grep -v "total" | 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." + echo " -> $test: Group info display succeeded." else + echo " -> $test: Group info display faild." echo " -> $test: TEST-FAIL" rm log1 rm -rf test_dir
engine/tests/Functional.busybox/tests/busybox_chmod1.sh +5 -2
@@ -14,6 +14,7 @@ if [ $(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f9) = then echo " -> $test: test_dir contents verification succeeded." else + echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir exit
@@ -22,8 +23,9 @@ fi; busybox chmod g+x ./test_dir/test1 if [ "$(busybox ls -l ./test_dir | grep -v "total" | cut -b 1-3)" = "-rw" ] then - echo " -> $test: Changed file permissions verification2 succeeded." + echo " -> $test: Changed file permissions verification#2 succeeded." else + echo " -> $test: Changed file permissions verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir exit
@@ -32,8 +34,9 @@ fi; busybox chmod o+x ./test_dir/test1 if [ "$(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f1,9 | cut -b 9-16)" = "-x test1" ] then - echo " -> $test: Changed file permissions verification3 succeeded." + echo " -> $test: Changed file permissions verification#3 succeeded." else + echo " -> $test: Changed file permissions verification#3 failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir exit
engine/tests/Functional.busybox/tests/busybox_chmod2.sh +1 -0
@@ -14,6 +14,7 @@ if [ "$(head -n 1 log1 | cut -b 12-16)" = "test1" ] && [ "$(tail -n 1 log1 | cut then echo " -> $test: test_dir contents verification succeeded." else + echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir; rm log1;
engine/tests/Functional.busybox/tests/busybox_chown1.sh +3 -1
@@ -13,6 +13,7 @@ if [ "$(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f1,3 then echo " -> $test: test_dir contents verification succeeded." else + echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir; exit
@@ -21,8 +22,9 @@ fi; busybox chown bin ./test_dir/test1 if [ "$(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f1,3,4,9 | cut -b 12-)" = "bin $orig_group test1" ] then - echo " -> $test: test_dir contents verification succeeded." + echo " -> $test: test_dir contents verification#2 succeeded." else + echo " -> $test: test_dir contents verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir; exit
engine/tests/Functional.busybox/tests/busybox_chown2.sh +4 -4
@@ -15,7 +15,7 @@ if [ "$(head -n 1 log1)" = "$orig_user $orig_group test1" ] && [ "$(tail -n 1 lo then echo " -> $test: test_dir contents verification succeeded." else - echo "$test: test_dir contents verification failed" + echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm log1 rm -rf ./test_dir
@@ -28,7 +28,7 @@ if [ "$(head -n 1 log2)" = "bin $orig_group test1" ] && [ "$(tail -n 1 log2)" = then echo " -> $test: group change for multiple files (-R) succeeded" else - echo "$test: group change for multiple files (-R) not found" + echo " -> $test: group change for multiple files (-R) not found." echo " -> $test: TEST-FAIL" rm log1 log2 rm -rf ./test_dir
@@ -39,10 +39,10 @@ busybox chown -R bin.bin ./test_dir busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f3,4,9 > log3 if [ "$(head -n 1 log3)" = "bin bin test1" ] && [ "$(tail -n 1 log3)" = "bin bin test2" ] then - echo "$test: user and group change for multiple files (-R) succeeded" + echo " -> $test: user and group change for multiple files (-R) succeeded" echo " -> $test: TEST-PASS" else - echo "$test: user and group change for multiple files (-R) not found" + echo " -> $test: user and group change for multiple files (-R) not found" echo " -> $test: TEST-FAIL" fi; rm log1 log2 log3;
engine/tests/Functional.busybox/tests/busybox_chroot.sh +1 -2
@@ -19,8 +19,7 @@ for lib in $libs; do mkdir -p ${test_dir}${lib_dirname} cp -v $lib ${test_dir}${lib_dirname} done -busybox chroot $test_dir /bin/ls -if [ $? = 0 ] +if busybox chroot $test_dir /bin/ls then echo " -> $test: TEST-PASS" else
engine/tests/Functional.busybox/tests/busybox_chvt.sh +2 -3
@@ -6,7 +6,7 @@ test="chvt" if tty | grep "^not" ; then - echo "$test: test script not running in a changable tty" + echo " -> $test: test script not running in a changable tty" echo " -> $test: TEST-SKIP" exit 0 fi
@@ -21,8 +21,7 @@ else bnum=$(($anum-1)) fi echo "$test: Changing to VT $bnum" -busybox chvt $bnum -if [ $? = 0 ] +if busybox chvt $bnum then echo " -> $test: TEST-PASS" else
engine/tests/Functional.busybox/tests/busybox_clear.sh +1 -2
@@ -5,8 +5,7 @@ test="clear" -busybox clear -if [ $? = 0 ] +if busybox clear then echo " -> $test: TEST-PASS" else
engine/tests/Functional.busybox/tests/busybox_cmp.sh +2 -0
@@ -12,6 +12,7 @@ if [ "$(busybox cmp test_dir/test1 test_dir/test2)" = "test_dir/test1 test_dir/t then echo " -> $test: command cmp succeeded." else + echo " -> $test: command cmp failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exit
@@ -23,6 +24,7 @@ if [ "$(busybox cmp -l test_dir/test1 test_dir/test2)" = "19 61 62" ] then echo " -> $test: command cmp -l succeeded." else + echo " -> $test: command cmp -l failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exit
engine/tests/Functional.busybox/tests/busybox_cp.sh +2 -5
@@ -11,8 +11,9 @@ 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." + echo " -> $test: cp succeeded." else + echo " -> $test: cp failed." echo " -> &test: TEST-FAIL" rm -rf test_dir_src rm -rf test_dir_dest
@@ -25,10 +26,6 @@ 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
engine/tests/Functional.busybox/tests/busybox_dd.sh +1 -0
@@ -13,6 +13,7 @@ if tail -n 1 log | grep "0+1\ records\ out" && head -n 1 log | grep "0+1\ recor then echo " -> $test: grep succeeded." else + echo " -> $test: grep failed." echo " -> $test: TEST-FAIL" rm -fr test1 test2 rm log
engine/tests/Functional.busybox/tests/busybox_deallocvt.sh +1 -2
@@ -7,8 +7,7 @@ test="deallocvt" openvt -f -c 4 ls sleep 1 -busybox deallocvt 4 -if [ $? = 0 ] +if busybox deallocvt 4 then echo " -> $test: TEST-PASS" else
engine/tests/Functional.busybox/tests/busybox_egrep.sh +1 -0
@@ -13,6 +13,7 @@ if [ "$(head -n 1 log1)" = "test file" ] && [ "$(tail -n 1 log1)" = "extended gr then echo " -> $test: Egrep output verification#1 succeeded." else + echo " -> $test: Egrep output verification#1 failed." echo " -> $test: TEST-FAIL" rm log1 rm -rf test1
engine/tests/Functional.busybox/tests/busybox_free.sh +1 -2
@@ -1,8 +1,7 @@ #!/bin/sh test="free" -busybox free -if [ $? = 0 ] +if busybox free then echo " -> $test: TEST-PASS" else
engine/tests/Functional.busybox/tests/busybox_grep.sh +4 -2
@@ -8,8 +8,9 @@ test="grep" echo -e "Fixed String\nIn pattern\nFor grep" >test1 if [ "$(busybox grep -H in ./test1)" = "./test1:Fixed String" ] then - echo " -> $test: grep option -H verification#1 succedded." + echo " -> $test: option -H verification#1 succeeded." else + echo " -> $test: option -H verification#1 failed." echo " -> $test: TEST-FAIL" rm -rf test1 exit
@@ -17,8 +18,9 @@ fi; if [ "$(busybox grep -h in ./test1)" = "Fixed String" ] then - echo " -> $test: grep option -h verification#2 succedded." + echo " -> $test: option -h verification#2 succeeded." else + echo " -> $test: option -h verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf test1 exit
engine/tests/Functional.busybox/tests/busybox_gunzip.sh +2 -1
@@ -8,10 +8,11 @@ test="gunzip" mkdir test_dir echo "This is a file to test gunzip." > ./test_dir/test1 gzip ./test_dir/test1 -if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f9)" = "test1.gz" ] +if [ "$(ls ./test_dir)" = "test1.gz" ] then echo " -> $test: File test1.gz created." else + echo " -> $test: File test1.gz creation failure." echo " -> $test: TEST-FAIL" rm -rf test_dir exit
engine/tests/Functional.busybox/tests/busybox_gzip.sh +15 -12
@@ -8,10 +8,11 @@ test="gzip" mkdir test_dir echo "This is a file to test gzip." > ./test_dir/test1 busybox gzip ./test_dir/test1 -if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f9)" = "test1.gz" ] +if [ "$(ls ./test_dir)" = "test1.gz" ] then echo " -> $test: File test1.gz created." else + echo " -> $test: File test1.gz creation failure." echo " -> $test: TEST-FAIL" rm -rf test_dir exit
@@ -19,18 +20,19 @@ fi; if [ "$(busybox gzip -cd ./test_dir/test1.gz)" = "This is a file to test gzip." ] then - echo " -> $test: gzip option -cd verification#1 succedded." + echo " -> $test: gzip option -cd verification#1 succeeded." else + echo " -> $test: gzip option -cd verification#1 failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exit fi; -gunzip -t ./test_dir/test1.gz -if [ $? = 0 ] +if gunzip -t ./test_dir/test1.gz then - echo " -> $test: gzip option -t verification#2 succedded." + echo " -> $test: gzip option -t verification#2 succeeded." else + echo " -> $test: gzip option -t verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exit
@@ -38,24 +40,25 @@ fi; if [ "$(gunzip -c ./test_dir/test1.gz)" = "This is a file to test gzip." ] then - echo " -> $test: gzip option -c verification#3 succedded." + echo " -> $test: gzip option -c verification#3 succeeded." else - echo " -> $test: TEST-FAIL" + echo " -> $test: gzip option -c verification#3 failed." + echo " -> $test: TEST-FAIL" rm -rf test_dir exit fi; -busybox gzip -d ./test_dir/test1.gz -if [ $? = 0 ] +if busybox gzip -d ./test_dir/test1.gz then - echo " -> $test: gzip option -d verification#4 succedded." + echo " -> $test: gzip option -d verification#4 succeeded." else - echo " -> $test: TEST-FAIL" + echo " -> $test: gzip option -d verification#4 failed." + echo " -> $test: TEST-FAIL option -d verification#4" rm -rf test_dir exit fi; -if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f9)" = "test1" ] +if [ "$(ls ./test_dir)" = "test1" ] then echo " -> $test: TEST-PASS" else
Signature · 1 line
1.8.3.1
This all looks fine.
One thing, though. I had applied a fixup patch to my master branch for the grep, gzip, and gunzip scripts. This patch included fixes that I had already made, and an undo for a patch I hadn't applied.
I had to do some editing in order to get this to apply cleanly. In the future, please rebase your patches on top of my master. I believe I pushed that change (my previous fixup) to bitbucket, but there's always the possibility that somehow I missed doing that.
In any event, thanks for this patch. I have applied it.
-- Tim
Quoted 498 lines
-----Original Message-----
From: [email protected] [mailto:fuego- [email protected]] On Behalf Of Wang Mingyu
Sent: Thursday, July 19, 2018 1:53 AM
To: [email protected]
Subject: [Fuego] [PATCH] busybox:modify the following 5 points in all scripts.1. do not use echo -e
2.succedded->succeeded
3. add indication for all failures
4. if [$? = 0] modification
5. delete the whitespace at the end of the lineSigned-off-by Wang Mingyu <[email protected]>--- engine/tests/Functional.busybox/fuego_test.sh | 2 +- .../Functional.busybox/tests/busybox_chgrp1.sh | 5 ++-- .../Functional.busybox/tests/busybox_chgrp2.sh | 3 ++- .../Functional.busybox/tests/busybox_chmod1.sh | 7 ++++-- .../Functional.busybox/tests/busybox_chmod2.sh | 1 + .../Functional.busybox/tests/busybox_chown1.sh | 4 +++- .../Functional.busybox/tests/busybox_chown2.sh | 8 +++---- .../Functional.busybox/tests/busybox_chroot.sh | 3 +-- .../tests/Functional.busybox/tests/busybox_chvt.sh | 5 ++-- .../Functional.busybox/tests/busybox_clear.sh | 3 +-- .../tests/Functional.busybox/tests/busybox_cmp.sh | 2 ++ .../tests/Functional.busybox/tests/busybox_cp.sh | 7 ++---- .../tests/Functional.busybox/tests/busybox_dd.sh | 1 + .../Functional.busybox/tests/busybox_deallocvt.sh | 3 +-- .../Functional.busybox/tests/busybox_egrep.sh | 1 + .../tests/Functional.busybox/tests/busybox_free.sh | 3 +-- .../tests/Functional.busybox/tests/busybox_grep.sh | 6 +++-- .../Functional.busybox/tests/busybox_gunzip.sh | 3 ++- .../tests/Functional.busybox/tests/busybox_gzip.sh | 27 ++++++++++++---- ------ 19 files changed, 52 insertions(+), 42 deletions(-)engine/tests/Functional.busybox/fuego_test.sh +0
-0@@ -44,7 +44,7 @@ function test_pre_check { echo "Tests skipped depending on the availability of a command on thetarget"
touch${LOGDIR}/skiplist.txtskip_if_command_unavailableexpect "busybox_ash.sh"
-skip_if_command_unavailabletr "busybox_chgrp1.shbusybox_chgrp2.shbusybox_chmod1.shbusybox_chmod2.shbusybox_chown1.shbusybox_chown2.shbusybox_gunzip.shbusybox_gzip.sh"
+skip_if_command_unavailabletr "busybox_chgrp1.shbusybox_chgrp2.shbusybox_chmod1.shbusybox_chmod2.shbusybox_chown1.shbusybox_chown2.sh"
skip_if_not_root"busybox_chroot.sh"
}engine/tests/Functional.busybox/tests/busybox_chgrp1.sh +0
-0@@ -10,9 +10,10 @@ touch test_dir/test1 group=$(id -n -g | cut -b -8) if [ "$(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f4 | cut -b -8)" = "$group" ]
thenengine/tests/Functional.busybox/tests/busybox_chgrp1.sh +3
-2- echo " -> $test: Group info display succedded." + echo " -> $test: Group info display succeeded." else - echo " -> $test: FAIL" + echo " -> $test: Group info display failed." + echo " -> $test: TEST-FAIL" rm -rf test_dir exit fi;engine/tests/Functional.busybox/tests/busybox_chgrp2.sh +2
-1@@ -12,8 +12,9 @@ group=$(id -n -g | cut -b -8) busybox ls -l ./test_dir | grep -v "total" | 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." + echo " -> $test: Group info display succeeded." else + echo " -> $test: Group info display faild." echo " -> $test: TEST-FAIL" rm log1 rm -rf test_direngine/tests/Functional.busybox/tests/busybox_chmod1.sh +0
-0@@ -14,6 +14,7 @@ if [ $(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' |cut -d' ' -f9) =
thenecho " -> $test: test_dir contents verification succeeded."else
engine/tests/Functional.busybox/tests/busybox_chmod1.sh +3
-1+ echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir exit@@ -22,8 +23,9 @@ fi; busybox chmod g+x ./test_dir/test1 if [ "$(busybox ls -l ./test_dir | grep -v "total" | cut -b 1-3)" = "-rw" ] then - echo " -> $test: Changed file permissions verification2 succeeded." + echo " -> $test: Changed file permissions verification#2 succeeded." else + echo " -> $test: Changed file permissions verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir exit@@ -32,8 +34,9 @@ fi; busybox chmod o+x ./test_dir/test1 if [ "$(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f1,9 | cut -b9-16)" = "-x test1" ]
thenengine/tests/Functional.busybox/tests/busybox_chmod1.sh +2
-1- echo " -> $test: Changed file permissions verification3 succeeded." + echo " -> $test: Changed file permissions verification#3 succeeded." else + echo " -> $test: Changed file permissions verification#3 failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir exitengine/tests/Functional.busybox/tests/busybox_chmod2.sh +0
-0@@ -14,6 +14,7 @@ if [ "$(head -n 1 log1 | cut -b 12-16)" = "test1" ] && ["$(tail -n 1 log1 | cut
thenecho " -> $test: test_dir contents verification succeeded."else
engine/tests/Functional.busybox/tests/busybox_chmod2.sh +1
-0+ echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir; rm log1;engine/tests/Functional.busybox/tests/busybox_chown1.sh +0
-0@@ -13,6 +13,7 @@ if [ "$(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' |cut -d' ' -f1,3
thenecho " -> $test: test_dir contents verification succeeded."else
engine/tests/Functional.busybox/tests/busybox_chown1.sh +3
-2+ echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir; exit@@ -21,8 +22,9 @@ fi; busybox chown bin ./test_dir/test1 if [ "$(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f1,3,4,9 | cut -b 12-)" = "bin $orig_group test1" ] then - echo " -> $test: test_dir contents verification succeeded." + echo " -> $test: test_dir contents verification#2 succeeded." else + echo " -> $test: test_dir contents verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir; exitengine/tests/Functional.busybox/tests/busybox_chown2.sh +0
-0@@ -15,7 +15,7 @@ if [ "$(head -n 1 log1)" = "$orig_user $orig_group test1" ]&& [ "$(tail -n 1 lo
thenecho " -> $test: test_dir contents verification succeeded."else
engine/tests/Functional.busybox/tests/busybox_chown2.sh +1
-1- echo "$test: test_dir contents verification failed" + echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm log1 rm -rf ./test_dir@@ -28,7 +28,7 @@ if [ "$(head -n 1 log2)" = "bin $orig_group test1" ] && ["$(tail -n 1 log2)" =
thenecho " -> $test: group change for multiple files (-R) succeeded"else
engine/tests/Functional.busybox/tests/busybox_chown2.sh +1
-1- echo "$test: group change for multiple files (-R) not found" + echo " -> $test: group change for multiple files (-R) not found." echo " -> $test: TEST-FAIL" rm log1 log2 rm -rf ./test_dir@@ -39,10 +39,10 @@ busybox chown -R bin.bin ./test_dir busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f3,4,9 > log3 if [ "$(head -n 1 log3)" = "bin bin test1" ] && [ "$(tail -n 1 log3)" = "bin bintest2" ]
thenengine/tests/Functional.busybox/tests/busybox_chown2.sh +2
-2- echo "$test: user and group change for multiple files (-R) succeeded" + echo " -> $test: user and group change for multiple files (-R) succeeded" echo " -> $test: TEST-PASS" else - echo "$test: user and group change for multiple files (-R) not found" + echo " -> $test: user and group change for multiple files (-R) not found" echo " -> $test: TEST-FAIL" fi; rm log1 log2 log3;engine/tests/Functional.busybox/tests/busybox_chroot.sh +1
-2@@ -19,8 +19,7 @@ for lib in $libs; do mkdir -p ${test_dir}${lib_dirname} cp -v $lib ${test_dir}${lib_dirname} done -busybox chroot $test_dir /bin/ls -if [ $? = 0 ] +if busybox chroot $test_dir /bin/ls then echo " -> $test: TEST-PASS" elseengine/tests/Functional.busybox/tests/busybox_chvt.sh +2
-3@@ -6,7 +6,7 @@ test="chvt" if tty | grep "^not" ; then - echo "$test: test script not running in a changable tty" + echo " -> $test: test script not running in a changable tty" echo " -> $test: TEST-SKIP" exit 0 fi@@ -21,8 +21,7 @@ else bnum=$(($anum-1)) fi echo "$test: Changing to VT $bnum" -busybox chvt $bnum -if [ $? = 0 ] +if busybox chvt $bnum then echo " -> $test: TEST-PASS" elseengine/tests/Functional.busybox/tests/busybox_clear.sh +1
-2@@ -5,8 +5,7 @@ test="clear" -busybox clear -if [ $? = 0 ] +if busybox clear then echo " -> $test: TEST-PASS" elseengine/tests/Functional.busybox/tests/busybox_cmp.sh +0
-0@@ -12,6 +12,7 @@ if [ "$(busybox cmp test_dir/test1 test_dir/test2)" ="test_dir/test1 test_dir/t
thenecho " -> $test: command cmp succeeded."else
engine/tests/Functional.busybox/tests/busybox_cmp.sh +1
-0+ echo " -> $test: command cmp failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exit@@ -23,6 +24,7 @@ if [ "$(busybox cmp -l test_dir/test1 test_dir/test2)" ="19 61 62" ]
thenecho " -> $test: command cmp -l succeeded."else
engine/tests/Functional.busybox/tests/busybox_cmp.sh +1
-0+ echo " -> $test: command cmp -l failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exitengine/tests/Functional.busybox/tests/busybox_cp.sh +2
-5@@ -11,8 +11,9 @@ 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." + echo " -> $test: cp succeeded." else + echo " -> $test: cp failed." echo " -> &test: TEST-FAIL" rm -rf test_dir_src rm -rf test_dir_dest@@ -25,10 +26,6 @@ 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_srcengine/tests/Functional.busybox/tests/busybox_dd.sh +0
-0@@ -13,6 +13,7 @@ if tail -n 1 log | grep "0+1\ records\ out" && head -n 1log | grep "0+1\ recor
thenecho " -> $test: grep succeeded."else
engine/tests/Functional.busybox/tests/busybox_dd.sh +1
-0+ echo " -> $test: grep failed." echo " -> $test: TEST-FAIL" rm -fr test1 test2 rm logengine/tests/Functional.busybox/tests/busybox_deallocvt.sh +1
-2@@ -7,8 +7,7 @@ test="deallocvt" openvt -f -c 4 ls sleep 1 -busybox deallocvt 4 -if [ $? = 0 ] +if busybox deallocvt 4 then echo " -> $test: TEST-PASS" elseengine/tests/Functional.busybox/tests/busybox_egrep.sh +0
-0@@ -13,6 +13,7 @@ if [ "$(head -n 1 log1)" = "test file" ] && [ "$(tail -n 1log1)" = "extended gr
thenecho " -> $test: Egrep output verification#1 succeeded."else
engine/tests/Functional.busybox/tests/busybox_egrep.sh +1
-0+ echo " -> $test: Egrep output verification#1 failed." echo " -> $test: TEST-FAIL" rm log1 rm -rf test1engine/tests/Functional.busybox/tests/busybox_free.sh +1
-2@@ -1,8 +1,7 @@ #!/bin/sh test="free" -busybox free -if [ $? = 0 ] +if busybox free then echo " -> $test: TEST-PASS" elseengine/tests/Functional.busybox/tests/busybox_grep.sh +4
-2@@ -8,8 +8,9 @@ test="grep" echo -e "Fixed String\nIn pattern\nFor grep" >test1 if [ "$(busybox grep -H in ./test1)" = "./test1:Fixed String" ] then - echo " -> $test: grep option -H verification#1 succedded." + echo " -> $test: option -H verification#1 succeeded." else + echo " -> $test: option -H verification#1 failed." echo " -> $test: TEST-FAIL" rm -rf test1 exit@@ -17,8 +18,9 @@ fi; if [ "$(busybox grep -h in ./test1)" = "Fixed String" ] then - echo " -> $test: grep option -h verification#2 succedded." + echo " -> $test: option -h verification#2 succeeded." else + echo " -> $test: option -h verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf test1 exitengine/tests/Functional.busybox/tests/busybox_gunzip.sh +2
-1@@ -8,10 +8,11 @@ test="gunzip" mkdir test_dir echo "This is a file to test gunzip." > ./test_dir/test1 gzip ./test_dir/test1 -if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f9)" = "test1.gz" ] +if [ "$(ls ./test_dir)" = "test1.gz" ] then echo " -> $test: File test1.gz created." else + echo " -> $test: File test1.gz creation failure." echo " -> $test: TEST-FAIL" rm -rf test_dir exitengine/tests/Functional.busybox/tests/busybox_gzip.sh +15
-13@@ -8,10 +8,11 @@ test="gzip" mkdir test_dir echo "This is a file to test gzip." > ./test_dir/test1 busybox gzip ./test_dir/test1 -if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f9)" = "test1.gz" ] +if [ "$(ls ./test_dir)" = "test1.gz" ] then echo " -> $test: File test1.gz created." else + echo " -> $test: File test1.gz creation failure." echo " -> $test: TEST-FAIL" rm -rf test_dir exit@@ -19,18 +20,19 @@ fi; if [ "$(busybox gzip -cd ./test_dir/test1.gz)" = "This is a file to test gzip." ] then - echo " -> $test: gzip option -cd verification#1 succedded." + echo " -> $test: gzip option -cd verification#1 succeeded." else + echo " -> $test: gzip option -cd verification#1 failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exit fi; -gunzip -t ./test_dir/test1.gz -if [ $? = 0 ] +if gunzip -t ./test_dir/test1.gz then - echo " -> $test: gzip option -t verification#2 succedded." + echo " -> $test: gzip option -t verification#2 succeeded." else + echo " -> $test: gzip option -t verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exit@@ -38,24 +40,25 @@ fi; if [ "$(gunzip -c ./test_dir/test1.gz)" = "This is a file to test gzip." ] then - echo " -> $test: gzip option -c verification#3 succedded." + echo " -> $test: gzip option -c verification#3 succeeded." else - echo " -> $test: TEST-FAIL" + echo " -> $test: gzip option -c verification#3 failed." + echo " -> $test: TEST-FAIL" rm -rf test_dir exit fi; -busybox gzip -d ./test_dir/test1.gz -if [ $? = 0 ] +if busybox gzip -d ./test_dir/test1.gz then - echo " -> $test: gzip option -d verification#4 succedded." + echo " -> $test: gzip option -d verification#4 succeeded." else - echo " -> $test: TEST-FAIL" + echo " -> $test: gzip option -d verification#4 failed." + echo " -> $test: TEST-FAIL option -d verification#4" rm -rf test_dir exit fi; -if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f9)" = "test1" ] +if [ "$(ls ./test_dir)" = "test1" ] then echo " -> $test: TEST-PASS" else --1.8.3.1
_______________________________________________
Fuego mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/fuego
Hi Tim,
I am very sorry that I did not confirm the contents of the master branch before submitting patch. I will not make the same mistake later.
by Wangmy.
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Saturday, July 21, 2018 4:34 AM
To: Wang, Mingyu/王 鸣瑜 <[email protected]>; [email protected]
Subject: RE: [Fuego] [PATCH] busybox:modify the following 5 points in all scripts.
This all looks fine.
One thing, though. I had applied a fixup patch to my master branch for the grep, gzip, and gunzip scripts. This patch included fixes that I had already made, and an undo for a patch I hadn't applied.
I had to do some editing in order to get this to apply cleanly. In the future, please rebase your patches on top of my master. I believe I pushed that change (my previous fixup) to bitbucket, but there's always the possibility that somehow I missed doing that.
In any event, thanks for this patch. I have applied it.
-- Tim
Quoted 487 lines
-----Original Message-----
From: [email protected] [mailto:fuego- [email protected]] On Behalf Of Wang Mingyu
Sent: Thursday, July 19, 2018 1:53 AM
To: [email protected]
Subject: [Fuego] [PATCH] busybox:modify the following 5 points in all scripts.1. do not use echo -e
2.succedded->succeeded
3. add indication for all failures
4. if [$? = 0] modification
5. delete the whitespace at the end of the lineSigned-off-by Wang Mingyu <[email protected]>--- engine/tests/Functional.busybox/fuego_test.sh | 2 +- .../Functional.busybox/tests/busybox_chgrp1.sh | 5 ++-- .../Functional.busybox/tests/busybox_chgrp2.sh | 3 ++- .../Functional.busybox/tests/busybox_chmod1.sh | 7 ++++-- .../Functional.busybox/tests/busybox_chmod2.sh | 1 + .../Functional.busybox/tests/busybox_chown1.sh | 4 +++- .../Functional.busybox/tests/busybox_chown2.sh | 8 +++---- .../Functional.busybox/tests/busybox_chroot.sh | 3 +-- .../tests/Functional.busybox/tests/busybox_chvt.sh | 5 ++-- .../Functional.busybox/tests/busybox_clear.sh | 3 +-- .../tests/Functional.busybox/tests/busybox_cmp.sh | 2 ++ .../tests/Functional.busybox/tests/busybox_cp.sh | 7 ++---- .../tests/Functional.busybox/tests/busybox_dd.sh | 1 + .../Functional.busybox/tests/busybox_deallocvt.sh | 3 +-- .../Functional.busybox/tests/busybox_egrep.sh | 1 + .../tests/Functional.busybox/tests/busybox_free.sh | 3 +-- .../tests/Functional.busybox/tests/busybox_grep.sh | 6 +++-- .../Functional.busybox/tests/busybox_gunzip.sh | 3 ++- .../tests/Functional.busybox/tests/busybox_gzip.sh | 27 ++++++++++++---- ------ 19 files changed, 52 insertions(+), 42 deletions(-)engine/tests/Functional.busybox/fuego_test.sh +0
-0@@ -44,7 +44,7 @@ function test_pre_check { echo "Tests skipped depending on the availability of a command onthe target"
touch${LOGDIR}/skiplist.txtskip_if_command_unavailableexpect "busybox_ash.sh"
-skip_if_command_unavailabletr "busybox_chgrp1.shbusybox_chgrp2.shbusybox_chmod1.shbusybox_chmod2.shbusybox_chown1.shbusybox_chown2.shbusybox_gunzip.shbusybox_gzip.sh"
+skip_if_command_unavailabletr "busybox_chgrp1.sh
+busybox_chgrp2.shbusybox_chmod1.shbusybox_chmod2.shbusybox_chown1.shbusybox_chown2.sh"
skip_if_not_root"busybox_chroot.sh"
}engine/tests/Functional.busybox/tests/busybox_chgrp1.sh +0
-0@@ -10,9 +10,10 @@ touch test_dir/test1 group=$(id -n -g | cut -b -8)if [ "$(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut
engine/tests/Functional.busybox/tests/busybox_chgrp1.sh +3
-3-d' ' -f4 | cut -b - 8)" = "$group" ] then - echo " -> $test: Group info display succedded." + echo " -> $test: Group info display succeeded." else - echo " -> $test: FAIL" + echo " -> $test: Group info display failed." + echo " -> $test: TEST-FAIL" rm -rf test_dir exit fi;engine/tests/Functional.busybox/tests/busybox_chgrp2.sh +0
-0@@ -12,8 +12,9 @@ group=$(id -n -g | cut -b -8) busybox ls -l./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f4 | cut -b -8 > log1 if [ "$(head -n 1 log1)" = "$group" ] && [ "$(tail -n 1 log1)" = "$group" ] then
engine/tests/Functional.busybox/tests/busybox_chgrp2.sh +2
-1- echo " -> $test: Group info display succedded." + echo " -> $test: Group info display succeeded." else + echo " -> $test: Group info display faild." echo " -> $test: TEST-FAIL" rm log1 rm -rf test_direngine/tests/Functional.busybox/tests/busybox_chmod1.sh +0
-0@@ -14,6 +14,7 @@ if [ $(busybox ls -l ./test_dir | grep -v "total" |tr -s ' ' | cut -d' ' -f9) = then
echo " -> $test: test_dir contents verification succeeded."else
engine/tests/Functional.busybox/tests/busybox_chmod1.sh +1
-0+ echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir exit@@ -22,8 +23,9 @@ fi; busybox chmod g+x ./test_dir/test1 if [ "$(busybox ls -l ./test_dir | grep -v "total" | cut -b 1-3)" ="-rw" ] then
engine/tests/Functional.busybox/tests/busybox_chmod1.sh +4
-3- echo " -> $test: Changed file permissions verification2 succeeded." + echo " -> $test: Changed file permissions verification#2 succeeded." else + echo " -> $test: Changed file permissions verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir exit@@ -32,8 +34,9 @@ fi; busybox chmod o+x ./test_dir/test1 if [ "$(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f1,9 | cut -b 9-16)" = "-x test1" ] then - echo " -> $test: Changed file permissions verification3 succeeded." + echo " -> $test: Changed file permissions verification#3 succeeded." else + echo " -> $test: Changed file permissions verification#3 failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir exitengine/tests/Functional.busybox/tests/busybox_chmod2.sh +0
-0@@ -14,6 +14,7 @@ if [ "$(head -n 1 log1 | cut -b 12-16)" = "test1" ]&& [ "$(tail -n 1 log1 | cut then
echo " -> $test: test_dir contents verification succeeded."else
engine/tests/Functional.busybox/tests/busybox_chmod2.sh +1
-0+ echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir; rm log1;engine/tests/Functional.busybox/tests/busybox_chown1.sh +0
-0@@ -13,6 +13,7 @@ if [ "$(busybox ls -l ./test_dir | grep -v "total" |tr -s ' ' | cut -d' ' -f1,3 then
echo " -> $test: test_dir contents verification succeeded."else
engine/tests/Functional.busybox/tests/busybox_chown1.sh +3
-2+ echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir; exit@@ -21,8 +22,9 @@ fi; busybox chown bin ./test_dir/test1 if [ "$(busybox ls -l ./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f1,3,4,9 | cut -b 12-)" = "bin $orig_group test1" ] then - echo " -> $test: test_dir contents verification succeeded." + echo " -> $test: test_dir contents verification#2 succeeded." else + echo " -> $test: test_dir contents verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf ./test_dir; exitengine/tests/Functional.busybox/tests/busybox_chown2.sh +0
-0@@ -15,7 +15,7 @@ if [ "$(head -n 1 log1)" = "$orig_user $orig_grouptest1" ] && [ "$(tail -n 1 lo then
echo " -> $test: test_dir contents verification succeeded."else
engine/tests/Functional.busybox/tests/busybox_chown2.sh +1
-1- echo "$test: test_dir contents verification failed" + echo " -> $test: test_dir contents verification failed." echo " -> $test: TEST-FAIL" rm log1 rm -rf ./test_dir@@ -28,7 +28,7 @@ if [ "$(head -n 1 log2)" = "bin $orig_group test1" ]&& [ "$(tail -n 1 log2)" = then
echo " -> $test: group change for multiple files (-R) succeeded"else
engine/tests/Functional.busybox/tests/busybox_chown2.sh +1
-1- echo "$test: group change for multiple files (-R) not found" + echo " -> $test: group change for multiple files (-R) not found." echo " -> $test: TEST-FAIL" rm log1 log2 rm -rf ./test_dir@@ -39,10 +39,10 @@ busybox chown -R bin.bin ./test_dir busybox ls -l./test_dir | grep -v "total" | tr -s ' ' | cut -d' ' -f3,4,9 > log3 if [ "$(head -n 1 log3)" = "bin bin test1" ] && [ "$(tail -n 1 log3)" = "bin bin test2" ] then
engine/tests/Functional.busybox/tests/busybox_chown2.sh +2
-2- echo "$test: user and group change for multiple files (-R) succeeded" + echo " -> $test: user and group change for multiple files (-R) succeeded" echo " -> $test: TEST-PASS" else - echo "$test: user and group change for multiple files (-R) not found" + echo " -> $test: user and group change for multiple files (-R) not found" echo " -> $test: TEST-FAIL" fi; rm log1 log2 log3;engine/tests/Functional.busybox/tests/busybox_chroot.sh +0
-0@@ -19,8 +19,7 @@ for lib in $libs; do mkdir -p ${test_dir}${lib_dirname} cp -v $lib ${test_dir}${lib_dirname} done -busybox chroot$test_dir
/bin/ls-if [ $? = 0 ]engine/tests/Functional.busybox/tests/busybox_chroot.sh +1
-0+if busybox chroot $test_dir /bin/ls then echo " -> $test: TEST-PASS" elseengine/tests/Functional.busybox/tests/busybox_chvt.sh +2
-3@@ -6,7 +6,7 @@ test="chvt" if tty | grep "^not" ; then - echo "$test: test script not running in a changable tty" + echo " -> $test: test script not running in a changable tty" echo " -> $test: TEST-SKIP" exit 0 fi@@ -21,8 +21,7 @@ else bnum=$(($anum-1)) fi echo "$test: Changing to VT $bnum" -busybox chvt $bnum -if [ $? = 0 ] +if busybox chvt $bnum then echo " -> $test: TEST-PASS" elseengine/tests/Functional.busybox/tests/busybox_clear.sh +1
-2@@ -5,8 +5,7 @@ test="clear" -busybox clear -if [ $? = 0 ] +if busybox clear then echo " -> $test: TEST-PASS" elseengine/tests/Functional.busybox/tests/busybox_cmp.sh +0
-0@@ -12,6 +12,7 @@ if [ "$(busybox cmp test_dir/test1 test_dir/test2)"=
"test_dir/test1 test_dir/t
thenecho " -> $test: command cmp succeeded."else
engine/tests/Functional.busybox/tests/busybox_cmp.sh +1
-0+ echo " -> $test: command cmp failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exit@@ -23,6 +24,7 @@ if [ "$(busybox cmp -l test_dir/test1test_dir/test2)" =
"19 61 62" ]
thenecho " -> $test: command cmp -l succeeded."else
engine/tests/Functional.busybox/tests/busybox_cmp.sh +1
-0+ echo " -> $test: command cmp -l failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exitengine/tests/Functional.busybox/tests/busybox_cp.sh +0
-0@@ -11,8 +11,9 @@ echo "cp test" > test_dir_src/test1 busybox cptest_dir_src/test1 test_dir_dest/ if [ "$(cat test_dir_dest/test1)" = "cp test" ] then
engine/tests/Functional.busybox/tests/busybox_cp.sh +2
-5- echo " -> $test: cp succeed." + echo " -> $test: cp succeeded." else + echo " -> $test: cp failed." echo " -> &test: TEST-FAIL" rm -rf test_dir_src rm -rf test_dir_dest@@ -25,10 +26,6 @@ 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_srcengine/tests/Functional.busybox/tests/busybox_dd.sh +1
-1@@ -13,6 +13,7 @@ if tail -n 1 log | grep "0+1\ records\ out" && head -n 1 log | grep "0+1\ recor then echo " -> $test: grep succeeded." else + echo " -> $test: grep failed." echo " -> $test: TEST-FAIL" rm -fr test1 test2 rm log(quoted diff) +0
-0
a/engine/tests/Functional.busybox/tests/busybox_deallocvt.shb/engine/tests/Functional.busybox/tests/busybox_deallocvt.shindex 88941cc..2ba40cd 100644engine/tests/Functional.busybox/tests/busybox_deallocvt.sh +1
-2@@ -7,8 +7,7 @@ test="deallocvt" openvt -f -c 4 ls sleep 1 -busybox deallocvt 4 -if [ $? = 0 ] +if busybox deallocvt 4 then echo " -> $test: TEST-PASS" elseengine/tests/Functional.busybox/tests/busybox_egrep.sh +0
-0@@ -13,6 +13,7 @@ if [ "$(head -n 1 log1)" = "test file" ] && ["$(tail -n 1 log1)" = "extended gr then
echo " -> $test: Egrep output verification#1 succeeded."else
engine/tests/Functional.busybox/tests/busybox_egrep.sh +1
-0+ echo " -> $test: Egrep output verification#1 failed." echo " -> $test: TEST-FAIL" rm log1 rm -rf test1engine/tests/Functional.busybox/tests/busybox_free.sh +1
-2@@ -1,8 +1,7 @@ #!/bin/sh test="free" -busybox free -if [ $? = 0 ] +if busybox free then echo " -> $test: TEST-PASS" elseengine/tests/Functional.busybox/tests/busybox_grep.sh +0
-0@@ -8,8 +8,9 @@ test="grep" echo -e "Fixed String\nIn pattern\nFor grep" >test1 if [ "$(busyboxgrep -H in ./test1)" = "./test1:Fixed String" ] then
engine/tests/Functional.busybox/tests/busybox_grep.sh +4
-2- echo " -> $test: grep option -H verification#1 succedded." + echo " -> $test: option -H verification#1 succeeded." else + echo " -> $test: option -H verification#1 failed." echo " -> $test: TEST-FAIL" rm -rf test1 exit@@ -17,8 +18,9 @@ fi; if [ "$(busybox grep -h in ./test1)" = "Fixed String" ] then - echo " -> $test: grep option -h verification#2 succedded." + echo " -> $test: option -h verification#2 succeeded." else + echo " -> $test: option -h verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf test1 exitengine/tests/Functional.busybox/tests/busybox_gunzip.sh +0
-0@@ -8,10 +8,11 @@ test="gunzip" mkdir test_dir echo "This is a file to test gunzip." > ./test_dir/test1 gzip./test_dir/test1 -if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut
engine/tests/Functional.busybox/tests/busybox_gunzip.sh +2
-1-d' ' -f9)" = "test1.gz" ] +if [ "$(ls ./test_dir)" = "test1.gz" ] then echo " -> $test: File test1.gz created." else + echo " -> $test: File test1.gz creation failure." echo " -> $test: TEST-FAIL" rm -rf test_dir exitengine/tests/Functional.busybox/tests/busybox_gzip.sh +0
-0@@ -8,10 +8,11 @@ test="gzip" mkdir test_dir echo "This is a file to test gzip." > ./test_dir/test1 busybox gzip./test_dir/test1 -if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut
engine/tests/Functional.busybox/tests/busybox_gzip.sh +2
-1-d' ' -f9)" = "test1.gz" ] +if [ "$(ls ./test_dir)" = "test1.gz" ] then echo " -> $test: File test1.gz created." else + echo " -> $test: File test1.gz creation failure." echo " -> $test: TEST-FAIL" rm -rf test_dir exit@@ -19,18 +20,19 @@ fi; if [ "$(busybox gzip -cd ./test_dir/test1.gz)" = "This is a file totest gzip." ] then
engine/tests/Functional.busybox/tests/busybox_gzip.sh +5
-4- echo " -> $test: gzip option -cd verification#1 succedded." + echo " -> $test: gzip option -cd verification#1 succeeded." else + echo " -> $test: gzip option -cd verification#1 failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exit fi; -gunzip -t ./test_dir/test1.gz -if [ $? = 0 ] +if gunzip -t ./test_dir/test1.gz then - echo " -> $test: gzip option -t verification#2 succedded." + echo " -> $test: gzip option -t verification#2 succeeded." else + echo " -> $test: gzip option -t verification#2 failed." echo " -> $test: TEST-FAIL" rm -rf test_dir exit@@ -38,24 +40,25 @@ fi; if [ "$(gunzip -c ./test_dir/test1.gz)" = "This is a file to testgzip." ] then
engine/tests/Functional.busybox/tests/busybox_gzip.sh +7
-7- echo " -> $test: gzip option -c verification#3 succedded." + echo " -> $test: gzip option -c verification#3 succeeded." else - echo " -> $test: TEST-FAIL" + echo " -> $test: gzip option -c verification#3 failed." + echo " -> $test: TEST-FAIL" rm -rf test_dir exit fi; -busybox gzip -d ./test_dir/test1.gz -if [ $? = 0 ] +if busybox gzip -d ./test_dir/test1.gz then - echo " -> $test: gzip option -d verification#4 succedded." + echo " -> $test: gzip option -d verification#4 succeeded." else - echo " -> $test: TEST-FAIL" + echo " -> $test: gzip option -d verification#4 failed." + echo " -> $test: TEST-FAIL option -d verification#4" rm -rf test_dir exit fi; -if [ "$(busybox ls -l ./test_dir | tr -s ' ' | cut -d' ' -f9)" ="test1" ]
+if [ "$(ls ./test_dir)" = "test1" ]
thenecho " -> $test: TEST-PASS"else
--
1.8.3.1_______________________________________________
Fuego mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/fuego