Return-Path: From: Wang Mingyu Date: Wed, 8 May 2019 01:00:25 -0700 Message-ID: <1557302441-535-18-git-send-email-wangmy@cn.fujitsu.com> In-Reply-To: <1557302441-535-1-git-send-email-wangmy@cn.fujitsu.com> References: <1557302441-535-1-git-send-email-wangmy@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Fuego] [PATCH 17/33] Add test case of service snmpd to check if it can start and stop normally. List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org Signed-off-by: Wang Mingyu --- tests/Functional.misc/tests/net-snmp_snmpd.sh | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/Functional.misc/tests/net-snmp_snmpd.sh diff --git a/tests/Functional.misc/tests/net-snmp_snmpd.sh b/tests/Functional.misc/tests/net-snmp_snmpd.sh new file mode 100644 index 0000000..da68cf0 --- /dev/null +++ b/tests/Functional.misc/tests/net-snmp_snmpd.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# In target, run comannd snmpd. + +test="snmpd" + +. ./fuego_board_function_lib.sh + +set_init_manager + +service_status=$(get_service_status snmpd) +exec_service_on_target snmpd stop +if ps aux | grep "[/]usr/sbin/snmpd" +then + echo " -> stop snmpd failed." + echo " -> $test: TEST-FAIL" + exit +else + echo " -> stop snmpd succeeded." +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 + +if ps aux | grep "[/]usr/sbin/snmpd" +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fi +if [ "$service_status" = "inactive" ] +then + exec_service_on_target snmpd stop +fi -- 1.8.3.1