aboutsummaryrefslogtreecommitdiffstats
path: root/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor/node-health-monitor_t.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor/node-health-monitor_t.inc')
-rw-r--r--meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor/node-health-monitor_t.inc45
1 files changed, 45 insertions, 0 deletions
diff --git a/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor/node-health-monitor_t.inc b/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor/node-health-monitor_t.inc
new file mode 100644
index 0000000..2afbc92
--- /dev/null
+++ b/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor/node-health-monitor_t.inc
@@ -0,0 +1,45 @@
+#!/bin/sh
+get_list() {
+ return 2
+}
+
+get_title() {
+ echo "Node Health Monitor"
+}
+
+_run_dir=/opt/tests/node-health-monitor
+_run_() {
+ systemctl start nsm-dummy
+ node-health-monitor &
+
+ cd ${_run_dir}
+ ./${1}
+
+ kill -9 `pidof node-health-monitor`
+ systemctl stop nsm-dummy
+}
+
+_run() {
+ echo "[ FAILED ] node-head-monitor is not working properly"
+ return 0
+
+ if [ "x${2}" != "x" ]; then
+ _run_ $1 > /tmp/t 2> /tmp/t.err
+ _c1=$?
+ if [ "x${_c1}" = "x0" ]; then
+ echo "[ PASSED ]"
+ else
+ echo "[ FAILED ]"
+ fi
+ else
+ _run_ $1 2> /tmp/t.err
+ fi
+}
+
+run_1() {
+ _run nhm-main-test $*
+}
+
+run_2() {
+ _run nhm-systemd-test $*
+}