[Fuego] [PATCH] demo: Add test cases of service pcscd, postfix, pppoe-server and ptpd.
Tim.Bird at sony.com
Tim.Bird at sony.com
Wed Dec 12 01:53:46 UTC 2018
> -----Original Message-----
> From: Wang Mingyu
>
> From: root <root at localhost.localdomain>
This is not right.
>
This is missing the patch description in the body of the commit message.
> Signed-off-by: root <root at localhost.localdomain>
This is not right. I need a valid name and address for the Signed-off-by line.
> ---
> engine/tests/Functional.demo/tests/demo_pcscd.sh | 41
> ++++++++++++++++++++++
> engine/tests/Functional.demo/tests/demo_postfix.sh | 30
> ++++++++++++++++
> .../Functional.demo/tests/demo_pppoe-server.sh | 41
> ++++++++++++++++++++++
> engine/tests/Functional.demo/tests/demo_ptpd.sh | 41
> ++++++++++++++++++++++
> 4 files changed, 153 insertions(+)
> create mode 100644 engine/tests/Functional.demo/tests/demo_pcscd.sh
> create mode 100644 engine/tests/Functional.demo/tests/demo_postfix.sh
> create mode 100644 engine/tests/Functional.demo/tests/demo_pppoe-
> server.sh
> create mode 100644 engine/tests/Functional.demo/tests/demo_ptpd.sh
>
> diff --git a/engine/tests/Functional.demo/tests/demo_pcscd.sh
> b/engine/tests/Functional.demo/tests/demo_pcscd.sh
> new file mode 100644
> index 0000000..f7e5981
> --- /dev/null
> +++ b/engine/tests/Functional.demo/tests/demo_pcscd.sh
See my previous message about Functional.demo.
I'd like this set of tests refactored.
> @@ -0,0 +1,41 @@
> +#!/bin/sh
> +
> +# In the target start pcscd, and confirm the process condition by command
> ps.
> +
> +test="pcscd"
> +
> +. ./fuego_board_function_lib.sh
> +
> +set_init_manager
> +
> +exec_service_on_target pcscd stop
> +
> +if exec_service_on_target pcscd start
> +then
> + echo " -> start of pcscd succeeded."
> +else
> + echo " -> start of pcscd failed."
> + echo " -> $test: TEST-FAIL"
> + exit
> +fi
> +
> +sleep 5
> +
> +if ps aux | grep "[/]usr/sbin/pcscd"
> +then
> + echo " -> get the process of pcscd."
> +else
> + echo " -> can't get the process of pcscd."
> + echo " -> $test: TEST-FAIL"
> + exec_service_on_target pcscd stop
> + exit
> +fi
> +
> +exec_service_on_target pcscd stop
> +
> +if ps aux | grep "[/]usr/sbin/pcscd"
> +then
> + echo " -> $test: TEST-FAIL"
> +else
> + echo " -> $test: TEST-PASS"
> +fi
We don't know if pcscd was running before the test started. If so, it
should be restarted here.
> diff --git a/engine/tests/Functional.demo/tests/demo_postfix.sh
> b/engine/tests/Functional.demo/tests/demo_postfix.sh
> new file mode 100644
> index 0000000..b6059c7
> --- /dev/null
> +++ b/engine/tests/Functional.demo/tests/demo_postfix.sh
> @@ -0,0 +1,30 @@
> +#!/bin/sh
> +
> +# In the target start postfix, and confirm the process condition by command
> ps.
> +
> +test="postfix"
> +
> +. ./fuego_board_function_lib.sh
> +
> +set_init_manager
> +
> +exec_service_on_target postfix stop
> +
> +if exec_service_on_target postfix start
> +then
> + echo " -> start of postfix succeeded."
> +else
> + echo " -> start of postfix failed."
> + echo " -> $test: TEST-FAIL"
> + exit
> +fi
> +
> +sleep 5
> +
> +if ps aux | grep "[/]postfix"
> +then
> + echo " -> get the process of postfix."
> +else
> + echo " -> can't get the process of postfix."
> + echo " -> $test: TEST-FAIL"
> +fi
You should record whether postfix was running, and if so leave it running
when the test completes.
> diff --git a/engine/tests/Functional.demo/tests/demo_pppoe-server.sh
> b/engine/tests/Functional.demo/tests/demo_pppoe-server.sh
> new file mode 100644
> index 0000000..ee4536c
> --- /dev/null
> +++ b/engine/tests/Functional.demo/tests/demo_pppoe-server.sh
> @@ -0,0 +1,41 @@
> +#!/bin/sh
> +
> +# In the target start pppoe-server, and confirm the process condition by
> command ps.
> +
> +test="pppoe-server"
> +
> +. ./fuego_board_function_lib.sh
> +
> +set_init_manager
> +
> +exec_service_on_target pppoe-server stop
> +
> +if exec_service_on_target pppoe-server start
> +then
> + echo " -> start of pppoe-server succeeded."
> +else
> + echo " -> start of pppoe-server failed."
> + echo " -> $test: TEST-FAIL"
> + exit
> +fi
> +
> +sleep 5
> +
> +if ps aux | grep "[/]usr/sbin/pppoe-server"
> +then
> + echo " -> get the process of pppoe-server."
> +else
> + echo " -> can't get the process of pppoe-server."
> + echo " -> $test: TEST-FAIL"
> + exec_service_on_target pppoe-server stop
> + exit
> +fi
> +
> +exec_service_on_target pppoe-server stop
> +
> +if ps aux | grep "[/]usr/sbin/pppoe-server"
> +then
> + echo " -> $test: TEST-FAIL"
> +else
> + echo " -> $test: TEST-PASS"
> +fi
Same "leave board as you found it" issue as mentioned previously.
> diff --git a/engine/tests/Functional.demo/tests/demo_ptpd.sh
> b/engine/tests/Functional.demo/tests/demo_ptpd.sh
> new file mode 100644
> index 0000000..18f9b3a
> --- /dev/null
> +++ b/engine/tests/Functional.demo/tests/demo_ptpd.sh
> @@ -0,0 +1,41 @@
> +#!/bin/sh
> +
> +# In the target start ptpd, and confirm the process condition by command
> ps.
> +
> +test="ptpd"
> +
> +. ./fuego_board_function_lib.sh
> +
> +set_init_manager
> +
> +exec_service_on_target ptpd stop
> +
> +if exec_service_on_target ptpd start
> +then
> + echo " -> start of ptpd succeeded."
> +else
> + echo " -> start of ptpd failed."
> + echo " -> $test: TEST-FAIL"
> + exit
> +fi
> +
> +sleep 5
> +
> +if ps aux | grep "[/]usr/bin/ptpd"
> +then
> + echo " -> get the process of ptpd."
> +else
> + echo " -> can't get the process of ptpd."
> + echo " -> $test: TEST-FAIL"
> + exec_service_on_target ptpd stop
> + exit
> +fi
> +
> +exec_service_on_target ptpd stop
> +
> +if ps aux | grep "[/]usr/sbin/ptpd"
> +then
> + echo " -> $test: TEST-FAIL"
> +else
> + echo " -> $test: TEST-PASS"
> +fi
> --
> 1.8.3.1
Same "leave board as you found it" issue as mentioned previously.
Thanks for submitting this patch. It is not yet applied. Please address the
issues mentioned and resubmit.
-- Tim
More information about the Fuego
mailing list