[Fuego] [PATCH] demo: Add test cases of service radvd, rarpd, ripd, ripngd and rpcbind.

Wang Mingyu wangmy at cn.fujitsu.com
Wed Dec 12 08:05:55 UTC 2018


From: root <root at localhost.localdomain>

Signed-off-by: root <root at localhost.localdomain>
---
 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

diff --git a/engine/tests/Functional.demo/tests/demo_radvd.sh b/engine/tests/Functional.demo/tests/demo_radvd.sh
new file mode 100644
index 0000000..ed157d2
--- /dev/null
+++ b/engine/tests/Functional.demo/tests/demo_radvd.sh
@@ -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
diff --git a/engine/tests/Functional.demo/tests/demo_rarpd.sh b/engine/tests/Functional.demo/tests/demo_rarpd.sh
new file mode 100644
index 0000000..84b3e4e
--- /dev/null
+++ b/engine/tests/Functional.demo/tests/demo_rarpd.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#  In the target start rarpd, and confirm the process condition by command ps.
+
+test="rarpd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target rarpd stop
+
+if exec_service_on_target rarpd start
+then
+    echo " -> start of rarpd succeeded."
+else
+    echo " -> start of rarpd failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/rarpd"
+then
+    echo " -> get the process of rarpd."
+else
+    echo " -> can't get the process of rarpd."
+    echo " -> $test: TEST-FAIL"
+    exec_service_on_target rarpd stop
+    exit
+fi
+
+exec_service_on_target rarpd stop
+
+if ps aux | grep "[/]usr/sbin/rarpd"
+then
+    echo " -> $test: TEST-FAIL"
+else
+    echo " -> $test: TEST-PASS"
+fi
diff --git a/engine/tests/Functional.demo/tests/demo_ripd.sh b/engine/tests/Functional.demo/tests/demo_ripd.sh
new file mode 100644
index 0000000..dc1f5eb
--- /dev/null
+++ b/engine/tests/Functional.demo/tests/demo_ripd.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+#  In the target start ripd, and confirm the process condition by command ps.
+
+test="ripd"
+
+. ./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/ripd.conf_bak ]
+    then
+        mv /etc/quagga/ripd.conf_bak /etc/quagga/ripd.conf
+    else
+        rm -f /etc/quagga/ripd.conf
+    fi 
+}
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ripd stop
+    exec_service_on_target zebra stop
+else
+    /etc/init.d/quagga stop ripd
+    /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/ripd.conf ]
+then
+    cp /etc/quagga/ripd.conf /etc/quagga/ripd.conf_bak
+fi
+
+cp data/zebra.conf /etc/quagga/zebra.conf
+cp data/ripd.conf /etc/quagga/ripd.conf
+chown quagga:quagga /etc/quagga/*.conf
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target zebra start
+    exec_service_on_target ripd start
+else
+    /etc/init.d/quagga start zebra
+    /etc/init.d/quagga start ripd
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/ripd"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of ripd."
+    echo " -> $test: TEST-FAIL"
+fi
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ripd stop
+    exec_service_on_target zebra stop
+else
+    /etc/init.d/quagga stop ripd
+    /etc/init.d/quagga stop zebra
+fi
+
+restore_target
diff --git a/engine/tests/Functional.demo/tests/demo_ripngd.sh b/engine/tests/Functional.demo/tests/demo_ripngd.sh
new file mode 100644
index 0000000..73336ad
--- /dev/null
+++ b/engine/tests/Functional.demo/tests/demo_ripngd.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+#  In the target start ripngd, and confirm the process condition by command ps.
+
+test="ripngd"
+
+. ./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/ripngd.conf_bak ]
+    then
+        mv /etc/quagga/ripngd.conf_bak /etc/quagga/ripngd.conf
+    else
+        rm -f /etc/quagga/ripngd.conf
+    fi 
+}
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ripngd stop
+    exec_service_on_target zebra stop
+else
+    /etc/init.d/quagga stop ripngd
+    /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/ripngd.conf ]
+then
+    cp /etc/quagga/ripngd.conf /etc/quagga/ripngd.conf_bak
+fi
+
+cp data/zebra.conf /etc/quagga/zebra.conf
+cp data/ripngd.conf /etc/quagga/ripngd.conf
+chown quagga:quagga /etc/quagga/*.conf
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target zebra start
+    exec_service_on_target ripngd start
+else
+    /etc/init.d/quagga start zebra
+    /etc/init.d/quagga start ripngd
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/ripngd"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> can't get the process of ripngd."
+    echo " -> $test: TEST-FAIL"
+fi
+
+if [ "$init_manager" = "systemd" ]
+then
+    exec_service_on_target ripngd stop
+    exec_service_on_target zebra stop
+else
+    /etc/init.d/quagga stop ripngd
+    /etc/init.d/quagga stop zebra
+fi
+
+restore_target
diff --git a/engine/tests/Functional.demo/tests/demo_rpcbind.sh b/engine/tests/Functional.demo/tests/demo_rpcbind.sh
new file mode 100644
index 0000000..07db1d6
--- /dev/null
+++ b/engine/tests/Functional.demo/tests/demo_rpcbind.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#  In the target start rpcbind, and confirm the process condition by command ps.
+
+test="rpcbind"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target rpcbind stop
+
+if exec_service_on_target rpcbind start
+then
+    echo " -> start of rpcbind succeeded."
+else
+    echo " -> start of rpcbind failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/rpcbind"
+then
+    echo " -> get the process of rpcbind."
+else
+    echo " -> can't get the process of rpcbind."
+    echo " -> $test: TEST-FAIL"
+    exec_service_on_target rpcbind stop
+    exit
+fi
+
+exec_service_on_target rpcbind stop
+
+if ps aux | grep "[/]usr/sbin/rpcbind"
+then
+    echo " -> $test: TEST-FAIL"
+else
+    echo " -> $test: TEST-PASS"
+fi
-- 
1.8.3.1





More information about the Fuego mailing list