Add test cases for command lm_sensors and service lighttpd, logd and lvm2-monitor.
PATCH 1/1 Add test cases for command lm_sensors and service lighttpd, logd and lvm2-monitor.
--- .../tests/Functional.demo/tests/demo_lighttpd.sh | 41 ++++++++++ .../tests/Functional.demo/tests/demo_lm_sensors.sh | 88 ++++++++++++++++++++++ engine/tests/Functional.demo/tests/demo_logd.sh | 39 ++++++++++ .../Functional.demo/tests/demo_lvm2-monitor.sh | 20 +++++ 4 files changed, 188 insertions(+) create mode 100644 engine/tests/Functional.demo/tests/demo_lighttpd.sh create mode 100644 engine/tests/Functional.demo/tests/demo_lm_sensors.sh create mode 100644 engine/tests/Functional.demo/tests/demo_logd.sh create mode 100644 engine/tests/Functional.demo/tests/demo_lvm2-monitor.sh
engine/tests/Functional.demo/tests/demo_lighttpd.sh new file +41 -0
@@ -0,0 +1,41 @@ +#!/bin/sh + +# In the target start lighttpd, and confirm the process condition by command ps. + +test="lighttpd" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target lighttpd stop + +if exec_service_on_target lighttpd start +then + echo " -> start of lighttpd succeeded." +else + echo " -> start of lighttpd failed." + echo " -> $test: TEST-FAIL" + exit +fi + +sleep 5 + +if ps aux | grep "[/]usr/sbin/lighttpd" +then + echo " -> get the process of lighttpd." +else + echo " -> can't get the process of lighttpd." + echo " -> $test: TEST-FAIL" + exec_service_on_target lighttpd stop + exit +fi + +exec_service_on_target lighttpd stop + +if ps aux | grep "[/]usr/sbin/lighttpd" +then + echo " -> $test: TEST-FAIL" +else + echo " -> $test: TEST-PASS" +fi
engine/tests/Functional.demo/tests/demo_lm_sensors.sh new file +88 -0
88 lines not on this page · raw message
engine/tests/Functional.demo/tests/demo_logd.sh new file +39 -0
@@ -0,0 +1,39 @@ +#!/bin/sh + +# In the target start logd, and confirm the process condition by command ps. + +test="logd" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target logd stop + +if exec_service_on_target logd start +then + echo " -> start of logd succeeded." +else + echo " -> start of logd failed." + echo " -> $test: TEST-FAIL" + exit +fi + +sleep 5 + +if ps aux | grep "[h]a_logd" +then + echo " -> get the process of logd." +else + echo " -> can't get the process of logd." + echo " -> $test: TEST-FAIL" +fi + +exec_service_on_target logd stop + +if ps aux | grep "[h]a_logd" +then + echo " -> $test: TEST-FAIL" +else + echo " -> $test: TEST-PASS" +fi
engine/tests/Functional.demo/tests/demo_lvm2-monitor.sh new file +20 -0
@@ -0,0 +1,20 @@ +#!/bin/sh + +# In the target start lvm2-monitor, and confirm the process condition by command ps. + +test="lvm2-monitor" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target lvm2-monitor stop + +if exec_service_on_target lvm2-monitor start +then + echo " -> start of lvm2-monitor succeeded." + echo " -> $test: TEST-PASS" +else + echo " -> start of lvm2-monitor failed." + echo " -> $test: TEST-FAIL" +fi
Signature · 1 line
1.8.3.1
PATCH 1/1 Add test cases for service hostapd, ip6tables, ipmi and iptables.
--- engine/tests/Functional.demo/tests/demo_hostapd.sh | 35 +++++++++++ .../tests/Functional.demo/tests/demo_ip6tables.sh | 69 ++++++++++++++++++++++ engine/tests/Functional.demo/tests/demo_ipmi.sh | 19 ++++++ .../tests/Functional.demo/tests/demo_iptables.sh | 62 +++++++++++++++++++ 4 files changed, 185 insertions(+) create mode 100644 engine/tests/Functional.demo/tests/demo_hostapd.sh create mode 100644 engine/tests/Functional.demo/tests/demo_ip6tables.sh create mode 100644 engine/tests/Functional.demo/tests/demo_ipmi.sh create mode 100644 engine/tests/Functional.demo/tests/demo_iptables.sh
engine/tests/Functional.demo/tests/demo_hostapd.sh new file +35 -0
@@ -0,0 +1,35 @@ +#!/bin/sh + +# In the target start hostapd, and confirm the process condition by command ps. + +test="hostapd" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target hostapd stop +exec_service_on_target NetworkManager stop + +if [ -f /etc/hostapd.conf ] +then + cp /etc/hostapd.conf /etc/hostapd.conf_bak +fi + +sed -i 's/wlan0/'"$test_wlan"'/g' /etc/hostapd.conf + +sleep 5 + +if exec_service_on_target hostapd start +then + echo " -> start of hostapd succeeded." + echo " -> $test: TEST-PASS" +else + echo " -> start of hostapd failed." + echo " -> $test: TEST-FAIL" +fi + +if [ -f /etc/hostapd.conf_bak ] +then + mv /etc/hostapd.conf_bak /etc/hostapd.conf +fi
engine/tests/Functional.demo/tests/demo_ip6tables.sh new file +69 -0
69 lines not on this page · raw message
engine/tests/Functional.demo/tests/demo_ipmi.sh new file +19 -0
@@ -0,0 +1,19 @@ +#!/bin/sh + +# In the target start ipmi, and confirm the process condition by command ps. + +test="ipmi" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target ipmi stop + +if exec_service_on_target ipmi start +then + echo " -> $test: TEST-PASS" +else + echo " -> start of ipmi failed." + echo " -> $test: TEST-FAIL" +fi
engine/tests/Functional.demo/tests/demo_iptables.sh new file +62 -0
62 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 1/1 Add test cases for service dbus, dhcrelay, dhcpd, dhcpd6 and dovecot.
In reply to Wang Mingyu--- engine/tests/Functional.demo/tests/demo_dbus.sh | 47 +++++++++++++ .../tests/Functional.demo/tests/demo_dhcp-relay.sh | 62 +++++++++++++++++ engine/tests/Functional.demo/tests/demo_dhcpd.sh | 73 ++++++++++++++++++++ engine/tests/Functional.demo/tests/demo_dhcpd6.sh | 77 ++++++++++++++++++++++ engine/tests/Functional.demo/tests/demo_dovecot.sh | 41 ++++++++++++ 5 files changed, 300 insertions(+) create mode 100644 engine/tests/Functional.demo/tests/demo_dbus.sh create mode 100644 engine/tests/Functional.demo/tests/demo_dhcp-relay.sh create mode 100644 engine/tests/Functional.demo/tests/demo_dhcpd.sh create mode 100644 engine/tests/Functional.demo/tests/demo_dhcpd6.sh create mode 100644 engine/tests/Functional.demo/tests/demo_dovecot.sh
engine/tests/Functional.demo/tests/demo_dbus.sh new file +47 -0
@@ -0,0 +1,47 @@ +#!/bin/sh + +# In the target start dbus, and confirm the process condition by command ps. + +test="dbus" + +. ./fuego_board_function_lib.sh + +set_init_manager + +if [ "$init_manager" = "systemd" ] +then + exec_service_on_target dbus stop + + if exec_service_on_target dbus start + then + echo " -> start of dbus succeeded." + else + echo " -> start of dbus failed." + echo " -> $test: TEST-FAIL" + exit + fi + + if systemctl is-active dbus | grep active + then + echo " -> $test: TEST-PASS" + else + echo " -> $test: TEST-FAIL" + fi +else + killall -q /usr/bin/dbus-daemon + sleep 5 + if /etc/init.d/dbus-1 start + then + echo " -> start of dbus succeeded." + else + echo " -> start of dbus failed." + echo " -> $test: TEST-FAIL" + exit + fi + if ps aux | grep "[/]usr/bin/dbus" + then + echo " -> $test: TEST-FAIL" + else + echo " -> $test: TEST-PASS" + fi +fi
engine/tests/Functional.demo/tests/demo_dhcp-relay.sh new file +62 -0
62 lines not on this page · raw message
engine/tests/Functional.demo/tests/demo_dhcpd.sh new file +73 -0
73 lines not on this page · raw message
engine/tests/Functional.demo/tests/demo_dhcpd6.sh new file +77 -0
77 lines not on this page · raw message
engine/tests/Functional.demo/tests/demo_dovecot.sh new file +41 -0
41 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 1/1 Add test cases of service ripngd.
In reply to Wang Mingyuripngd is a routing component that works with the Quagga routing engine.
This test set is used to check the generation of logfile, pidfile, process and syslog of service ripngd.
--- engine/tests/Functional.ripngd/data/ripngd.conf | 24 +++++ engine/tests/Functional.ripngd/data/zebra.conf | 22 ++++ engine/tests/Functional.ripngd/fuego_test.sh | 22 ++++ engine/tests/Functional.ripngd/parser.py | 22 ++++ engine/tests/Functional.ripngd/ripngd_test.sh | 4 + engine/tests/Functional.ripngd/spec.json | 7 ++ .../Functional.ripngd/tests/ripngd_logfile.sh | 111 +++++++++++++++++++ .../Functional.ripngd/tests/ripngd_pidfile.sh | 119 +++++++++++++++++++++ engine/tests/Functional.ripngd/tests/ripngd_ps.sh | 115 ++++++++++++++++++++ .../tests/Functional.ripngd/tests/ripngd_syslog.sh | 109 +++++++++++++++++++ 10 files changed, 555 insertions(+) create mode 100644 engine/tests/Functional.ripngd/data/ripngd.conf create mode 100644 engine/tests/Functional.ripngd/data/zebra.conf create mode 100644 engine/tests/Functional.ripngd/fuego_test.sh create mode 100644 engine/tests/Functional.ripngd/parser.py create mode 100755 engine/tests/Functional.ripngd/ripngd_test.sh create mode 100644 engine/tests/Functional.ripngd/spec.json create mode 100644 engine/tests/Functional.ripngd/tests/ripngd_logfile.sh create mode 100644 engine/tests/Functional.ripngd/tests/ripngd_pidfile.sh create mode 100644 engine/tests/Functional.ripngd/tests/ripngd_ps.sh create mode 100644 engine/tests/Functional.ripngd/tests/ripngd_syslog.sh
engine/tests/Functional.ripngd/data/ripngd.conf new file +24 -0
@@ -0,0 +1,24 @@ +! -*- rip -*- +! +! RIPngd sample configuration file +! +! $Id: ripngd.conf.sample,v 1.1.1.1 2002/12/13 20:15:30 paul Exp $ +! +hostname ripngd +password zebra +log file /var/log/quagga/ripngd.log +log syslog informational +! +! debug ripng events +! debug ripng packet +! +! +router ripng +! network sit1 +! route 3ffe:506::0/32 +! distribute-list local-only out sit1 +! +!ipv6 access-list local-only permit 3ffe:506::0/32 +!ipv6 access-list local-only deny any +! +!log stdout
engine/tests/Functional.ripngd/data/zebra.conf new file +22 -0
@@ -0,0 +1,22 @@ +! +! Zebra configuration saved from vty +! 2000/01/01 01:54:01 +! +hostname Router +password zebra +enable password zebra +log file /var/log/quagga/zebra.log +log syslog informational +! +!interface bmap +! +!interface xxx +! +interface lo +! +ip route xxx/24 xxx reject +! +!ipv6 forwarding +! +line vty +!
engine/tests/Functional.ripngd/fuego_test.sh new file +22 -0
@@ -0,0 +1,22 @@ +function test_pre_check { + assert_has_program ripngd + assert_has_program zebra +} + +function test_deploy { + put $TEST_HOME/ripngd_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/ + put $FUEGO_CORE/engine/scripts/fuego_board_function_lib.sh $BOARD_TESTDIR/fuego.$TESTDIR + put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/ + put -r $TEST_HOME/data $BOARD_TESTDIR/fuego.$TESTDIR/ + cmd "sed -i 's/!interface xxx/interface $IFETH/' $BOARD_TESTDIR/fuego.$TESTDIR/data/zebra.conf" + cmd "sed -i 's/ip route xxx\/24 xxx reject/ip route $ROUTER\/24 $IFETH reject/' $BOARD_TESTDIR/fuego.$TESTDIR/data/zebra.conf" +} + +function test_run { + report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\ + ./ripngd_test.sh" +} + +function test_processing { + log_compare "$TESTDIR" "0" "TEST-FAIL" "n" +}
engine/tests/Functional.ripngd/parser.py new file +22 -0
@@ -0,0 +1,22 @@ +#!/usr/bin/python +# See common.py for description of command-line arguments + +import os, sys, collections + +sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser') +import common as plib + +measurements = {} +measurements = collections.OrderedDict() + +regex_string = '^ -> (.*): TEST-(.*)$' +matches = plib.parse_log(regex_string) + +if matches: + for m in matches: + measurements['default.' + m[0]] = 'PASS' if m[1] == 'PASS' else 'FAIL' + +# split the output for each testcase +plib.split_output_per_testcase(regex_string, measurements) + +sys.exit(plib.process(measurements))
engine/tests/Functional.ripngd/ripngd_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.ripngd/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.ripngd", + "specs": { + "default": {} + } +} +
engine/tests/Functional.ripngd/tests/ripngd_logfile.sh new file +111 -0
111 lines not on this page · raw message
engine/tests/Functional.ripngd/tests/ripngd_pidfile.sh new file +119 -0
119 lines not on this page · raw message
engine/tests/Functional.ripngd/tests/ripngd_ps.sh new file +115 -0
115 lines not on this page · raw message
engine/tests/Functional.ripngd/tests/ripngd_syslog.sh new file +109 -0
109 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 1/1 Add test cases of service ripd.
In reply to Wang Mingyuripd is a routing component that works with the Quagga routing engine.
This test set is used to check the generation of logfile, pidfile, process and syslog of service ripd.
--- engine/tests/Functional.ripd/data/ripd.conf | 13 +++ engine/tests/Functional.ripd/data/zebra.conf | 22 ++++ engine/tests/Functional.ripd/fuego_test.sh | 22 ++++ engine/tests/Functional.ripd/parser.py | 22 ++++ engine/tests/Functional.ripd/ripd_test.sh | 4 + engine/tests/Functional.ripd/spec.json | 7 ++ engine/tests/Functional.ripd/tests/ripd_logfile.sh | 111 ++++++++++++++++++++ engine/tests/Functional.ripd/tests/ripd_pidfile.sh | 98 ++++++++++++++++++ engine/tests/Functional.ripd/tests/ripd_ps.sh | 115 +++++++++++++++++++++ engine/tests/Functional.ripd/tests/ripd_syslog.sh | 109 +++++++++++++++++++ 10 files changed, 523 insertions(+) create mode 100644 engine/tests/Functional.ripd/data/ripd.conf create mode 100644 engine/tests/Functional.ripd/data/zebra.conf create mode 100644 engine/tests/Functional.ripd/fuego_test.sh create mode 100644 engine/tests/Functional.ripd/parser.py create mode 100755 engine/tests/Functional.ripd/ripd_test.sh create mode 100644 engine/tests/Functional.ripd/spec.json create mode 100644 engine/tests/Functional.ripd/tests/ripd_logfile.sh create mode 100644 engine/tests/Functional.ripd/tests/ripd_pidfile.sh create mode 100644 engine/tests/Functional.ripd/tests/ripd_ps.sh create mode 100644 engine/tests/Functional.ripd/tests/ripd_syslog.sh
engine/tests/Functional.ripd/data/ripd.conf new file +13 -0
@@ -0,0 +1,13 @@ +! +! Zebra configuration saved from vty +! 2000/01/01 02:15:35 +! +hostname ripd +password zebra +log file /var/log/quagga/ripd.log +log syslog informational +! +router rip +! +line vty +!
engine/tests/Functional.ripd/data/zebra.conf new file +22 -0
@@ -0,0 +1,22 @@ +! +! Zebra configuration saved from vty +! 2000/01/01 01:54:01 +! +hostname Router +password zebra +enable password zebra +log file /var/log/quagga/zebra.log +log syslog informational +! +!interface bmap +! +!interface xxx +! +interface lo +! +ip route xxx/24 xxx reject +! +!ipv6 forwarding +! +line vty +!
engine/tests/Functional.ripd/fuego_test.sh new file +22 -0
@@ -0,0 +1,22 @@ +function test_pre_check { + assert_has_program ripd + assert_has_program zebra +} + +function test_deploy { + put $TEST_HOME/ripd_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/ + put $FUEGO_CORE/engine/scripts/fuego_board_function_lib.sh $BOARD_TESTDIR/fuego.$TESTDIR + put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/ + put -r $TEST_HOME/data $BOARD_TESTDIR/fuego.$TESTDIR/ + cmd "sed -i 's/!interface xxx/interface $IFETH/' $BOARD_TESTDIR/fuego.$TESTDIR/data/zebra.conf" + cmd "sed -i 's/ip route xxx\/24 xxx reject/ip route $ROUTER\/24 $IFETH reject/' $BOARD_TESTDIR/fuego.$TESTDIR/data/zebra.conf" +} + +function test_run { + report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\ + ./ripd_test.sh" +} + +function test_processing { + log_compare "$TESTDIR" "0" "TEST-FAIL" "n" +}
engine/tests/Functional.ripd/parser.py new file +22 -0
@@ -0,0 +1,22 @@ +#!/usr/bin/python +# See common.py for description of command-line arguments + +import os, sys, collections + +sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser') +import common as plib + +measurements = {} +measurements = collections.OrderedDict() + +regex_string = '^ -> (.*): TEST-(.*)$' +matches = plib.parse_log(regex_string) + +if matches: + for m in matches: + measurements['default.' + m[0]] = 'PASS' if m[1] == 'PASS' else 'FAIL' + +# split the output for each testcase +plib.split_output_per_testcase(regex_string, measurements) + +sys.exit(plib.process(measurements))
engine/tests/Functional.ripd/ripd_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.ripd/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.ripd", + "specs": { + "default": {} + } +} +
engine/tests/Functional.ripd/tests/ripd_logfile.sh new file +111 -0
111 lines not on this page · raw message
engine/tests/Functional.ripd/tests/ripd_pidfile.sh new file +98 -0
98 lines not on this page · raw message
engine/tests/Functional.ripd/tests/ripd_ps.sh new file +115 -0
115 lines not on this page · raw message
engine/tests/Functional.ripd/tests/ripd_syslog.sh new file +109 -0
109 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 1/1 Add test cases of service zebra.
In reply to Wang MingyuZebra is a routing software package that provides TCP/IP based routing services with routing protocols support. This test set is used to check the logfile, pidfild, process, syslog and IPv4/IPv6 routing protocols of zebra.
--- engine/tests/Functional.zebra/data/zebra.conf | 22 +++++++ engine/tests/Functional.zebra/data/zebra.conf.ipv4 | 25 +++++++ engine/tests/Functional.zebra/data/zebra.conf.ipv6 | 28 ++++++++ engine/tests/Functional.zebra/fuego_test.sh | 26 ++++++++ engine/tests/Functional.zebra/parser.py | 22 +++++++ engine/tests/Functional.zebra/spec.json | 7 ++ engine/tests/Functional.zebra/test.yaml | 33 ++++++++++ .../tests/Functional.zebra/tests/zebra_logfile.sh | 75 +++++++++++++++++++++ .../tests/Functional.zebra/tests/zebra_pidfile.sh | 77 ++++++++++++++++++++++ engine/tests/Functional.zebra/tests/zebra_ps.sh | 74 +++++++++++++++++++++ .../Functional.zebra/tests/zebra_route_ipv4.sh | 59 +++++++++++++++++ .../Functional.zebra/tests/zebra_route_ipv6.sh | 62 +++++++++++++++++ .../tests/Functional.zebra/tests/zebra_syslog.sh | 73 ++++++++++++++++++++ engine/tests/Functional.zebra/zebra_test.sh | 4 ++ 14 files changed, 587 insertions(+) create mode 100644 engine/tests/Functional.zebra/data/zebra.conf create mode 100644 engine/tests/Functional.zebra/data/zebra.conf.ipv4 create mode 100644 engine/tests/Functional.zebra/data/zebra.conf.ipv6 create mode 100644 engine/tests/Functional.zebra/fuego_test.sh create mode 100644 engine/tests/Functional.zebra/parser.py create mode 100644 engine/tests/Functional.zebra/spec.json create mode 100644 engine/tests/Functional.zebra/test.yaml create mode 100644 engine/tests/Functional.zebra/tests/zebra_logfile.sh create mode 100644 engine/tests/Functional.zebra/tests/zebra_pidfile.sh create mode 100644 engine/tests/Functional.zebra/tests/zebra_ps.sh create mode 100644 engine/tests/Functional.zebra/tests/zebra_route_ipv4.sh create mode 100644 engine/tests/Functional.zebra/tests/zebra_route_ipv6.sh create mode 100644 engine/tests/Functional.zebra/tests/zebra_syslog.sh create mode 100755 engine/tests/Functional.zebra/zebra_test.sh
engine/tests/Functional.zebra/data/zebra.conf new file +22 -0
@@ -0,0 +1,22 @@ +! +! Zebra configuration saved from vty +! 2000/01/01 01:54:01 +! +hostname Router +password zebra +enable password zebra +log file /var/log/quagga/zebra.log +log syslog informational +! +!interface bmap +! +!interface xxx +! +interface lo +! +ip route xxx/24 xxx reject +! +!ipv6 forwarding +! +line vty +!
engine/tests/Functional.zebra/data/zebra.conf.ipv4 new file +25 -0
@@ -0,0 +1,25 @@ +! +! Zebra configuration saved from vty +! 2005/11/30 03:02:45 +! +hostname Router +password zebra +enable password zebra +log file /var/log/quagga/zebra.log +! +interface xxx +! ipv6 nd suppress-ra +! +interface lo +! +!interface sit0 +! ipv6 nd suppress-ra +! +! ip route xxx/24 xxx reject + +! p2020 special setting +ip route xxx/24 xxx reject +! +! +line vty +!
engine/tests/Functional.zebra/data/zebra.conf.ipv6 new file +28 -0
@@ -0,0 +1,28 @@ +! +! Zebra configuration saved from vty +! 2005/11/30 04:47:01 +! +hostname Router +password zebra +enable password zebra +log file /var/log/quagga/zebra.log +! +interface xxx + ipv6 nd suppress-ra +! +interface lo +! +interface sit0 + ipv6 nd suppress-ra +! +ipv6 route xxx/48 xxx reject + +! p2020 special setting +!ipv6 route xxx/48 xxx reject +! +! p1020,p2020,e300(8313) special setting +!ipv6 route xxx/48 xxx reject +! +! +line vty +!
engine/tests/Functional.zebra/fuego_test.sh new file +26 -0
@@ -0,0 +1,26 @@ +function test_pre_check { + assert_has_program zebra +} + +function test_deploy { + put $TEST_HOME/zebra_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/ + put $FUEGO_CORE/engine/scripts/fuego_board_function_lib.sh $BOARD_TESTDIR/fuego.$TESTDIR + put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/ + put -r $TEST_HOME/data $BOARD_TESTDIR/fuego.$TESTDIR/ + cmd "sed -i 's/!interface xxx/interface $IFETH/' $BOARD_TESTDIR/fuego.$TESTDIR/data/zebra.conf" + cmd "sed -i 's/!interface xxx/interface $IFETH/' $BOARD_TESTDIR/fuego.$TESTDIR/data/zebra.conf.ipv4" + cmd "sed -i 's/!interface xxx/interface $IFETH/' $BOARD_TESTDIR/fuego.$TESTDIR/data/zebra.conf.ipv6" + cmd "sed -i 's/ip route xxx\/24 xxx reject/ip route $ROUTER\/24 $IFETH reject/' $BOARD_TESTDIR/fuego.$TESTDIR/data/zebra.conf" + cmd "sed -i 's/ip route xxx\/24 xxx reject/ip route $ROUTER\/24 $IFETH reject/' $BOARD_TESTDIR/fuego.$TESTDIR/data/zebra.conf.ipv4" + cmd "sed -i 's/ipv6 route xxx\/48 xxx reject/ipv6 route $ROUTER_IPV6\/48 $IFETH reject/' $BOARD_TESTDIR/fuego.$TESTDIR/data/zebra.conf.ipv6" +} + +function test_run { + report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\ + export test_route=$ROUTER;\ + ./zebra_test.sh" +} + +function test_processing { + log_compare "$TESTDIR" "0" "TEST-FAIL" "n" +}
engine/tests/Functional.zebra/parser.py new file +22 -0
@@ -0,0 +1,22 @@ +#!/usr/bin/python +# See common.py for description of command-line arguments + +import os, sys, collections + +sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser') +import common as plib + +measurements = {} +measurements = collections.OrderedDict() + +regex_string = '^ -> (.*): TEST-(.*)$' +matches = plib.parse_log(regex_string) + +if matches: + for m in matches: + measurements['default.' + m[0]] = 'PASS' if m[1] == 'PASS' else 'FAIL' + +# split the output for each testcase +plib.split_output_per_testcase(regex_string, measurements) + +sys.exit(plib.process(measurements))
engine/tests/Functional.zebra/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.zebra", + "specs": { + "default": {} + } +} +
engine/tests/Functional.zebra/test.yaml new file +33 -0
@@ -0,0 +1,33 @@ +fuego_package_version: 1 +name: Functional.zebra +description: | + zebra is a routing manager that implements the zebra route engine. + This test is used to check if zebra can start successfully and obtain the log. +license: Unknown +author: Wang Mingyu <[email protected]> +maintainer: Tim Bird <[email protected]> +version: 1.00 +fuego_release: 1 +type: Functional +tags: ['router'] +params: + - ROUTER: + description: the static route of your target board, defined in board file + example: 192.168.246.0 +data_files: + - zebra_test.sh + - data + zebra.conf + zebra.conf.ipv4 + zebra.conf.ipv6 + - test.yaml + - fuego_test.sh + - parser.py + - spec.json + - tests + zebra_logfile.sh + zebra_pidfile.sh + zebra_ps.sh + zebra_route_ipv4.sh + zebra_route_ipv6.sh + zebra_syslog.sh
engine/tests/Functional.zebra/tests/zebra_logfile.sh new file +75 -0
75 lines not on this page · raw message
engine/tests/Functional.zebra/tests/zebra_pidfile.sh new file +77 -0
77 lines not on this page · raw message
engine/tests/Functional.zebra/tests/zebra_ps.sh new file +74 -0
74 lines not on this page · raw message
engine/tests/Functional.zebra/tests/zebra_route_ipv4.sh new file +59 -0
59 lines not on this page · raw message
engine/tests/Functional.zebra/tests/zebra_route_ipv6.sh new file +62 -0
62 lines not on this page · raw message
engine/tests/Functional.zebra/tests/zebra_syslog.sh new file +73 -0
73 lines not on this page · raw message
engine/tests/Functional.zebra/zebra_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
Signature · 1 line
1.8.3.1
PATCH 1/1 Add test cases of service sshd.
In reply to Wang MingyuOpenSSH is the premier connectivity tool for remote login with the SSH protocol. This test set is used to check the pidfile, process and syslog of service sshd.
--- engine/tests/Functional.openssh/fuego_test.sh | 18 ++++++++ engine/tests/Functional.openssh/openssh_test.sh | 4 ++ engine/tests/Functional.openssh/parser.py | 22 +++++++++ engine/tests/Functional.openssh/spec.json | 7 +++ .../Functional.openssh/tests/openssh_pidfile.sh | 52 ++++++++++++++++++++++ .../tests/Functional.openssh/tests/openssh_ps.sh | 43 ++++++++++++++++++ .../Functional.openssh/tests/openssh_syslog.sh | 49 ++++++++++++++++++++ 7 files changed, 195 insertions(+) create mode 100644 engine/tests/Functional.openssh/fuego_test.sh create mode 100755 engine/tests/Functional.openssh/openssh_test.sh create mode 100644 engine/tests/Functional.openssh/parser.py create mode 100644 engine/tests/Functional.openssh/spec.json create mode 100644 engine/tests/Functional.openssh/tests/openssh_pidfile.sh create mode 100644 engine/tests/Functional.openssh/tests/openssh_ps.sh create mode 100644 engine/tests/Functional.openssh/tests/openssh_syslog.sh
engine/tests/Functional.openssh/fuego_test.sh new file +18 -0
@@ -0,0 +1,18 @@ +function test_pre_check { + assert_has_program sshd +} + +function test_deploy { + put $TEST_HOME/openssh_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/ + put $FUEGO_CORE/engine/scripts/fuego_board_function_lib.sh $BOARD_TESTDIR/fuego.$TESTDIR + put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/ +} + +function test_run { + report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\ + ./openssh_test.sh" +} + +function test_processing { + log_compare "$TESTDIR" "0" "TEST-FAIL" "n" +}
engine/tests/Functional.openssh/openssh_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.openssh/parser.py new file +22 -0
@@ -0,0 +1,22 @@ +#!/usr/bin/python +# See common.py for description of command-line arguments + +import os, sys, collections + +sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser') +import common as plib + +measurements = {} +measurements = collections.OrderedDict() + +regex_string = '^ -> (.*): TEST-(.*)$' +matches = plib.parse_log(regex_string) + +if matches: + for m in matches: + measurements['default.' + m[0]] = 'PASS' if m[1] == 'PASS' else 'FAIL' + +# split the output for each testcase +plib.split_output_per_testcase(regex_string, measurements) + +sys.exit(plib.process(measurements))
engine/tests/Functional.openssh/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.opensshd", + "specs": { + "default": {} + } +} +
engine/tests/Functional.openssh/tests/openssh_pidfile.sh new file +52 -0
52 lines not on this page · raw message
engine/tests/Functional.openssh/tests/openssh_ps.sh new file +43 -0
43 lines not on this page · raw message
engine/tests/Functional.openssh/tests/openssh_syslog.sh new file +49 -0
49 lines not on this page · raw message
Signature · 1 line
1.8.3.1