Skip to contentSkip to conversation

demo: Add test cases of service openvpn, openwsmand, ospf6d and ospfd.

PATCH In review Wang Mingyu 2 participants 11 messages Dec 12, 2018 – Dec 25, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 demo: Add test cases of service openvpn, openwsmand, ospf6d and ospfd.

From: root <[email protected]>

---
 engine/tests/Functional.demo/tests/demo_openvpn.sh | 69 +++++++++++++++++++
 .../tests/Functional.demo/tests/demo_openwsmand.sh | 37 ++++++++++
 engine/tests/Functional.demo/tests/demo_ospf6d.sh  | 78 ++++++++++++++++++++++
 engine/tests/Functional.demo/tests/demo_ospfd.sh   | 78 ++++++++++++++++++++++
 4 files changed, 262 insertions(+)
 create mode 100644 engine/tests/Functional.demo/tests/demo_openvpn.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_openwsmand.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_ospf6d.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_ospfd.sh
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +69 -0
new file mode 100644
index 0000000..43f998a
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+#  In the target start openvpn, and confirm the process condition by command ps.
+
+test="openvpn"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+service_name="service-name-not-set"
+
+if [ "$init_manager" = "systemd" ]
+then
+    service_name="[email protected]"
+    config_file="/etc/openvpn/loopback-server.conf"
+else
+    service_name="openvpn"
+    config_file="/etc/openvpn/testsrv.conf"
+fi
+
+exec_service_on_target $service_name stop
+
+if [ -f $config_file ]
+then
+    cp $config_file ${config_file}_bak
+fi
+
+cp data/testsrv.conf $config_file
+
+cp data/host-target.key /etc/openvpn/host-target.key
+
+restore_target() {
+    if [ -f ${config_file}_bak ]
+    then
+        mv ${config_file}_bak $config_file
+    fi
+}
+
+modprobe tun
+
+mkdir -m 755 /dev/net
+
+mknod /dev/net/tun c 10 200
+
+if exec_service_on_target $service_name start
+then
+    echo " -> start of openvpn succeeded."
+else
+    echo " -> start of openvpn failed."
+    echo " -> $test: TEST-FAIL"
+    modprobe -r tun
+    restore_target
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/openvpn"
+then
+    echo " -> get the process of openvpn."
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of openvpn."
+    echo " -> $test: TEST-FAIL"
+fi
+
+modprobe -r tun
+restore_target
engine/tests/Functional.demo/tests/demo_openwsmand.sh new file +37 -0
new file mode 100644
index 0000000..eb90cbc
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+#  In the target start openwsmand, and confirm the process condition by command ps.
+
+test="openwsmand"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target openwsmand stop
+
+cp /etc/openwsman/ssleay.cnf /etc/openwsman/ssleay.cnf_bak
+
+sed -i 's/random/urandom/g' /etc/openwsman/ssleay.cnf
+
+if exec_service_on_target openwsmand start
+then
+    echo " -> start of openwsmand succeeded."
+else
+    echo " -> start of openwsmand failed."
+    echo " -> $test: TEST-FAIL"
+    mv /etc/openwsman/ssleay.cnf_bak /etc/openwsman/ssleay.cnf
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/openwsmand"
+then
+    echo " -> get the process of openwsmand."
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of openwsmand."
+    echo " -> $test: TEST-FAIL"
+fi
+mv /etc/openwsman/ssleay.cnf_bak /etc/openwsman/ssleay.cnf
engine/tests/Functional.demo/tests/demo_ospf6d.sh new file +78 -0

78 lines not on this page · raw message

engine/tests/Functional.demo/tests/demo_ospfd.sh new file +78 -0

78 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#1 lore raw

Please see my comments inline below.

Quoted 4 lines

-----Original Message-----
From: Wang Mingyu

From: root <[email protected]>

This is not right. I think your 'git config' is not set up properly. This should be your name and e-mail address.

Quoted 2 lines

I cannot accept a patch with an improper Signed-off-by line. Please re-submit with corrected Signed-off-by line.

engine/tests/Functional.demo/tests/demo_openvpn.sh

Quoted 22 lines
---
 engine/tests/Functional.demo/tests/demo_openvpn.sh | 69
+++++++++++++++++++
 .../tests/Functional.demo/tests/demo_openwsmand.sh | 37 ++++++++++
 engine/tests/Functional.demo/tests/demo_ospf6d.sh  | 78
++++++++++++++++++++++
 engine/tests/Functional.demo/tests/demo_ospfd.sh   | 78
++++++++++++++++++++++
 4 files changed, 262 insertions(+)
 create mode 100644
engine/tests/Functional.demo/tests/demo_openvpn.sh
 create mode 100644
engine/tests/Functional.demo/tests/demo_openwsmand.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_ospf6d.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_ospfd.sh
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +0 -0
new file mode 100644
index 0000000..43f998a

The name of this test is too generic. "demo" is a very generic name and could refer to anything.

Please be more specific. Is this referring to a Fujitsu demo of router functionality? All of the patches submitted by you today, and many previous patches (that are in my backlog queue) appear to be "underneath" this Functional test, but it covers a wide range of utilities and services.

The collection of these tests might all relate to a single demo distribution or product, but individual tests (like for postfix, sshd, or wpa_supplicant) will likely be useful for other Fuego users.

I think this whole set of tests need to be refactored.

It looks like the "base" patch for "Functional.demo" was submitted back on September 26 as "Add test cases for command acpid, atd, auditd". This is the one with fuego_test.sh, parser.py, spec.json and demo_test.sh.

If that is too much work, I'm willing to allow you to rename this just to "Functional.Fujitsu-router-demo", or something like that. But ultimately it would be more useful if all these sub-tests were broken out into separate tests.

Let me know what you'd like to do.

Independent of that, other comments are inline below.

