aboutsummaryrefslogtreecommitdiffstats
path: root/meta-ivi-test/recipes-extended/node-health-monitor
diff options
context:
space:
mode:
Diffstat (limited to 'meta-ivi-test/recipes-extended/node-health-monitor')
-rw-r--r--meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor/node-health-monitor_t.inc45
-rw-r--r--meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor_%.bbappend9
2 files changed, 53 insertions, 1 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 $*
+}
diff --git a/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor_%.bbappend b/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor_%.bbappend
index fa2055a..fbe0ad1 100644
--- a/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor_%.bbappend
+++ b/meta-ivi-test/recipes-extended/node-health-monitor/node-health-monitor_%.bbappend
@@ -1,6 +1,11 @@
#
# for test
#
+FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+SRC_URI_append += " \
+ file://${BPN}_t.inc \
+ "
+
do_compile_append() {
make -C tst nhm-main-test
make -C tst nhm-systemd-test
@@ -11,6 +16,8 @@ do_install_append() {
install -m 0755 ${S}/tst/nhm-main-test ${D}/opt/tests/${PN}
install -m 0755 ${S}/tst/nhm-systemd-test ${D}/opt/tests/${PN}
ln -s /etc ${D}/opt/tests/cfg
+
+ install -m 0755 ${WORKDIR}/${BPN}_t.inc ${D}/opt/tests/${PN}
}
PACKAGES += "${PN}-test"
@@ -20,6 +27,6 @@ FILES_${PN}-dbg += " \
/opt/tests/${PN}/.debug/* \
"
FILES_${PN}-test = " \
- /opt/tests/${PN}/* \
+ /opt/tests/${PN}/ \
/opt/tests/cfg \
"