All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Mingyu <wangmy@cn.fujitsu.com>
To: fuego@lists.linuxfoundation.org
Subject: [Fuego] [PATCH v2] Add test case of service ipmi.
Date: Wed, 6 Mar 2019 01:02:08 -0800	[thread overview]
Message-ID: <1551862932-129342-1-git-send-email-wangmy@cn.fujitsu.com> (raw)

IPMI is a set of standardized specifications for hardware-based platform management
systems making it possible to control and monitor servers centrally.
This test set is used to check if process can be generated.

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 tests/Functional.ipmi/fuego_test.sh    | 18 ++++++++++++++++++
 tests/Functional.ipmi/ipmi_test.sh     |  4 ++++
 tests/Functional.ipmi/parser.py        | 22 ++++++++++++++++++++++
 tests/Functional.ipmi/spec.json        |  7 +++++++
 tests/Functional.ipmi/tests/ipmi_ps.sh | 26 ++++++++++++++++++++++++++
 5 files changed, 77 insertions(+)
 create mode 100644 tests/Functional.ipmi/fuego_test.sh
 create mode 100755 tests/Functional.ipmi/ipmi_test.sh
 create mode 100644 tests/Functional.ipmi/parser.py
 create mode 100644 tests/Functional.ipmi/spec.json
 create mode 100644 tests/Functional.ipmi/tests/ipmi_ps.sh

diff --git a/tests/Functional.ipmi/fuego_test.sh b/tests/Functional.ipmi/fuego_test.sh
new file mode 100644
index 0000000..7dd9060
--- /dev/null
+++ b/tests/Functional.ipmi/fuego_test.sh
@@ -0,0 +1,18 @@
+function test_pre_check {
+    assert_has_program openipmi-helper
+}
+
+function test_deploy {
+    put $TEST_HOME/ipmi_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/
+    put $FUEGO_CORE/scripts/fuego_board_function_lib.sh $BOARD_TESTDIR/fuego.$TESTDIR
+    put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/
+}
+
+function test_run {
+    report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\
+    ./ipmi_test.sh"
+}
+
+function test_processing {
+    log_compare "$TESTDIR" "0" "TEST-FAIL" "n"
+}
diff --git a/tests/Functional.ipmi/ipmi_test.sh b/tests/Functional.ipmi/ipmi_test.sh
new file mode 100755
index 0000000..dd5ce37
--- /dev/null
+++ b/tests/Functional.ipmi/ipmi_test.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+for i in tests/*.sh; do
+    sh $i
+done
diff --git a/tests/Functional.ipmi/parser.py b/tests/Functional.ipmi/parser.py
new file mode 100644
index 0000000..d85abd7
--- /dev/null
+++ b/tests/Functional.ipmi/parser.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+# See common.py for description of command-line arguments
+
+import os, sys, collections
+
+sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
+import common as plib
+
+measurements = {}
+measurements = collections.OrderedDict()
+
+regex_string = '^ -> (.*): TEST-(.*)$'
+matches = plib.parse_log(regex_string)
+
+if matches:
+    for m in matches:
+        measurements['default.' + m[0]] = 'PASS' if m[1] == 'PASS' else 'FAIL'
+
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, measurements)
+
+sys.exit(plib.process(measurements))
diff --git a/tests/Functional.ipmi/spec.json b/tests/Functional.ipmi/spec.json
new file mode 100644
index 0000000..9dd7151
--- /dev/null
+++ b/tests/Functional.ipmi/spec.json
@@ -0,0 +1,7 @@
+{
+    "testName": "Functional.ipmi",
+    "specs": {
+        "default": {}
+    }
+}
+
diff --git a/tests/Functional.ipmi/tests/ipmi_ps.sh b/tests/Functional.ipmi/tests/ipmi_ps.sh
new file mode 100644
index 0000000..721f505
--- /dev/null
+++ b/tests/Functional.ipmi/tests/ipmi_ps.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+#  In the target start ipmi, and confirm the process condition by command ps.
+
+test="ps"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+service_status=$(get_service_status ipmi)
+
+exec_service_on_target ipmi stop
+
+if exec_service_on_target ipmi start
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> start of ipmi failed."
+    echo " -> $test: TEST-FAIL"
+fi
+
+if [ "$service_status" = "inactive" ]
+then
+    exec_service_on_target ipmi stop
+fi
-- 
1.8.3.1




             reply	other threads:[~2019-03-06  9:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06  9:02 Wang Mingyu [this message]
2019-03-13 22:12 ` [Fuego] [PATCH v2] Add test case of service ipmi Tim.Bird

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1551862932-129342-1-git-send-email-wangmy@cn.fujitsu.com \
    --to=wangmy@cn.fujitsu.com \
    --cc=fuego@lists.linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.