Quoted 32 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +3 -0
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+#  In the target start openvpn, and confirm the process condition by

command ps.

engine/tests/Functional.demo/tests/demo_openvpn.sh new file +27 -0
+
+test="openvpn"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+service_name="service-name-not-set"
+
+if [ "$init_manager" = "systemd" ]
+then
+    service_name="[email protected]"
+    config_file="/etc/openvpn/loopback-server.conf"
+else
+    service_name="openvpn"
+    config_file="/etc/openvpn/testsrv.conf"
+fi
+
+exec_service_on_target $service_name stop
+
+if [ -f $config_file ]
+then
+    cp $config_file ${config_file}_bak
+fi
+
+cp data/testsrv.conf $config_file
+

engine/tests/Functional.demo/tests/demo_openvpn.sh line 40

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +10 -0
+cp data/host-target.key /etc/openvpn/host-target.key
+
+restore_target() {
+    if [ -f ${config_file}_bak ]
+    then
+        mv ${config_file}_bak $config_file
+    fi
+}
+
+modprobe tun

Should add "assert_has_program modprobe" to fuego_test.sh for this test.

engine/tests/Functional.demo/tests/demo_openvpn.sh line 52

Quoted 12 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +12 -0
+
+mkdir -m 755 /dev/net
+
+mknod /dev/net/tun c 10 200
+
+if exec_service_on_target $service_name start
+then
+    echo " -> start of openvpn succeeded."
+else
+    echo " -> start of openvpn failed."
+    echo " -> $test: TEST-FAIL"
+    modprobe -r tun

does this automatically stop the service?

I would be more comfortable if there was an "exec_service_on_target $service_name stop" before the modulde removal here.

Quoted 5 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +5 -0
+    restore_target
+    exit
+fi
+
+sleep 5

engine/tests/Functional.demo/tests/demo_openvpn.sh line 67

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +10 -0
+
+if ps aux | grep "[/]usr/sbin/openvpn"
+then
+    echo " -> get the process of openvpn."
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of openvpn."
+    echo " -> $test: TEST-FAIL"
+fi
+

Should stop the service here, if it was not running when we started the test. Otherwise, (if it *was* running when the test started), we should restoring the configuration and restart the service.

Quoted 1 line

+modprobe -r tun

Should only remove the module if it was not present when we started the test.

Quoted 14 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +1 -0
+restore_target
engine/tests/Functional.demo/tests/demo_openwsmand.sh new file +3 -0
new file mode 100644
index 0000000..eb90cbc
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+#  In the target start openwsmand, and confirm the process condition by

command ps.

engine/tests/Functional.demo/tests/demo_openwsmand.sh new file +2 -0
+
+test="openwsmand"

engine/tests/Functional.demo/tests/demo_openwsmand.sh line 15

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_openwsmand.sh new file +10 -0
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target openwsmand stop
+
+cp /etc/openwsman/ssleay.cnf /etc/openwsman/ssleay.cnf_bak
+
+sed -i 's/random/urandom/g' /etc/openwsman/ssleay.cnf

Should add 'assert_has_program sed' in fuego_test.sh for this test

Quoted 12 lines
engine/tests/Functional.demo/tests/demo_openwsmand.sh new file +12 -0
+
+if exec_service_on_target openwsmand start
+then
+    echo " -> start of openwsmand succeeded."
+else
+    echo " -> start of openwsmand failed."
+    echo " -> $test: TEST-FAIL"
+    mv /etc/openwsman/ssleay.cnf_bak /etc/openwsman/ssleay.cnf
+    exit
+fi
+
+sleep 5

engine/tests/Functional.demo/tests/demo_openwsmand.sh line 37

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_openwsmand.sh new file +10 -0
+
+if ps aux | grep "[/]usr/sbin/openwsmand"
+then
+    echo " -> get the process of openwsmand."
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of openwsmand."
+    echo " -> $test: TEST-FAIL"
+fi
+mv /etc/openwsman/ssleay.cnf_bak /etc/openwsman/ssleay.cnf

Should make sure machine is in same state after test as when we started. If openwsmand was running when we started, it should be running when we exit. If not, it should be stopped when we exit.

Quoted 76 lines
engine/tests/Functional.demo/tests/demo_ospf6d.sh new file +3 -0
new file mode 100644
index 0000000..22725d8
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+#  In the target start ospf6d, and confirm the process condition by command

ps.

