[Fuego] [PATCH] demo: Add test cases for command bgpd, bind, bluetooth and crond.
Wang Mingyu
wangmy at cn.fujitsu.com
Wed Sep 26 07:54:32 UTC 2018
Signed-off-by: Wang Mingyu <wangmy at cn.fujitsu.com>
---
engine/tests/Functional.demo/tests/demo_bgpd.sh | 41 ++++++++++++++++++++++
engine/tests/Functional.demo/tests/demo_bind.sh | 41 ++++++++++++++++++++++
.../tests/Functional.demo/tests/demo_bluetooth.sh | 29 +++++++++++++++
engine/tests/Functional.demo/tests/demo_crond.sh | 41 ++++++++++++++++++++++
4 files changed, 152 insertions(+)
create mode 100644 engine/tests/Functional.demo/tests/demo_bgpd.sh
create mode 100644 engine/tests/Functional.demo/tests/demo_bind.sh
create mode 100644 engine/tests/Functional.demo/tests/demo_bluetooth.sh
create mode 100644 engine/tests/Functional.demo/tests/demo_crond.sh
diff --git a/engine/tests/Functional.demo/tests/demo_bgpd.sh b/engine/tests/Functional.demo/tests/demo_bgpd.sh
new file mode 100644
index 0000000..1b5c2e8
--- /dev/null
+++ b/engine/tests/Functional.demo/tests/demo_bgpd.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# In the target start bgpd, and confirm the process condition by command ps.
+
+test="bgpd"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target bgpd stop
+
+if exec_service_on_target bgpd start
+then
+ echo " -> start of bgpd succeeded."
+else
+ echo " -> start of bgpd failed."
+ echo " -> $test: TEST-FAIL"
+ exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/bgpd"
+then
+ echo " -> get the process of bgpd."
+else
+ echo " -> can't get the process of bgpd."
+ echo " -> $test: TEST-FAIL"
+ exec_service_on_target bgpd stop
+ exit
+fi
+
+exec_service_on_target bgpd stop
+
+if ps aux | grep "[/]usr/sbin/bgpd"
+then
+ echo " -> $test: TEST-FAIL"
+else
+ echo " -> $test: TEST-PASS"
+fi
diff --git a/engine/tests/Functional.demo/tests/demo_bind.sh b/engine/tests/Functional.demo/tests/demo_bind.sh
new file mode 100644
index 0000000..c27c26f
--- /dev/null
+++ b/engine/tests/Functional.demo/tests/demo_bind.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# In the target start bind, and confirm the process condition by command ps.
+
+test="bind"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target named stop
+
+if exec_service_on_target named start
+then
+ echo " -> start of named succeeded."
+else
+ echo " -> start of named failed."
+ echo " -> $test: TEST-FAIL"
+ exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/named"
+then
+ echo " -> get the process of named."
+else
+ echo " -> can't get the process of named."
+ echo " -> $test: TEST-FAIL"
+ exec_service_on_target named stop
+ exit
+fi
+
+exec_service_on_target named stop
+
+if ps aux | grep "[/]usr/sbin/named"
+then
+ echo " -> $test: TEST-FAIL"
+else
+ echo " -> $test: TEST-PASS"
+fi
diff --git a/engine/tests/Functional.demo/tests/demo_bluetooth.sh b/engine/tests/Functional.demo/tests/demo_bluetooth.sh
new file mode 100644
index 0000000..e7c6e9c
--- /dev/null
+++ b/engine/tests/Functional.demo/tests/demo_bluetooth.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# In the target start bluetooth, and confirm the process condition by command ps.
+
+test="bluetooth"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target bluetooth stop
+
+if exec_service_on_target bluetooth start
+then
+ echo " -> start of bluetooth succeeded."
+else
+ echo " -> start of bluetooth failed."
+ echo " -> $test: TEST-FAIL"
+ exit
+fi
+
+sleep 5
+
+if hciconfig | grep hci0
+then
+ echo " -> $test: TEST-FAIL"
+else
+ echo " -> $test: TEST-PASS"
+fi
diff --git a/engine/tests/Functional.demo/tests/demo_crond.sh b/engine/tests/Functional.demo/tests/demo_crond.sh
new file mode 100644
index 0000000..901ee01
--- /dev/null
+++ b/engine/tests/Functional.demo/tests/demo_crond.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# In the target start crond, and confirm the process condition by command ps.
+
+test="crond"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+exec_service_on_target crond stop
+
+if exec_service_on_target crond start
+then
+ echo " -> start of crond succeeded."
+else
+ echo " -> start of crond failed."
+ echo " -> $test: TEST-FAIL"
+ exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/crond"
+then
+ echo " -> get the process of crond."
+else
+ echo " -> can't get the process of crond."
+ echo " -> $test: TEST-FAIL"
+ exec_service_on_target crond stop
+ exit
+fi
+
+exec_service_on_target crond stop
+
+if ps aux | grep "[/]usr/sbin/crond"
+then
+ echo " -> $test: TEST-FAIL"
+else
+ echo " -> $test: TEST-PASS"
+fi
--
1.8.3.1
More information about the Fuego
mailing list