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

Tim.Bird at sony.com Tim.Bird at sony.com
Mon Jun 11 22:18:07 UTC 2018


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

> -----Original Message-----
> From: fuego-bounces at lists.linuxfoundation.org [mailto:fuego-
> bounces at lists.linuxfoundation.org] On Behalf Of Wang Mingyu
> Sent: Friday, June 08, 2018 8:15 AM
> To: fuego at lists.linuxfoundation.org
> Subject: [Fuego] [PATCH] Add command date , dd, deallocvt, df, dirname,
> dmesg and du to the testset.
> 
> Signed-off-by: Wang Mingyu <wangmy at cn.fujitsu.com>
> ---
>  .../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
> 
> diff --git a/engine/tests/Functional.busybox/tests/busybox_date.sh
> b/engine/tests/Functional.busybox/tests/busybox_date.sh
> new file mode 100644
> index 0000000..412890e
> --- /dev/null
> +++ b/engine/tests/Functional.busybox/tests/busybox_date.sh
> @@ -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;
> diff --git a/engine/tests/Functional.busybox/tests/busybox_dd.sh
> b/engine/tests/Functional.busybox/tests/busybox_dd.sh
> new file mode 100644
> index 0000000..2aa89b4
> --- /dev/null
> +++ b/engine/tests/Functional.busybox/tests/busybox_dd.sh
> @@ -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;
> diff --git a/engine/tests/Functional.busybox/tests/busybox_deallocvt.sh
> b/engine/tests/Functional.busybox/tests/busybox_deallocvt.sh
> new file mode 100644
> index 0000000..88941cc
> --- /dev/null
> +++ b/engine/tests/Functional.busybox/tests/busybox_deallocvt.sh
> @@ -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;
> diff --git a/engine/tests/Functional.busybox/tests/busybox_df.sh
> b/engine/tests/Functional.busybox/tests/busybox_df.sh
> new file mode 100644
> index 0000000..5eff7ca
> --- /dev/null
> +++ b/engine/tests/Functional.busybox/tests/busybox_df.sh
> @@ -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;
> diff --git a/engine/tests/Functional.busybox/tests/busybox_dirname.sh
> b/engine/tests/Functional.busybox/tests/busybox_dirname.sh
> new file mode 100644
> index 0000000..a3b6d2c
> --- /dev/null
> +++ b/engine/tests/Functional.busybox/tests/busybox_dirname.sh
> @@ -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;
> diff --git a/engine/tests/Functional.busybox/tests/busybox_dmesg.sh
> b/engine/tests/Functional.busybox/tests/busybox_dmesg.sh
> new file mode 100644
> index 0000000..fdf0546
> --- /dev/null
> +++ b/engine/tests/Functional.busybox/tests/busybox_dmesg.sh
> @@ -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;
> diff --git a/engine/tests/Functional.busybox/tests/busybox_du.sh
> b/engine/tests/Functional.busybox/tests/busybox_du.sh
> new file mode 100644
> index 0000000..332322c
> --- /dev/null
> +++ b/engine/tests/Functional.busybox/tests/busybox_du.sh
> @@ -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
> Fuego at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego


More information about the Fuego mailing list