Return-Path: From: Wang Mingyu Date: Wed, 12 Dec 2018 00:05:57 -0800 Message-ID: <1544601959-22915-5-git-send-email-wangmy@cn.fujitsu.com> In-Reply-To: <1544601959-22915-1-git-send-email-wangmy@cn.fujitsu.com> References: <1544601959-22915-1-git-send-email-wangmy@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Fuego] [PATCH] demo: Add test cases of service snmpd, snmptrapd, sshd, syslog-ng and sysstat. List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org Cc: root From: root Signed-off-by: root --- engine/tests/Functional.demo/tests/demo_snmpd.sh | 39 ++++++++++++++++++++++ .../tests/Functional.demo/tests/demo_snmptrapd.sh | 39 ++++++++++++++++++++++ engine/tests/Functional.demo/tests/demo_sshd.sh | 19 +++++++++++ .../tests/Functional.demo/tests/demo_syslog-ng.sh | 39 ++++++++++++++++++++++ engine/tests/Functional.demo/tests/demo_sysstat.sh | 20 +++++++++++ 5 files changed, 156 insertions(+) create mode 100644 engine/tests/Functional.demo/tests/demo_snmpd.sh create mode 100644 engine/tests/Functional.demo/tests/demo_snmptrapd.sh create mode 100644 engine/tests/Functional.demo/tests/demo_sshd.sh create mode 100644 engine/tests/Functional.demo/tests/demo_syslog-ng.sh create mode 100644 engine/tests/Functional.demo/tests/demo_sysstat.sh diff --git a/engine/tests/Functional.demo/tests/demo_snmpd.sh b/engine/tests/Functional.demo/tests/demo_snmpd.sh new file mode 100644 index 0000000..d33f08e --- /dev/null +++ b/engine/tests/Functional.demo/tests/demo_snmpd.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# In the target start snmpd, and confirm the process condition by command ps. + +test="snmpd" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target snmpd stop + +if ps aux | grep "[/]usr/sbin/snmpd" +then + echo " -> $test: TEST-FAIL" + exit +else + echo " -> no progress when service is shutdown" +fi + +if exec_service_on_target snmpd start +then + echo " -> start of snmpd succeeded." +else + echo " -> start of snmpd failed." + echo " -> $test: TEST-FAIL" + exit +fi + +sleep 5 + +if ps aux | grep "[/]usr/sbin/snmpd" +then + echo " -> get the process of snmpd." + echo " -> $test: TEST-PASS" +else + echo " -> can't get the process of snmpd." + echo " -> $test: TEST-FAIL" +fi diff --git a/engine/tests/Functional.demo/tests/demo_snmptrapd.sh b/engine/tests/Functional.demo/tests/demo_snmptrapd.sh new file mode 100644 index 0000000..0f30219 --- /dev/null +++ b/engine/tests/Functional.demo/tests/demo_snmptrapd.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# In the target start snmptrapd, and confirm the process condition by command ps. + +test="snmptrapd" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target snmptrapd stop + +if ps aux | grep "[/]usr/sbin/snmptrapd" +then + echo " -> $test: TEST-FAIL" + exit +else + echo " -> no progress when service is shutdown" +fi + +if exec_service_on_target snmptrapd start +then + echo " -> start of snmptrapd succeeded." +else + echo " -> start of snmptrapd failed." + echo " -> $test: TEST-FAIL" + exit +fi + +sleep 5 + +if ps aux | grep "[/]usr/sbin/snmptrapd" +then + echo " -> get the process of snmptrapd." + echo " -> $test: TEST-PASS" +else + echo " -> can't get the process of snmptrapd." + echo " -> $test: TEST-FAIL" +fi diff --git a/engine/tests/Functional.demo/tests/demo_sshd.sh b/engine/tests/Functional.demo/tests/demo_sshd.sh new file mode 100644 index 0000000..f42d3fb --- /dev/null +++ b/engine/tests/Functional.demo/tests/demo_sshd.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# In the target start sshd, and confirm the process condition by command ps. + +test="sshd" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target sshd.socket stop + +if exec_service_on_target sshd.socket start +then + echo " -> $test: TEST-PASS" +else + echo " -> start of sshd failed." + echo " -> $test: TEST-FAIL" +fi diff --git a/engine/tests/Functional.demo/tests/demo_syslog-ng.sh b/engine/tests/Functional.demo/tests/demo_syslog-ng.sh new file mode 100644 index 0000000..71303fc --- /dev/null +++ b/engine/tests/Functional.demo/tests/demo_syslog-ng.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# In the target start syslog-ng, and confirm the process condition by command ps. + +test="syslog-ng" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target syslog-ng stop + +if ps aux | grep "[/]usr/sbin/syslog-ng" +then + echo " -> $test: TEST-FAIL" + exit +else + echo " -> no progress when service is shutdown" +fi + +if exec_service_on_target syslog-ng start +then + echo " -> start of syslog-ng succeeded." +else + echo " -> start of syslog-ng failed." + echo " -> $test: TEST-FAIL" + exit +fi + +sleep 5 + +if ps aux | grep "[/]usr/sbin/syslog-ng" +then + echo " -> get the process of syslog-ng." + echo " -> $test: TEST-PASS" +else + echo " -> can't get the process of syslog-ng." + echo " -> $test: TEST-FAIL" +fi diff --git a/engine/tests/Functional.demo/tests/demo_sysstat.sh b/engine/tests/Functional.demo/tests/demo_sysstat.sh new file mode 100644 index 0000000..442841e --- /dev/null +++ b/engine/tests/Functional.demo/tests/demo_sysstat.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# In the target start sysstat, and confirm the process condition by command ps. + +test="sysstat" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target sysstat stop + +if exec_service_on_target sysstat start +then + echo " -> start of sysstat succeeded." + echo " -> $test: TEST-PASS" +else + echo " -> start of sysstat failed." + echo " -> $test: TEST-FAIL" +fi -- 1.8.3.1