engine/tests/Functional.demo/tests/demo_ospf6d.sh new file +65 -0
+
+test="ospf6d"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+restore_target() {
+    if [ -f /etc/quagga/zebra.conf_bak ]
+    then
+        mv /etc/quagga/zebra.conf_bak /etc/quagga/zebra.conf
+    else
+        rm -f /etc/quagga/zebra.conf
+    fi
+
+    if [ -f /etc/quagga/ospf6d.conf_bak ]
+    then
+        mv /etc/quagga/ospf6d.conf_bak /etc/quagga/ospf6d.conf
+    else
+        rm -f /etc/quagga/ospf6d.conf
+    fi
+}
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ospf6d stop
+    exec_service_on_target zebra stop
+else
+    /etc/init.d/quagga stop ospf6d
+    /etc/init.d/quagga stop zebra
+fi
+
+if [ -f /etc/quagga/zebra.conf ]
+then
+    cp /etc/quagga/zebra.conf /etc/quagga/zebra.conf_bak
+fi
+
+if [ -f /etc/quagga/ospf6d.conf ]
+then
+    cp /etc/quagga/ospf6d.conf /etc/quagga/ospf6d.conf_bak
+fi
+
+cp data/zebra.conf /etc/quagga/zebra.conf
+cp data/ospf6d.conf /etc/quagga/ospf6d.conf
+chown quagga:quagga /etc/quagga/*.conf
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target zebra start
+    exec_service_on_target ospf6d start
+else
+    /etc/init.d/quagga start zebra
+    /etc/init.d/quagga start ospf6d
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/ospf6d"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of ospf6d."
+    echo " -> $test: TEST-FAIL"
+fi
+

engine/tests/Functional.demo/tests/demo_ospf6d.sh line 78

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_ospf6d.sh new file +10 -0
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ospf6d stop
+    exec_service_on_target zebra stop
+else
+    /etc/init.d/quagga stop ospf6d
+    /etc/init.d/quagga stop zebra
+fi
+
+restore_target

Should stop service if it was not running when we started. Or re-start it with restored configuration, if it *was* running when we started.

Quoted 76 lines
engine/tests/Functional.demo/tests/demo_ospfd.sh new file +3 -0
new file mode 100644
index 0000000..789a61f
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+#  In the target start ospfd, and confirm the process condition by command

ps.

engine/tests/Functional.demo/tests/demo_ospfd.sh new file +65 -0
+
+test="ospfd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+restore_target() {
+    if [ -f /etc/quagga/zebra.conf_bak ]
+    then
+        mv /etc/quagga/zebra.conf_bak /etc/quagga/zebra.conf
+    else
+        rm -f /etc/quagga/zebra.conf
+    fi
+
+    if [ -f /etc/quagga/ospfd.conf_bak ]
+    then
+        mv /etc/quagga/ospfd.conf_bak /etc/quagga/ospfd.conf
+    else
+        rm -f /etc/quagga/ospfd.conf
+    fi
+}
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ospfd stop
+    exec_service_on_target zebra stop
+else
+    /etc/init.d/quagga stop ospfd
+    /etc/init.d/quagga stop zebra
+fi
+
+if [ -f /etc/quagga/zebra.conf ]
+then
+    cp /etc/quagga/zebra.conf /etc/quagga/zebra.conf_bak
+fi
+
+if [ -f /etc/quagga/ospfd.conf ]
+then
+    cp /etc/quagga/ospfd.conf /etc/quagga/ospfd.conf_bak
+fi
+
+cp data/zebra.conf /etc/quagga/zebra.conf
+cp data/ospfd.conf /etc/quagga/ospfd.conf
+chown quagga:quagga /etc/quagga/*.conf
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target zebra start
+    exec_service_on_target ospfd start
+else
+    /etc/init.d/quagga start zebra
+    /etc/init.d/quagga start ospfd
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/ospfd"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of ospfd."
+    echo " -> $test: TEST-FAIL"
+fi
+

engine/tests/Functional.demo/tests/demo_ospfd.sh line 78

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_ospfd.sh new file +10 -0
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ospfd stop
+    exec_service_on_target zebra stop
+else
+    /etc/init.d/quagga stop ospfd
+    /etc/init.d/quagga stop zebra
+fi
+
+restore_target

Same issue here as with other tests. Need to leave board in same state we found it.

Quoted 1 line

--

Thank you for this submission. I'm sorry it's taken this long to review patches from the "Functional.demo" suite. Please let me know how you'd like to proceed (either by refactoring this test into multiple test of individual functionality, or by renaming "Functional.demo" to something less generic.)

My preference is to refactor.

Regards,
-- Tim

#2 lore raw

hi Tim,

Quoted 6 lines
Quoted 6 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +6 -0
+
+mkdir -m 755 /dev/net
+
+mknod /dev/net/tun c 10 200
+
+if exec_service_on_target $service_name start then
Quoted 8 lines

engine/tests/Functional.demo/tests/demo_openvpn.sh line 52

Quoted 5 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +5 -0
+    echo " -> start of openvpn succeeded."
+else
+    echo " -> start of openvpn failed."
+    echo " -> $test: TEST-FAIL"
+    modprobe -r tun

does this automatically stop the service?
I would be more comfortable if there was an "exec_service_on_target $service_name stop" before the modulde removal here.

This is the code after the execution of "exec_service_on_target $service_name start" failed. Since the service fails to start, I think there is no need to stop it.

I'm going to split "demo" into multiple test of individual functionality and resubmit them.

by Wangmy

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Wednesday, December 12, 2018 9:48 AM
To: Wang, Mingyu/王 鸣瑜 <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [Fuego] [PATCH] demo: Add test cases of service openvpn, openwsmand, ospf6d and ospfd.

Please see my comments inline below.

Quoted 4 lines

-----Original Message-----
From: Wang Mingyu

From: root <[email protected]>

This is not right. I think your 'git config' is not set up properly. This should be your name and e-mail address.

Quoted 2 lines

I cannot accept a patch with an improper Signed-off-by line. Please re-submit with corrected Signed-off-by line.

engine/tests/Functional.demo/tests/demo_openvpn.sh

Quoted 22 lines
---
 engine/tests/Functional.demo/tests/demo_openvpn.sh | 69
+++++++++++++++++++
 .../tests/Functional.demo/tests/demo_openwsmand.sh | 37 ++++++++++  
engine/tests/Functional.demo/tests/demo_ospf6d.sh  | 78
++++++++++++++++++++++
 engine/tests/Functional.demo/tests/demo_ospfd.sh   | 78
++++++++++++++++++++++
 4 files changed, 262 insertions(+)
 create mode 100644
engine/tests/Functional.demo/tests/demo_openvpn.sh
 create mode 100644
engine/tests/Functional.demo/tests/demo_openwsmand.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_ospf6d.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_ospfd.sh
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +0 -0
new file mode 100644
index 0000000..43f998a

The name of this test is too generic. "demo" is a very generic name and could refer to anything.

Please be more specific. Is this referring to a Fujitsu demo of router functionality? All of the patches submitted by you today, and many previous patches (that are in my backlog queue) appear to be "underneath" this Functional test, but it covers a wide range of utilities and services.

The collection of these tests might all relate to a single demo distribution or product, but individual tests (like for postfix, sshd, or wpa_supplicant) will likely be useful for other Fuego users.

I think this whole set of tests need to be refactored.

It looks like the "base" patch for "Functional.demo" was submitted back on September 26 as "Add test cases for command acpid, atd, auditd". This is the one with fuego_test.sh, parser.py, spec.json and demo_test.sh.

If that is too much work, I'm willing to allow you to rename this just to "Functional.Fujitsu-router-demo", or something like that. But ultimately it would be more useful if all these sub-tests were broken out into separate tests.

Let me know what you'd like to do.

Independent of that, other comments are inline below.

Quoted 31 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +3 -0
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+#  In the target start openvpn, and confirm the process condition by

command ps.

engine/tests/Functional.demo/tests/demo_openvpn.sh new file +26 -0
+
+test="openvpn"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+service_name="service-name-not-set"
+
+if [ "$init_manager" = "systemd" ]
+then
+    service_name="[email protected]"
+    config_file="/etc/openvpn/loopback-server.conf"
+else
+    service_name="openvpn"
+    config_file="/etc/openvpn/testsrv.conf"
+fi
+
+exec_service_on_target $service_name stop
+
+if [ -f $config_file ]
+then
+    cp $config_file ${config_file}_bak fi
+
+cp data/testsrv.conf $config_file
+

engine/tests/Functional.demo/tests/demo_openvpn.sh line 40

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +10 -0
+cp data/host-target.key /etc/openvpn/host-target.key
+
+restore_target() {
+    if [ -f ${config_file}_bak ]
+    then
+        mv ${config_file}_bak $config_file
+    fi
+}
+
+modprobe tun

Should add "assert_has_program modprobe" to fuego_test.sh for this test.

engine/tests/Functional.demo/tests/demo_openvpn.sh line 52

Quoted 11 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +11 -0
+
+mkdir -m 755 /dev/net
+
+mknod /dev/net/tun c 10 200
+
+if exec_service_on_target $service_name start then
+    echo " -> start of openvpn succeeded."
+else
+    echo " -> start of openvpn failed."
+    echo " -> $test: TEST-FAIL"
+    modprobe -r tun

does this automatically stop the service?

I would be more comfortable if there was an "exec_service_on_target $service_name stop" before the modulde removal here.

Quoted 5 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +5 -0
+    restore_target
+    exit
+fi
+
+sleep 5

engine/tests/Functional.demo/tests/demo_openvpn.sh line 67

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +10 -0
+
+if ps aux | grep "[/]usr/sbin/openvpn"
+then
+    echo " -> get the process of openvpn."
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of openvpn."
+    echo " -> $test: TEST-FAIL"
+fi
+

Should stop the service here, if it was not running when we started the test.
Otherwise, (if it *was* running when the test started), we should restoring the configuration and restart the service.

Quoted 1 line

+modprobe -r tun

Should only remove the module if it was not present when we started the test.

Quoted 15 lines
engine/tests/Functional.demo/tests/demo_openvpn.sh new file +1 -0
+restore_target
engine/tests/Functional.demo/tests/demo_openwsmand.sh new file +4 -0
new file mode 100644
index 0000000..eb90cbc
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+#  In the target start openwsmand, and confirm the process condition 
+by

command ps.

engine/tests/Functional.demo/tests/demo_openwsmand.sh new file +2 -0
+
+test="openwsmand"

engine/tests/Functional.demo/tests/demo_openwsmand.sh line 15

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_openwsmand.sh new file +10 -0
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target openwsmand stop
+
+cp /etc/openwsman/ssleay.cnf /etc/openwsman/ssleay.cnf_bak
+
+sed -i 's/random/urandom/g' /etc/openwsman/ssleay.cnf

Should add 'assert_has_program sed' in fuego_test.sh for this test

Quoted 11 lines
engine/tests/Functional.demo/tests/demo_openwsmand.sh new file +11 -0
+
+if exec_service_on_target openwsmand start then
+    echo " -> start of openwsmand succeeded."
+else
+    echo " -> start of openwsmand failed."
+    echo " -> $test: TEST-FAIL"
+    mv /etc/openwsman/ssleay.cnf_bak /etc/openwsman/ssleay.cnf
+    exit
+fi
+
+sleep 5

engine/tests/Functional.demo/tests/demo_openwsmand.sh line 37

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_openwsmand.sh new file +10 -0
+
+if ps aux | grep "[/]usr/sbin/openwsmand"
+then
+    echo " -> get the process of openwsmand."
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of openwsmand."
+    echo " -> $test: TEST-FAIL"
+fi
+mv /etc/openwsman/ssleay.cnf_bak /etc/openwsman/ssleay.cnf

Should make sure machine is in same state after test as when we started.
If openwsmand was running when we started, it should be running when we exit. If not, it should be stopped when we exit.

Quoted 71 lines
engine/tests/Functional.demo/tests/demo_ospf6d.sh new file +4 -0
new file mode 100644
index 0000000..22725d8
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+#  In the target start ospf6d, and confirm the process condition by 
+command

ps.

engine/tests/Functional.demo/tests/demo_ospf6d.sh new file +59 -0
+
+test="ospf6d"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+restore_target() {
+    if [ -f /etc/quagga/zebra.conf_bak ]
+    then
+        mv /etc/quagga/zebra.conf_bak /etc/quagga/zebra.conf
+    else
+        rm -f /etc/quagga/zebra.conf
+    fi
+
+    if [ -f /etc/quagga/ospf6d.conf_bak ]
+    then
+        mv /etc/quagga/ospf6d.conf_bak /etc/quagga/ospf6d.conf
+    else
+        rm -f /etc/quagga/ospf6d.conf
+    fi
+}
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ospf6d stop
+    exec_service_on_target zebra stop else
+    /etc/init.d/quagga stop ospf6d
+    /etc/init.d/quagga stop zebra
+fi
+
+if [ -f /etc/quagga/zebra.conf ]
+then
+    cp /etc/quagga/zebra.conf /etc/quagga/zebra.conf_bak fi
+
+if [ -f /etc/quagga/ospf6d.conf ]
+then
+    cp /etc/quagga/ospf6d.conf /etc/quagga/ospf6d.conf_bak fi
+
+cp data/zebra.conf /etc/quagga/zebra.conf cp data/ospf6d.conf 
+/etc/quagga/ospf6d.conf chown quagga:quagga /etc/quagga/*.conf
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target zebra start
+    exec_service_on_target ospf6d start else
+    /etc/init.d/quagga start zebra
+    /etc/init.d/quagga start ospf6d
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/ospf6d"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of ospf6d."
+    echo " -> $test: TEST-FAIL"
+fi

engine/tests/Functional.demo/tests/demo_ospf6d.sh line 78

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_ospf6d.sh new file +10 -0
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ospf6d stop
+    exec_service_on_target zebra stop else
+    /etc/init.d/quagga stop ospf6d
+    /etc/init.d/quagga stop zebra
+fi
+
+restore_target

Should stop service if it was not running when we started. Or re-start it with restored configuration, if it *was* running when we started.

Quoted 71 lines
engine/tests/Functional.demo/tests/demo_ospfd.sh new file +4 -0
new file mode 100644
index 0000000..789a61f
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+#  In the target start ospfd, and confirm the process condition by 
+command

ps.

engine/tests/Functional.demo/tests/demo_ospfd.sh new file +59 -0
+
+test="ospfd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+restore_target() {
+    if [ -f /etc/quagga/zebra.conf_bak ]
+    then
+        mv /etc/quagga/zebra.conf_bak /etc/quagga/zebra.conf
+    else
+        rm -f /etc/quagga/zebra.conf
+    fi
+
+    if [ -f /etc/quagga/ospfd.conf_bak ]
+    then
+        mv /etc/quagga/ospfd.conf_bak /etc/quagga/ospfd.conf
+    else
+        rm -f /etc/quagga/ospfd.conf
+    fi
+}
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ospfd stop
+    exec_service_on_target zebra stop else
+    /etc/init.d/quagga stop ospfd
+    /etc/init.d/quagga stop zebra
+fi
+
+if [ -f /etc/quagga/zebra.conf ]
+then
+    cp /etc/quagga/zebra.conf /etc/quagga/zebra.conf_bak fi
+
+if [ -f /etc/quagga/ospfd.conf ]
+then
+    cp /etc/quagga/ospfd.conf /etc/quagga/ospfd.conf_bak fi
+
+cp data/zebra.conf /etc/quagga/zebra.conf cp data/ospfd.conf 
+/etc/quagga/ospfd.conf chown quagga:quagga /etc/quagga/*.conf
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target zebra start
+    exec_service_on_target ospfd start else
+    /etc/init.d/quagga start zebra
+    /etc/init.d/quagga start ospfd
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/ospfd"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of ospfd."
+    echo " -> $test: TEST-FAIL"
+fi

engine/tests/Functional.demo/tests/demo_ospfd.sh line 78

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_ospfd.sh new file +10 -0
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ospfd stop
+    exec_service_on_target zebra stop else
+    /etc/init.d/quagga stop ospfd
+    /etc/init.d/quagga stop zebra
+fi
+
+restore_target

Same issue here as with other tests. Need to leave board in same state we found it.

Quoted 1 line

--

Thank you for this submission. I'm sorry it's taken this long to review patches from the "Functional.demo" suite. Please let me know how you'd like to proceed (either by refactoring this test into multiple test of individual functionality, or by renaming "Functional.demo" to something less generic.)

My preference is to refactor.

Regards,
-- Tim

#3 lore raw

PATCH 1/1 demo: Add test cases of service pcscd, postfix, pppoe-server and ptpd.

In reply to Wang Mingyu

From: root <[email protected]>

---
 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
engine/tests/Functional.demo/tests/demo_pcscd.sh new file +41 -0
new file mode 100644
index 0000000..f7e5981
@@ -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
engine/tests/Functional.demo/tests/demo_postfix.sh new file +30 -0
new file mode 100644
index 0000000..b6059c7
@@ -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
engine/tests/Functional.demo/tests/demo_pppoe-server.sh new file +41 -0

41 lines not on this page · raw message

engine/tests/Functional.demo/tests/demo_ptpd.sh new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#4 lore raw

Re: [Fuego] [PATCH] demo: Add test cases of service pcscd, postfix, pppoe-server and ptpd.

Quoted 6 lines

-----Original Message-----
From: Wang Mingyu

From: root <[email protected]>

This is not right.

Quoted 1 line

This is missing the patch description in the body of the commit message.

Quoted 1 line

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

Quoted 22 lines
---
 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
engine/tests/Functional.demo/tests/demo_pcscd.sh new file +0 -0
new file mode 100644
index 0000000..f7e5981

See my previous message about Functional.demo.
I'd like this set of tests refactored.

Quoted 33 lines
engine/tests/Functional.demo/tests/demo_pcscd.sh new file +3 -0
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#  In the target start pcscd, and confirm the process condition by command

ps.

engine/tests/Functional.demo/tests/demo_pcscd.sh new file +28 -0
+
+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

engine/tests/Functional.demo/tests/demo_pcscd.sh line 41

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_pcscd.sh new file +10 -0
+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.

Quoted 28 lines
engine/tests/Functional.demo/tests/demo_postfix.sh new file +3 -0
new file mode 100644
index 0000000..b6059c7
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#  In the target start postfix, and confirm the process condition by command

ps.

engine/tests/Functional.demo/tests/demo_postfix.sh new file +17 -0
+
+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

engine/tests/Functional.demo/tests/demo_postfix.sh line 30

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_postfix.sh new file +10 -0
+
+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.

Quoted 39 lines
engine/tests/Functional.demo/tests/demo_pppoe-server.sh new file +3 -0
new file mode 100644
index 0000000..ee4536c
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#  In the target start pppoe-server, and confirm the process condition by

command ps.

engine/tests/Functional.demo/tests/demo_pppoe-server.sh new file +28 -0
+
+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

engine/tests/Functional.demo/tests/demo_pppoe-server.sh line 41

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_pppoe-server.sh new file +10 -0
+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.

Quoted 50 lines
engine/tests/Functional.demo/tests/demo_ptpd.sh new file +3 -0
new file mode 100644
index 0000000..18f9b3a
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#  In the target start ptpd, and confirm the process condition by command

ps.

engine/tests/Functional.demo/tests/demo_ptpd.sh new file +38 -1
+
+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
--
Quoted 1 line

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

#5 lore raw

PATCH 1/1 demo: Add test cases of service snmpd, snmptrapd, sshd, syslog-ng and sysstat.

In reply to Wang Mingyu

From: root <[email protected]>

---
 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
engine/tests/Functional.demo/tests/demo_snmpd.sh new file +39 -0
new file mode 100644
index 0000000..d33f08e
@@ -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
engine/tests/Functional.demo/tests/demo_snmptrapd.sh new file +39 -0
new file mode 100644
index 0000000..0f30219
@@ -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
engine/tests/Functional.demo/tests/demo_sshd.sh new file +19 -0
new file mode 100644
index 0000000..f42d3fb
@@ -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
engine/tests/Functional.demo/tests/demo_syslog-ng.sh new file +39 -0
new file mode 100644
index 0000000..71303fc
@@ -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
engine/tests/Functional.demo/tests/demo_sysstat.sh new file +20 -0
new file mode 100644
index 0000000..442841e
@@ -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
Signature · 1 line
1.8.3.1
#6 lore raw

Re: [Fuego] [PATCH] demo: Add test cases of service snmpd, snmptrapd, sshd, syslog-ng and sysstat.

Quoted 6 lines

-----Original Message-----
From: Wang Mingyu

From: root <[email protected]>

This is not right.

Also, need a description of the patch here.

Quoted 2 lines

This is not right. Please submit with a valid Signed-off-by.

engine/tests/Functional.demo/tests/demo_snmpd.sh

Quoted 20 lines
---
 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
engine/tests/Functional.demo/tests/demo_snmpd.sh +0 -0

Same factoring issue as mentioned in other e-mail.

Quoted 35 lines

new file mode 100644
index 0000000..d33f08e

engine/tests/Functional.demo/tests/demo_snmpd.sh new file +3 -0
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#  In the target start snmpd, and confirm the process condition by command

ps.

engine/tests/Functional.demo/tests/demo_snmpd.sh new file +26 -0
+
+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
+

engine/tests/Functional.demo/tests/demo_snmpd.sh line 39

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_snmpd.sh new file +10 -0
+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

Same "leave board as you found it" issue as mentioned previously.

Quoted 37 lines
engine/tests/Functional.demo/tests/demo_snmptrapd.sh new file +3 -0
new file mode 100644
index 0000000..0f30219
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#  In the target start snmptrapd, and confirm the process condition by

command ps.

engine/tests/Functional.demo/tests/demo_snmptrapd.sh new file +26 -0
+
+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
+

engine/tests/Functional.demo/tests/demo_snmptrapd.sh line 39

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_snmptrapd.sh new file +10 -0
+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

Same "leave board as you found it" issue as mentioned previously.

Quoted 17 lines
engine/tests/Functional.demo/tests/demo_sshd.sh new file +3 -0
new file mode 100644
index 0000000..f42d3fb
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+#  In the target start sshd, and confirm the process condition by command

ps.

engine/tests/Functional.demo/tests/demo_sshd.sh new file +6 -0
+
+test="sshd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager

engine/tests/Functional.demo/tests/demo_sshd.sh line 19

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_sshd.sh new file +10 -0
+
+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

Same "leave board as you found it" issue as mentioned previously.

Quoted 37 lines
engine/tests/Functional.demo/tests/demo_syslog-ng.sh new file +3 -0
new file mode 100644
index 0000000..71303fc
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#  In the target start syslog-ng, and confirm the process condition by

command ps.

engine/tests/Functional.demo/tests/demo_syslog-ng.sh new file +26 -0
+
+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
+

engine/tests/Functional.demo/tests/demo_syslog-ng.sh line 39

Quoted 10 lines
engine/tests/Functional.demo/tests/demo_syslog-ng.sh new file +10 -0
+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

Same "leave board as you found it" issue as mentioned previously.

Quoted 29 lines
engine/tests/Functional.demo/tests/demo_sysstat.sh new file +3 -0
new file mode 100644
index 0000000..442841e
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+#  In the target start sysstat, and confirm the process condition by command

ps.

engine/tests/Functional.demo/tests/demo_sysstat.sh new file +17 -1
+
+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
--
Quoted 1 line

1.8.3.1

Same "leave board as you found it" issue as mentioned previously.

Thanks,
-- Tim

#7 lore raw

PATCH 1/1 demo: Add test cases of service radvd, rarpd, ripd, ripngd and rpcbind.

In reply to Wang Mingyu

From: root <[email protected]>

---
 engine/tests/Functional.demo/tests/demo_radvd.sh   | 59 ++++++++++++++++
 engine/tests/Functional.demo/tests/demo_rarpd.sh   | 41 ++++++++++++
 engine/tests/Functional.demo/tests/demo_ripd.sh    | 78 ++++++++++++++++++++++
 engine/tests/Functional.demo/tests/demo_ripngd.sh  | 78 ++++++++++++++++++++++
 engine/tests/Functional.demo/tests/demo_rpcbind.sh | 41 ++++++++++++
 5 files changed, 297 insertions(+)
 create mode 100644 engine/tests/Functional.demo/tests/demo_radvd.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_rarpd.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_ripd.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_ripngd.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_rpcbind.sh
engine/tests/Functional.demo/tests/demo_radvd.sh new file +59 -0
new file mode 100644
index 0000000..ed157d2
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+#  In the target start radvd, and confirm the process condition by command ps.
+
+test="radvd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+if [ -f /etc/radvd.conf ]
+then
+    cp /etc/radvd.conf /etc/radvd.conf_bak
+fi
+
+restore_target() {
+    if [ -f /etc/radvd.conf_bak ]
+    then
+        mv /etc/radvd.conf_bak /etc/radvd.conf
+    else
+        rm -f /etc/radvd.conf
+    fi
+}
+
+cp data/radvd.conf /etc/radvd.conf
+
+exec_service_on_target radvd stop
+
+if exec_service_on_target radvd start
+then
+    echo " -> start of radvd succeeded."
+else
+    echo " -> start of radvd failed."
+    echo " -> $test: TEST-FAIL"
+    restore_target
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/radvd"
+then
+    echo " -> get the process of radvd."
+else
+    echo " -> can't get the process of radvd."
+    echo " -> $test: TEST-FAIL"
+    exec_service_on_target radvd stop
+    exit
+fi
+
+exec_service_on_target radvd stop
+
+if ps aux | grep "[/]usr/sbin/radvd"
+then
+    echo " -> $test: TEST-FAIL"
+else
+    echo " -> $test: TEST-PASS"
+fi
+restore_target
engine/tests/Functional.demo/tests/demo_rarpd.sh new file +41 -0

41 lines not on this page · raw message

engine/tests/Functional.demo/tests/demo_ripd.sh new file +78 -0

78 lines not on this page · raw message

engine/tests/Functional.demo/tests/demo_ripngd.sh new file +78 -0

78 lines not on this page · raw message

engine/tests/Functional.demo/tests/demo_rpcbind.sh new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#8 lore raw

PATCH 1/1 demo: Add test cases of service saslauthd, sblim-sfcb, sensord and smartd.

In reply to Wang Mingyu

From: root <[email protected]>

---
 .../tests/Functional.demo/tests/demo_saslauthd.sh  | 41 ++++++++++++++++++++++
 .../tests/Functional.demo/tests/demo_sblim-sfcb.sh | 22 ++++++++++++
 engine/tests/Functional.demo/tests/demo_sensord.sh | 39 ++++++++++++++++++++
 engine/tests/Functional.demo/tests/demo_smartd.sh  | 41 ++++++++++++++++++++++
 4 files changed, 143 insertions(+)
 create mode 100644 engine/tests/Functional.demo/tests/demo_saslauthd.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_sblim-sfcb.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_sensord.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_smartd.sh
engine/tests/Functional.demo/tests/demo_saslauthd.sh new file +41 -0
new file mode 100644
index 0000000..caaba7b
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#  In the target start saslauthd, and confirm the process condition by command ps.
+
+test="saslauthd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target saslauthd stop
+
+if exec_service_on_target saslauthd start
+then
+    echo " -> start of saslauthd succeeded."
+else
+    echo " -> start of saslauthd failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/saslauthd"
+then
+    echo " -> get the process of saslauthd."
+else
+    echo " -> can't get the process of saslauthd."
+    echo " -> $test: TEST-FAIL"
+    exec_service_on_target saslauthd stop
+    exit
+fi
+
+exec_service_on_target saslauthd stop
+
+if ps aux | grep "[/]usr/sbin/saslauthd"
+then
+    echo " -> $test: TEST-FAIL"
+else
+    echo " -> $test: TEST-PASS"
+fi
engine/tests/Functional.demo/tests/demo_sblim-sfcb.sh new file +22 -0
new file mode 100644
index 0000000..0d85333
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+#  In the target start sblim-sfcb, and confirm the process condition by command ps.
+
+test="sblim-sfcb"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target sblim-sfcb stop
+
+if exec_service_on_target sblim-sfcb start
+then
+    echo " -> start of sblim-sfcb succeeded."
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> start of sblim-sfcb failed."
+    echo " -> $test: TEST-FAIL"
+fi
+
+exec_service_on_target sblim-sfcb stop
engine/tests/Functional.demo/tests/demo_sensord.sh new file +39 -0
new file mode 100644
index 0000000..d53ed16
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#  In the target start sensord, and confirm the process condition by command ps.
+
+test="sensord"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target sensord stop
+
+if ps aux | grep "[/]usr/sbin/sensord"
+then
+    echo " -> $test: TEST-FAIL"
+    exit
+else
+    echo " -> no progress when service is shutdown"
+fi
+
+if exec_service_on_target sensord start
+then
+    echo " -> start of sensord succeeded."
+else
+    echo " -> start of sensord failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/sensord"
+then
+    echo " -> get the process of sensord."
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of sensord."
+    echo " -> $test: TEST-FAIL"
+fi
engine/tests/Functional.demo/tests/demo_smartd.sh new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#9 lore raw

PATCH 1/1 demo: Add test cases of service uuidd, vsftpd, wpa_supplicant, xinetd, zabiix_agentd and zebra.

In reply to Wang Mingyu

From: root <[email protected]>

---
 engine/tests/Functional.demo/tests/demo_uuidd.sh   | 41 ++++++++++++
 engine/tests/Functional.demo/tests/demo_vsftpd.sh  | 39 +++++++++++
 .../Functional.demo/tests/demo_wpa_supplicant.sh   | 41 ++++++++++++
 engine/tests/Functional.demo/tests/demo_xinetd.sh  | 30 +++++++++
 .../Functional.demo/tests/demo_zabiix_agentd.sh    | 41 ++++++++++++
 engine/tests/Functional.demo/tests/demo_zebra.sh   | 76 ++++++++++++++++++++++
 6 files changed, 268 insertions(+)
 create mode 100644 engine/tests/Functional.demo/tests/demo_uuidd.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_vsftpd.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_wpa_supplicant.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_xinetd.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_zabiix_agentd.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_zebra.sh
engine/tests/Functional.demo/tests/demo_uuidd.sh new file +41 -0
new file mode 100644
index 0000000..30ae2a3
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#  In the target start uuidd, and confirm the process condition by command ps.
+
+test="uuidd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+if uuidd -p /tmp/uuidd.pid -s /tmp/uuidd.socket
+then
+    echo " -> create of uuidd succeeded."
+else
+    echo " -> create of uuidd failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]tmp/uuidd"
+then
+    echo " -> get the process of uuidd."
+else
+    echo " -> can't get the process of uuidd."
+    echo " -> $test: TEST-FAIL"
+    uuidd -d -r -n 5 -s /tmp/uuidd.socket
+    uuidd -d -k -s /tmp/uuidd.socket
+    exit
+fi
+
+uuidd -d -r -n 5 -s /tmp/uuidd.socket
+uuidd -d -k -s /tmp/uuidd.socket
+
+if ps aux | grep "[/]tmp/uuidd"
+then
+    echo " -> $test: TEST-FAIL"
+else
+    echo " -> $test: TEST-PASS"
+fi
engine/tests/Functional.demo/tests/demo_vsftpd.sh new file +39 -0
new file mode 100644
index 0000000..38518d4
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#  In the target start vsftpd, and confirm the process condition by command ps.
+
+test="vsftpd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target vsftpd stop
+
+if ps aux | grep "[/]usr/sbin/vsftpd"
+then
+    echo " -> $test: TEST-FAIL"
+    exit
+else
+    echo " -> no progress when service is shutdown"
+fi
+
+if exec_service_on_target vsftpd start
+then
+    echo " -> start of vsftpd succeeded."
+else
+    echo " -> start of vsftpd failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/vsftpd"
+then
+    echo " -> get the process of vsftpd."
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of vsftpd."
+    echo " -> $test: TEST-FAIL"
+fi
engine/tests/Functional.demo/tests/demo_wpa_supplicant.sh new file +41 -0

41 lines not on this page · raw message

engine/tests/Functional.demo/tests/demo_xinetd.sh new file +30 -0
new file mode 100644
index 0000000..2bd7dee
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#  In the target start xinetd, and confirm the process condition by command ps.
+
+test="xinetd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+if exec_service_on_target xinetd is-active
+then
+    echo " -> xinetd is active."
+else
+    echo " -> xinetd is not active."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/xinetd"
+then
+    echo " -> get the process of xinetd."
+else
+    echo " -> can't get the process of xinetd."
+    echo " -> $test: TEST-FAIL"
+    exec_service_on_target xinetd stop
+    exit
+fi
engine/tests/Functional.demo/tests/demo_zabiix_agentd.sh new file +41 -0

41 lines not on this page · raw message

engine/tests/Functional.demo/tests/demo_zebra.sh new file +76 -0

76 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#10 lore raw

PATCH 1/1 demo: Add test cases of service openct, openhpid, openldap and opensafd.

In reply to Wang Mingyu
---
 engine/tests/Functional.demo/tests/demo_openct.sh  | 39 ++++++++++++
 .../tests/Functional.demo/tests/demo_openhpid.sh   | 22 +++++++
 .../tests/Functional.demo/tests/demo_openldap.sh   | 44 +++++++++++++
 .../tests/Functional.demo/tests/demo_opensafd.sh   | 72 ++++++++++++++++++++++
 4 files changed, 177 insertions(+)
 create mode 100644 engine/tests/Functional.demo/tests/demo_openct.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_openhpid.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_openldap.sh
 create mode 100644 engine/tests/Functional.demo/tests/demo_opensafd.sh
engine/tests/Functional.demo/tests/demo_openct.sh new file +39 -0
new file mode 100644
index 0000000..29c5175
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#  In the target start openct, and confirm the process condition by command ps.
+
+test="openct"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target openct stop
+
+if exec_service_on_target openct start
+then
+    echo " -> start of openct succeeded."
+else
+    echo " -> start of openct failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+if [ "$init_manager" = "systemd" ]
+then
+    if exec_service_on_target openct is-active
+    then
+        echo " -> $test: TEST-PASS"
+    else
+        echo " -> $test: TEST-FAIL"
+    fi
+else
+    if /etc/init.d/openct status | grep "Waiting for reader attach/detach events"
+    then
+        echo " -> $test: TEST-PASS"
+    else
+        echo " -> $test: TEST-FAIL"
+    fi
+fi
+
+exec_service_on_target openct stop
engine/tests/Functional.demo/tests/demo_openhpid.sh new file +22 -0
new file mode 100644
index 0000000..e0c9419
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+#  In the target start openhpid, and confirm the process condition by command ps.
+
+test="openhpid"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target openhpid stop
+
+if exec_service_on_target openhpid start
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> start of openhpid failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+exec_service_on_target openhpid stop
engine/tests/Functional.demo/tests/demo_openldap.sh new file +44 -0

44 lines not on this page · raw message

engine/tests/Functional.demo/tests/demo_opensafd.sh new file +72 -0

72 lines not on this page · raw message

Signature · 1 line
1.8.3.1