All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission.
@ 2018-09-04 11:32 Wang Mingyu
  2018-09-04 11:32 ` [Fuego] [PATCH] iperf: Add test cases for command iperf Wang Mingyu
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Wang Mingyu @ 2018-09-04 11:32 UTC (permalink / raw)
  To: fuego

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 engine/tests/Functional.busybox/tests/busybox_umount.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/engine/tests/Functional.busybox/tests/busybox_umount.sh b/engine/tests/Functional.busybox/tests/busybox_umount.sh
index 8688a20..dc07c4b 100644
--- a/engine/tests/Functional.busybox/tests/busybox_umount.sh
+++ b/engine/tests/Functional.busybox/tests/busybox_umount.sh
@@ -6,7 +6,7 @@
 test="umount"
 
 mkdir test_dir
-mount -n -t tmpfs none test_dir
+mount -t tmpfs none test_dir
 
 if mount | grep "none on .*test_dir"
 then
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Fuego] [PATCH] iperf: Add test cases for command iperf.
  2018-09-04 11:32 [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Wang Mingyu
@ 2018-09-04 11:32 ` Wang Mingyu
  2018-09-04 11:32 ` [Fuego] [PATCH] libxml: Add test cases for command libxml Wang Mingyu
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Wang Mingyu @ 2018-09-04 11:32 UTC (permalink / raw)
  To: fuego

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 engine/tests/Functional.iperf/fuego_test.sh        | 18 +++++++++++++++
 engine/tests/Functional.iperf/iperf_test.sh        |  4 ++++
 engine/tests/Functional.iperf/parser.py            | 22 ++++++++++++++++++
 engine/tests/Functional.iperf/spec.json            |  7 ++++++
 engine/tests/Functional.iperf/tests/iperf_help.sh  | 13 +++++++++++
 .../tests/Functional.iperf/tests/iperf_server1.sh  | 26 ++++++++++++++++++++++
 .../tests/Functional.iperf/tests/iperf_server2.sh  | 18 +++++++++++++++
 .../tests/Functional.iperf/tests/iperf_server3.sh  | 22 ++++++++++++++++++
 .../tests/Functional.iperf/tests/iperf_server4.sh  | 22 ++++++++++++++++++
 .../tests/Functional.iperf/tests/iperf_server5.sh  | 18 +++++++++++++++
 .../tests/Functional.iperf/tests/iperf_server6.sh  | 23 +++++++++++++++++++
 .../tests/Functional.iperf/tests/iperf_version.sh  | 13 +++++++++++
 12 files changed, 206 insertions(+)
 create mode 100644 engine/tests/Functional.iperf/fuego_test.sh
 create mode 100644 engine/tests/Functional.iperf/iperf_test.sh
 create mode 100644 engine/tests/Functional.iperf/parser.py
 create mode 100644 engine/tests/Functional.iperf/spec.json
 create mode 100644 engine/tests/Functional.iperf/tests/iperf_help.sh
 create mode 100644 engine/tests/Functional.iperf/tests/iperf_server1.sh
 create mode 100644 engine/tests/Functional.iperf/tests/iperf_server2.sh
 create mode 100644 engine/tests/Functional.iperf/tests/iperf_server3.sh
 create mode 100644 engine/tests/Functional.iperf/tests/iperf_server4.sh
 create mode 100644 engine/tests/Functional.iperf/tests/iperf_server5.sh
 create mode 100644 engine/tests/Functional.iperf/tests/iperf_server6.sh
 create mode 100644 engine/tests/Functional.iperf/tests/iperf_version.sh

diff --git a/engine/tests/Functional.iperf/fuego_test.sh b/engine/tests/Functional.iperf/fuego_test.sh
new file mode 100644
index 0000000..0264591
--- /dev/null
+++ b/engine/tests/Functional.iperf/fuego_test.sh
@@ -0,0 +1,18 @@
+function test_pre_check {
+    is_on_target_path iperf3 PROGRAM_IPERF
+    assert_define PROGRAM_IPERF "Missing 'iperf3' program on target board"
+}
+
+function test_deploy {
+    put $TEST_HOME/iperf_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/
+    put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/
+}
+
+function test_run {
+    report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\
+    sh -v iperf_test.sh"
+}
+
+function test_processing {
+    log_compare "$TESTDIR" "0" "TEST-FAIL" "n"
+}
diff --git a/engine/tests/Functional.iperf/iperf_test.sh b/engine/tests/Functional.iperf/iperf_test.sh
new file mode 100644
index 0000000..dd5ce37
--- /dev/null
+++ b/engine/tests/Functional.iperf/iperf_test.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+for i in tests/*.sh; do
+    sh $i
+done
diff --git a/engine/tests/Functional.iperf/parser.py b/engine/tests/Functional.iperf/parser.py
new file mode 100644
index 0000000..d85abd7
--- /dev/null
+++ b/engine/tests/Functional.iperf/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/engine/tests/Functional.iperf/spec.json b/engine/tests/Functional.iperf/spec.json
new file mode 100644
index 0000000..f0b47e9
--- /dev/null
+++ b/engine/tests/Functional.iperf/spec.json
@@ -0,0 +1,7 @@
+{
+    "testName": "Functional.iperf",
+    "specs": {
+        "default": {}
+    }
+}
+
diff --git a/engine/tests/Functional.iperf/tests/iperf_help.sh b/engine/tests/Functional.iperf/tests/iperf_help.sh
new file mode 100644
index 0000000..8c3c629
--- /dev/null
+++ b/engine/tests/Functional.iperf/tests/iperf_help.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  Test command iperf3 on target.
+#  Opiton : --help
+
+test="help"
+
+if iperf3 --help | grep "Usage"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
diff --git a/engine/tests/Functional.iperf/tests/iperf_server1.sh b/engine/tests/Functional.iperf/tests/iperf_server1.sh
new file mode 100644
index 0000000..6431159
--- /dev/null
+++ b/engine/tests/Functional.iperf/tests/iperf_server1.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+#  Test command iperf3 on target.
+#  Opiton : server(TCP)
+
+test="server1"
+
+killall -KILL iperf3
+iperf3 -s -D&
+
+sleep 10
+
+ls .
+netstat -l > iperf-test
+
+sleep 10
+
+if cat iperf-test | grep "5201"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+
+killall -KILL iperf3
+rm -f iperf-test
diff --git a/engine/tests/Functional.iperf/tests/iperf_server2.sh b/engine/tests/Functional.iperf/tests/iperf_server2.sh
new file mode 100644
index 0000000..2e87a6f
--- /dev/null
+++ b/engine/tests/Functional.iperf/tests/iperf_server2.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+#  Test command iperf3 on target.
+#  Opiton : server(UDP)
+
+test="server2"
+
+killall -KILL iperf3
+iperf3 -s -D
+
+if netstat -l | grep "5201"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+
+killall -KILL iperf3
diff --git a/engine/tests/Functional.iperf/tests/iperf_server3.sh b/engine/tests/Functional.iperf/tests/iperf_server3.sh
new file mode 100644
index 0000000..fd65fd1
--- /dev/null
+++ b/engine/tests/Functional.iperf/tests/iperf_server3.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+#  Test command iperf3 on target.
+#  Opiton : server(TCP port 6000)
+
+test="server3"
+
+killall -KILL iperf3
+
+expect <<-EOF
+spawn iperf3 -s -p 6000&
+expect {
+ -re ".*Server listening on 6000.*" {
+           send_user " -> $test: TEST-PASS\n"
+          }
+ default { send_user " -> $test: TEST-FAIL\n" }  }
+send "\n"
+expect eof
+EOF
+
+killall -KILL iperf3
+
diff --git a/engine/tests/Functional.iperf/tests/iperf_server4.sh b/engine/tests/Functional.iperf/tests/iperf_server4.sh
new file mode 100644
index 0000000..fcc6d55
--- /dev/null
+++ b/engine/tests/Functional.iperf/tests/iperf_server4.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+#  Test command iperf3 on target.
+#  Opiton : -c
+
+test="server4"
+
+killall -KILL iperf3
+iperf3 -s -D&
+
+iperf3 -c 127.0.0.1 > log
+sleep 5
+
+if cat log | grep "connected"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+
+killall -KILL iperf3
+rm log
diff --git a/engine/tests/Functional.iperf/tests/iperf_server5.sh b/engine/tests/Functional.iperf/tests/iperf_server5.sh
new file mode 100644
index 0000000..0ed432a
--- /dev/null
+++ b/engine/tests/Functional.iperf/tests/iperf_server5.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+#  Test command iperf3 on target.
+#  Opiton : -c (UDP)
+
+test="server5"
+
+killall -KILL iperf3
+iperf3 -s -D&
+
+if iperf3 -c 127.0.0.1 -u | grep "connected"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+
+killall -KILL iperf3
diff --git a/engine/tests/Functional.iperf/tests/iperf_server6.sh b/engine/tests/Functional.iperf/tests/iperf_server6.sh
new file mode 100644
index 0000000..247a22e
--- /dev/null
+++ b/engine/tests/Functional.iperf/tests/iperf_server6.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+#  Test command iperf3 on target.
+#  Opiton : -c(port opt)
+
+test="server6"
+
+killall -KILL iperf3
+iperf3 -s -D -p 6000&
+
+expect <<-EOF
+spawn iperf3 -c 127.0.0.1 -p 6000&
+expect {
+ -re ".*connected.*" {
+           send_user " -> $test: TEST-PASS\n"
+          }
+ default { send_user " -> $test: TEST-FAIL\n" }  }
+send "\n"
+expect eof
+EOF
+
+killall -KILL iperf3
+rm log
diff --git a/engine/tests/Functional.iperf/tests/iperf_version.sh b/engine/tests/Functional.iperf/tests/iperf_version.sh
new file mode 100644
index 0000000..3ab66a4
--- /dev/null
+++ b/engine/tests/Functional.iperf/tests/iperf_version.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  Test command iperf3 on target.
+#  Opiton : version
+
+test="version"
+
+if iperf3 --version | grep "iperf 3.*"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Fuego] [PATCH] libxml: Add test cases for command libxml.
  2018-09-04 11:32 [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Wang Mingyu
  2018-09-04 11:32 ` [Fuego] [PATCH] iperf: Add test cases for command iperf Wang Mingyu
@ 2018-09-04 11:32 ` Wang Mingyu
  2018-09-04 11:32 ` [Fuego] [PATCH] libtool: Add test cases for command libtool Wang Mingyu
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Wang Mingyu @ 2018-09-04 11:32 UTC (permalink / raw)
  To: fuego

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 engine/tests/Functional.libxml/fuego_test.sh       | 20 ++++++++++++++
 engine/tests/Functional.libxml/libxml_test.sh      |  4 +++
 engine/tests/Functional.libxml/parser.py           | 22 +++++++++++++++
 engine/tests/Functional.libxml/spec.json           |  7 +++++
 .../Functional.libxml/tests/xmlcatalog_create.sh   | 13 +++++++++
 .../Functional.libxml/tests/xmlcatalog_debug.sh    | 17 ++++++++++++
 .../Functional.libxml/tests/xmlcatalog_help.sh     | 13 +++++++++
 .../Functional.libxml/tests/xmllint_checkxml.sh    | 32 ++++++++++++++++++++++
 .../tests/Functional.libxml/tests/xmllint_debug.sh | 32 ++++++++++++++++++++++
 .../Functional.libxml/tests/xmllint_format.sh      | 19 +++++++++++++
 .../tests/Functional.libxml/tests/xmllint_noout.sh | 32 ++++++++++++++++++++++
 11 files changed, 211 insertions(+)
 create mode 100644 engine/tests/Functional.libxml/fuego_test.sh
 create mode 100644 engine/tests/Functional.libxml/libxml_test.sh
 create mode 100644 engine/tests/Functional.libxml/parser.py
 create mode 100644 engine/tests/Functional.libxml/spec.json
 create mode 100644 engine/tests/Functional.libxml/tests/xmlcatalog_create.sh
 create mode 100644 engine/tests/Functional.libxml/tests/xmlcatalog_debug.sh
 create mode 100644 engine/tests/Functional.libxml/tests/xmlcatalog_help.sh
 create mode 100644 engine/tests/Functional.libxml/tests/xmllint_checkxml.sh
 create mode 100644 engine/tests/Functional.libxml/tests/xmllint_debug.sh
 create mode 100644 engine/tests/Functional.libxml/tests/xmllint_format.sh
 create mode 100644 engine/tests/Functional.libxml/tests/xmllint_noout.sh

diff --git a/engine/tests/Functional.libxml/fuego_test.sh b/engine/tests/Functional.libxml/fuego_test.sh
new file mode 100644
index 0000000..d72ce19
--- /dev/null
+++ b/engine/tests/Functional.libxml/fuego_test.sh
@@ -0,0 +1,20 @@
+function test_pre_check {
+    is_on_target_path xmlcatalog PROGRAM_XMLCATALOG
+    assert_define PROGRAM_XMLCATALOG "Missing 'xmlcatalog' program on target board"
+    is_on_target_path xmllint PROGRAM_XMLLINT
+    assert_define PROGRAM_XMLLINT "Missing 'xmllint' program on target board"
+}
+
+function test_deploy {
+    put $TEST_HOME/libxml_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/
+    put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/
+}
+
+function test_run {
+    report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\
+    sh -v libxml_test.sh"
+}
+
+function test_processing {
+    log_compare "$TESTDIR" "0" "TEST-FAIL" "n"
+}
diff --git a/engine/tests/Functional.libxml/libxml_test.sh b/engine/tests/Functional.libxml/libxml_test.sh
new file mode 100644
index 0000000..dd5ce37
--- /dev/null
+++ b/engine/tests/Functional.libxml/libxml_test.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+for i in tests/*.sh; do
+    sh $i
+done
diff --git a/engine/tests/Functional.libxml/parser.py b/engine/tests/Functional.libxml/parser.py
new file mode 100644
index 0000000..d85abd7
--- /dev/null
+++ b/engine/tests/Functional.libxml/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/engine/tests/Functional.libxml/spec.json b/engine/tests/Functional.libxml/spec.json
new file mode 100644
index 0000000..af4137a
--- /dev/null
+++ b/engine/tests/Functional.libxml/spec.json
@@ -0,0 +1,7 @@
+{
+    "testName": "Functional.libxml",
+    "specs": {
+        "default": {}
+    }
+}
+
diff --git a/engine/tests/Functional.libxml/tests/xmlcatalog_create.sh b/engine/tests/Functional.libxml/tests/xmlcatalog_create.sh
new file mode 100644
index 0000000..f9426d1
--- /dev/null
+++ b/engine/tests/Functional.libxml/tests/xmlcatalog_create.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  In the target to execute command xmlcatalog and confirm the result.
+#  option : --create
+
+test="xmlcatalog2"
+
+if xmlcatalog --create | grep "DTD"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
diff --git a/engine/tests/Functional.libxml/tests/xmlcatalog_debug.sh b/engine/tests/Functional.libxml/tests/xmlcatalog_debug.sh
new file mode 100644
index 0000000..0cd8329
--- /dev/null
+++ b/engine/tests/Functional.libxml/tests/xmlcatalog_debug.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+#  In the target to execute command xmlcatalog and confirm the result.
+#  option : --create,--verbose
+
+test="xmlcatalog3"
+
+xmlcatalog --create > catalog
+xmlcatalog --verbose catalog > log 2>&1
+if cat log | grep "Catalogs cleanup"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+rm -f catalog
+rm log
diff --git a/engine/tests/Functional.libxml/tests/xmlcatalog_help.sh b/engine/tests/Functional.libxml/tests/xmlcatalog_help.sh
new file mode 100644
index 0000000..7e1b1a8
--- /dev/null
+++ b/engine/tests/Functional.libxml/tests/xmlcatalog_help.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  In the target to execute command xmlcatalog and confirm the result.
+#  option : --help
+
+test="xmlcatalog1"
+
+if xmlcatalog --help | grep "Usage"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
diff --git a/engine/tests/Functional.libxml/tests/xmllint_checkxml.sh b/engine/tests/Functional.libxml/tests/xmllint_checkxml.sh
new file mode 100644
index 0000000..1cafb57
--- /dev/null
+++ b/engine/tests/Functional.libxml/tests/xmllint_checkxml.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+#  In the target to execute command xmllint and confirm the result.
+#  option : none
+
+test="xmllint1"
+
+cat >> sample01.xml <<EOF
+<?xml version="1.0" encoding="Shift_JIS" ?>
+
+<!DOCTYPE linux[
+<!ELEMENT linux (distribution)>
+<!ELEMENT distribution (debian,redhat)>
+<!ELEMENT debian (#PCDATA)>
+<!ELEMENT redhat (#PCDATA)>
+]>
+
+<linux>
+  <distribution>
+    <debian>favorit</debian>
+    <redhat>interest</redhat>
+  </distribution>
+</linux>
+EOF
+
+if xmllint sample01.xml
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+rm sample01.xml
diff --git a/engine/tests/Functional.libxml/tests/xmllint_debug.sh b/engine/tests/Functional.libxml/tests/xmllint_debug.sh
new file mode 100644
index 0000000..6822234
--- /dev/null
+++ b/engine/tests/Functional.libxml/tests/xmllint_debug.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+#  In the target to execute command xmllint and confirm the result.
+#  option : --debug
+
+test="xmllint3"
+
+cat >> sample01.xml <<EOF
+<?xml version="1.0" encoding="Shift_JIS" ?>
+
+<!DOCTYPE linux[
+<!ELEMENT linux (distribution)>
+<!ELEMENT distribution (debian,redhat)>
+<!ELEMENT debian (#PCDATA)>
+<!ELEMENT redhat (#PCDATA)>
+]>
+
+<linux>
+  <distribution>
+    <debian>favorit</debian>
+    <redhat>interest</redhat>
+  </distribution>
+</linux>
+EOF
+
+if xmllint --debug sample01.xml | grep ".*DTD.*linux.*"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+rm sample01.xml
diff --git a/engine/tests/Functional.libxml/tests/xmllint_format.sh b/engine/tests/Functional.libxml/tests/xmllint_format.sh
new file mode 100644
index 0000000..c2ea653
--- /dev/null
+++ b/engine/tests/Functional.libxml/tests/xmllint_format.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+#  In the target to execute command xmllint and confirm the result.
+#  option : --format
+
+test="xmllint4"
+
+cat >> format.xml <<EOF
+<root><parent><child><subchild>DOCUMENT</subchild></child><child>
+<subchild>TEXT</subchild></child></parent></root>
+EOF
+
+if xmllint --format format.xml | wc -l | grep 11
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+rm format.xml
diff --git a/engine/tests/Functional.libxml/tests/xmllint_noout.sh b/engine/tests/Functional.libxml/tests/xmllint_noout.sh
new file mode 100644
index 0000000..959253d
--- /dev/null
+++ b/engine/tests/Functional.libxml/tests/xmllint_noout.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+#  In the target to execute command xmllint and confirm the result.
+#  option : --noout,--valid
+
+test="xmllint2"
+
+cat >> sample01.xml <<EOF
+<?xml version="1.0" encoding="Shift_JIS" ?>
+
+<!DOCTYPE linux[
+<!ELEMENT linux (distribution)>
+<!ELEMENT distribution (debian,redhat)>
+<!ELEMENT debian (#PCDATA)>
+<!ELEMENT redhat (#PCDATA)>
+]>
+
+<linux>
+  <distribution>
+    <debian>favorit</debian>
+    <redhat>interest</redhat>
+  </distribution>
+</linux>
+EOF
+
+if xmllint --noout --valid sample01.xml
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+rm sample01.xml
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Fuego] [PATCH] libtool: Add test cases for command libtool.
  2018-09-04 11:32 [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Wang Mingyu
  2018-09-04 11:32 ` [Fuego] [PATCH] iperf: Add test cases for command iperf Wang Mingyu
  2018-09-04 11:32 ` [Fuego] [PATCH] libxml: Add test cases for command libxml Wang Mingyu
@ 2018-09-04 11:32 ` Wang Mingyu
  2018-09-04 11:32 ` [Fuego] [PATCH] fbset: Add test cases for command fbset Wang Mingyu
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Wang Mingyu @ 2018-09-04 11:32 UTC (permalink / raw)
  To: fuego

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 engine/tests/Functional.libtool/fuego_test.sh      | 18 ++++++++++++++++++
 engine/tests/Functional.libtool/libtool_test.sh    |  4 ++++
 engine/tests/Functional.libtool/parser.py          | 22 ++++++++++++++++++++++
 engine/tests/Functional.libtool/spec.json          |  7 +++++++
 .../Functional.libtool/tests/libtool_config.sh     | 13 +++++++++++++
 .../tests/Functional.libtool/tests/libtool_help.sh | 13 +++++++++++++
 .../Functional.libtool/tests/libtool_version.sh    | 13 +++++++++++++
 7 files changed, 90 insertions(+)
 create mode 100644 engine/tests/Functional.libtool/fuego_test.sh
 create mode 100644 engine/tests/Functional.libtool/libtool_test.sh
 create mode 100644 engine/tests/Functional.libtool/parser.py
 create mode 100644 engine/tests/Functional.libtool/spec.json
 create mode 100644 engine/tests/Functional.libtool/tests/libtool_config.sh
 create mode 100644 engine/tests/Functional.libtool/tests/libtool_help.sh
 create mode 100644 engine/tests/Functional.libtool/tests/libtool_version.sh

diff --git a/engine/tests/Functional.libtool/fuego_test.sh b/engine/tests/Functional.libtool/fuego_test.sh
new file mode 100644
index 0000000..c889ab0
--- /dev/null
+++ b/engine/tests/Functional.libtool/fuego_test.sh
@@ -0,0 +1,18 @@
+function test_pre_check {
+    is_on_target_path libtool PROGRAM_LIBTOOL
+    assert_define PROGRAM_LIBTOOL "Missing 'libtool' program on target board"
+}
+
+function test_deploy {
+    put $TEST_HOME/libtool_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/
+    put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/
+}
+
+function test_run {
+    report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\
+    sh -v libtool_test.sh"
+}
+
+function test_processing {
+    log_compare "$TESTDIR" "0" "TEST-FAIL" "n"
+}
diff --git a/engine/tests/Functional.libtool/libtool_test.sh b/engine/tests/Functional.libtool/libtool_test.sh
new file mode 100644
index 0000000..dd5ce37
--- /dev/null
+++ b/engine/tests/Functional.libtool/libtool_test.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+for i in tests/*.sh; do
+    sh $i
+done
diff --git a/engine/tests/Functional.libtool/parser.py b/engine/tests/Functional.libtool/parser.py
new file mode 100644
index 0000000..d85abd7
--- /dev/null
+++ b/engine/tests/Functional.libtool/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/engine/tests/Functional.libtool/spec.json b/engine/tests/Functional.libtool/spec.json
new file mode 100644
index 0000000..e36793f
--- /dev/null
+++ b/engine/tests/Functional.libtool/spec.json
@@ -0,0 +1,7 @@
+{
+    "testName": "Functional.libtool",
+    "specs": {
+        "default": {}
+    }
+}
+
diff --git a/engine/tests/Functional.libtool/tests/libtool_config.sh b/engine/tests/Functional.libtool/tests/libtool_config.sh
new file mode 100644
index 0000000..c039aad
--- /dev/null
+++ b/engine/tests/Functional.libtool/tests/libtool_config.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  In target, run comannd libtool.
+#  option: --config.
+
+test="config"
+
+if libtool --config | grep "version_type=linux"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
diff --git a/engine/tests/Functional.libtool/tests/libtool_help.sh b/engine/tests/Functional.libtool/tests/libtool_help.sh
new file mode 100644
index 0000000..77984c1
--- /dev/null
+++ b/engine/tests/Functional.libtool/tests/libtool_help.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  In target, run comannd libtool.
+#  option: --help.
+
+test="help"
+
+if libtool --help | grep Usage
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
diff --git a/engine/tests/Functional.libtool/tests/libtool_version.sh b/engine/tests/Functional.libtool/tests/libtool_version.sh
new file mode 100644
index 0000000..1e2d5e7
--- /dev/null
+++ b/engine/tests/Functional.libtool/tests/libtool_version.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  In target, run comannd libtool.
+#  option: --version.
+
+test="version"
+
+if libtool --version | grep libtool
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Fuego] [PATCH] fbset: Add test cases for command fbset.
  2018-09-04 11:32 [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Wang Mingyu
                   ` (2 preceding siblings ...)
  2018-09-04 11:32 ` [Fuego] [PATCH] libtool: Add test cases for command libtool Wang Mingyu
@ 2018-09-04 11:32 ` Wang Mingyu
  2018-09-04 11:32 ` [Fuego] [PATCH] initscripts: Add test cases for command initscripts Wang Mingyu
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Wang Mingyu @ 2018-09-04 11:32 UTC (permalink / raw)
  To: fuego

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 engine/tests/Functional.fbset/fbset_test.sh        |  4 ++++
 engine/tests/Functional.fbset/fuego_test.sh        | 18 ++++++++++++++++++
 engine/tests/Functional.fbset/parser.py            | 22 ++++++++++++++++++++++
 engine/tests/Functional.fbset/spec.json            |  7 +++++++
 engine/tests/Functional.fbset/tests/fbset_help.sh  | 15 +++++++++++++++
 engine/tests/Functional.fbset/tests/fbset_show.sh  | 18 ++++++++++++++++++
 .../tests/Functional.fbset/tests/fbset_verbose.sh  | 15 +++++++++++++++
 engine/tests/Functional.fbset/tests/fbset_xfree.sh | 15 +++++++++++++++
 8 files changed, 114 insertions(+)
 create mode 100644 engine/tests/Functional.fbset/fbset_test.sh
 create mode 100644 engine/tests/Functional.fbset/fuego_test.sh
 create mode 100644 engine/tests/Functional.fbset/parser.py
 create mode 100644 engine/tests/Functional.fbset/spec.json
 create mode 100644 engine/tests/Functional.fbset/tests/fbset_help.sh
 create mode 100644 engine/tests/Functional.fbset/tests/fbset_show.sh
 create mode 100644 engine/tests/Functional.fbset/tests/fbset_verbose.sh
 create mode 100644 engine/tests/Functional.fbset/tests/fbset_xfree.sh

diff --git a/engine/tests/Functional.fbset/fbset_test.sh b/engine/tests/Functional.fbset/fbset_test.sh
new file mode 100644
index 0000000..dd5ce37
--- /dev/null
+++ b/engine/tests/Functional.fbset/fbset_test.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+for i in tests/*.sh; do
+    sh $i
+done
diff --git a/engine/tests/Functional.fbset/fuego_test.sh b/engine/tests/Functional.fbset/fuego_test.sh
new file mode 100644
index 0000000..ba1aecc
--- /dev/null
+++ b/engine/tests/Functional.fbset/fuego_test.sh
@@ -0,0 +1,18 @@
+function test_pre_check {
+    is_on_target_path fbset PROGRAM_FBSET
+    assert_define PROGRAM_FBSET "Missing 'fbset' program on target board"
+}
+
+function test_deploy {
+    put $TEST_HOME/fbset_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/
+    put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/
+}
+
+function test_run {
+    report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\
+    sh -v fbset_test.sh"
+}
+
+function test_processing {
+    log_compare "$TESTDIR" "0" "TEST-FAIL" "n"
+}
diff --git a/engine/tests/Functional.fbset/parser.py b/engine/tests/Functional.fbset/parser.py
new file mode 100644
index 0000000..d85abd7
--- /dev/null
+++ b/engine/tests/Functional.fbset/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/engine/tests/Functional.fbset/spec.json b/engine/tests/Functional.fbset/spec.json
new file mode 100644
index 0000000..2de2a7e
--- /dev/null
+++ b/engine/tests/Functional.fbset/spec.json
@@ -0,0 +1,7 @@
+{
+    "testName": "Functional.fbset",
+    "specs": {
+        "default": {}
+    }
+}
+
diff --git a/engine/tests/Functional.fbset/tests/fbset_help.sh b/engine/tests/Functional.fbset/tests/fbset_help.sh
new file mode 100644
index 0000000..688cd56
--- /dev/null
+++ b/engine/tests/Functional.fbset/tests/fbset_help.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+#  In target, run comannd fbset.
+#  option: --help.
+
+test="help"
+
+fbset --help > log 2>&1
+if cat log | grep Usage
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+rm log
diff --git a/engine/tests/Functional.fbset/tests/fbset_show.sh b/engine/tests/Functional.fbset/tests/fbset_show.sh
new file mode 100644
index 0000000..aa05f54
--- /dev/null
+++ b/engine/tests/Functional.fbset/tests/fbset_show.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+#  In target, run comannd fbset.
+#  option: -s.
+
+test="show"
+
+modprobe vfb vfb_enable=1
+
+echo "sleep 3 seconds"
+sleep 3
+
+if fbset -s
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
diff --git a/engine/tests/Functional.fbset/tests/fbset_verbose.sh b/engine/tests/Functional.fbset/tests/fbset_verbose.sh
new file mode 100644
index 0000000..6426c69
--- /dev/null
+++ b/engine/tests/Functional.fbset/tests/fbset_verbose.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+#  In target, run comannd fbset.
+#  option: -v.
+
+test="verbose"
+
+modprobe vfb vfb_enable=1
+
+if fbset -i -v | grep "/dev/fb0"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
diff --git a/engine/tests/Functional.fbset/tests/fbset_xfree.sh b/engine/tests/Functional.fbset/tests/fbset_xfree.sh
new file mode 100644
index 0000000..a10d99e
--- /dev/null
+++ b/engine/tests/Functional.fbset/tests/fbset_xfree.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+#  In target, run comannd fbset.
+#  option: -x.
+
+test="-x"
+
+modprobe vfb vfb_enable=1
+
+if fbset -x
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Fuego] [PATCH] initscripts: Add test cases for command initscripts.
  2018-09-04 11:32 [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Wang Mingyu
                   ` (3 preceding siblings ...)
  2018-09-04 11:32 ` [Fuego] [PATCH] fbset: Add test cases for command fbset Wang Mingyu
@ 2018-09-04 11:32 ` Wang Mingyu
  2018-09-04 11:32 ` [Fuego] [PATCH] logrotate: Add test cases for command logrotate Wang Mingyu
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Wang Mingyu @ 2018-09-04 11:32 UTC (permalink / raw)
  To: fuego

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 engine/tests/Functional.initscripts/fuego_test.sh  | 22 ++++++++++++++++
 .../Functional.initscripts/initscripts_test.sh     |  4 +++
 engine/tests/Functional.initscripts/parser.py      | 22 ++++++++++++++++
 engine/tests/Functional.initscripts/spec.json      |  7 +++++
 .../tests/initscripts_halt.sh                      | 13 ++++++++++
 .../tests/initscripts_ifdown-ifup.sh               | 30 ++++++++++++++++++++++
 .../tests/initscripts_sendsigs.sh                  | 13 ++++++++++
 7 files changed, 111 insertions(+)
 create mode 100644 engine/tests/Functional.initscripts/fuego_test.sh
 create mode 100644 engine/tests/Functional.initscripts/initscripts_test.sh
 create mode 100644 engine/tests/Functional.initscripts/parser.py
 create mode 100644 engine/tests/Functional.initscripts/spec.json
 create mode 100644 engine/tests/Functional.initscripts/tests/initscripts_halt.sh
 create mode 100644 engine/tests/Functional.initscripts/tests/initscripts_ifdown-ifup.sh
 create mode 100644 engine/tests/Functional.initscripts/tests/initscripts_sendsigs.sh

diff --git a/engine/tests/Functional.initscripts/fuego_test.sh b/engine/tests/Functional.initscripts/fuego_test.sh
new file mode 100644
index 0000000..f48da21
--- /dev/null
+++ b/engine/tests/Functional.initscripts/fuego_test.sh
@@ -0,0 +1,22 @@
+function test_pre_check {
+    is_on_target_path ifup PROGRAM_IFUP
+    assert_define PROGRAM_IFUP "Missing 'ifup' program on target board"
+    is_on_target_path ifdown PROGRAM_IFDOWN
+    assert_define PROGRAM_IFDOWN "Missing 'ifdown' program on target board"
+    is_on_target_path halt PROGRAM_HALT
+    assert_define PROGRAM_HALT "Missing 'halt' program on target board"
+}
+
+function test_deploy {
+    put $TEST_HOME/initscripts_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/
+    put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/
+}
+
+function test_run {
+    report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\
+    sh -v initscripts_test.sh"
+}
+
+function test_processing {
+    log_compare "$TESTDIR" "0" "TEST-FAIL" "n"
+}
diff --git a/engine/tests/Functional.initscripts/initscripts_test.sh b/engine/tests/Functional.initscripts/initscripts_test.sh
new file mode 100644
index 0000000..dd5ce37
--- /dev/null
+++ b/engine/tests/Functional.initscripts/initscripts_test.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+for i in tests/*.sh; do
+    sh $i
+done
diff --git a/engine/tests/Functional.initscripts/parser.py b/engine/tests/Functional.initscripts/parser.py
new file mode 100644
index 0000000..d85abd7
--- /dev/null
+++ b/engine/tests/Functional.initscripts/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/engine/tests/Functional.initscripts/spec.json b/engine/tests/Functional.initscripts/spec.json
new file mode 100644
index 0000000..ff057d2
--- /dev/null
+++ b/engine/tests/Functional.initscripts/spec.json
@@ -0,0 +1,7 @@
+{
+    "testName": "Functional.initscripts",
+    "specs": {
+        "default": {}
+    }
+}
+
diff --git a/engine/tests/Functional.initscripts/tests/initscripts_halt.sh b/engine/tests/Functional.initscripts/tests/initscripts_halt.sh
new file mode 100644
index 0000000..f310215
--- /dev/null
+++ b/engine/tests/Functional.initscripts/tests/initscripts_halt.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# In target, run comannd halt.
+# option: none
+
+test="halt"
+
+if [ $(ls -l /etc/init.d/halt | wc -l) = 1 ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
diff --git a/engine/tests/Functional.initscripts/tests/initscripts_ifdown-ifup.sh b/engine/tests/Functional.initscripts/tests/initscripts_ifdown-ifup.sh
new file mode 100644
index 0000000..1203340
--- /dev/null
+++ b/engine/tests/Functional.initscripts/tests/initscripts_ifdown-ifup.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# In target, run comannd ifdown/ifup.
+# option: none
+
+test="ifdown/ifup"
+
+if [ ! -f /etc/sysconfig/network-scripts/ifcfg-lo ]
+then
+    echo " -> $test: ifcfg file is not exist."
+    echo " -> $test: TEST-SKIP"
+    exit 0
+fi
+
+if ifdown lo
+then
+    echo " -> $test: ifdown lo is succeeded."
+else
+    echo " -> $test: ifdown lo is failed."
+    echo " -> $test: TEST-FAIL"
+    exit 0
+fi
+
+if ifup lo
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+
diff --git a/engine/tests/Functional.initscripts/tests/initscripts_sendsigs.sh b/engine/tests/Functional.initscripts/tests/initscripts_sendsigs.sh
new file mode 100644
index 0000000..680820f
--- /dev/null
+++ b/engine/tests/Functional.initscripts/tests/initscripts_sendsigs.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# In target, run comannd sendsigs.
+# option: none
+
+test="sendsigs"
+
+if [ $(ls -l /etc/init.d/sendsigs | wc -l) = 1 ]
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Fuego] [PATCH] logrotate: Add test cases for command logrotate.
  2018-09-04 11:32 [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Wang Mingyu
                   ` (4 preceding siblings ...)
  2018-09-04 11:32 ` [Fuego] [PATCH] initscripts: Add test cases for command initscripts Wang Mingyu
@ 2018-09-04 11:32 ` Wang Mingyu
  2018-09-04 11:32 ` [Fuego] [PATCH] m4: Add test cases for command m4 Wang Mingyu
  2018-11-09  4:40 ` [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Tim.Bird
  7 siblings, 0 replies; 9+ messages in thread
From: Wang Mingyu @ 2018-09-04 11:32 UTC (permalink / raw)
  To: fuego

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 engine/tests/Functional.logrotate/datas/test.conf  |   8 ++++
 engine/tests/Functional.logrotate/datas/testlog.sh |   6 +++
 .../tests/Functional.logrotate/datas/testlog100k   | Bin 0 -> 105984 bytes
 engine/tests/Functional.logrotate/fuego_test.sh    |  19 +++++++++
 .../tests/Functional.logrotate/logrotate_test.sh   |   4 ++
 engine/tests/Functional.logrotate/parser.py        |  22 +++++++++++
 engine/tests/Functional.logrotate/spec.json        |   7 ++++
 .../Functional.logrotate/tests/logrotate_01.sh     |  13 +++++++
 .../Functional.logrotate/tests/logrotate_02.sh     |  23 +++++++++++
 .../Functional.logrotate/tests/logrotate_03.sh     |  19 +++++++++
 .../Functional.logrotate/tests/logrotate_04.sh     |  43 +++++++++++++++++++++
 .../Functional.logrotate/tests/logrotate_05.sh     |  30 ++++++++++++++
 12 files changed, 194 insertions(+)
 create mode 100644 engine/tests/Functional.logrotate/datas/test.conf
 create mode 100644 engine/tests/Functional.logrotate/datas/testlog.sh
 create mode 100644 engine/tests/Functional.logrotate/datas/testlog100k
 create mode 100644 engine/tests/Functional.logrotate/fuego_test.sh
 create mode 100644 engine/tests/Functional.logrotate/logrotate_test.sh
 create mode 100644 engine/tests/Functional.logrotate/parser.py
 create mode 100644 engine/tests/Functional.logrotate/spec.json
 create mode 100644 engine/tests/Functional.logrotate/tests/logrotate_01.sh
 create mode 100644 engine/tests/Functional.logrotate/tests/logrotate_02.sh
 create mode 100644 engine/tests/Functional.logrotate/tests/logrotate_03.sh
 create mode 100644 engine/tests/Functional.logrotate/tests/logrotate_04.sh
 create mode 100644 engine/tests/Functional.logrotate/tests/logrotate_05.sh

diff --git a/engine/tests/Functional.logrotate/datas/test.conf b/engine/tests/Functional.logrotate/datas/test.conf
new file mode 100644
index 0000000..a346adf
--- /dev/null
+++ b/engine/tests/Functional.logrotate/datas/test.conf
@@ -0,0 +1,8 @@
+/var/log/testlog {
+        create 600 root root
+        ifempty
+        daily
+        nocompress
+        missingok
+        rotate 1
+}
diff --git a/engine/tests/Functional.logrotate/datas/testlog.sh b/engine/tests/Functional.logrotate/datas/testlog.sh
new file mode 100644
index 0000000..e258480
--- /dev/null
+++ b/engine/tests/Functional.logrotate/datas/testlog.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+ddch=`date --date ' 1 days ago' '+%Y-%m-%d'`
+echo "logrotate state -- version 2" >> /var/lib/logrotate.status
+echo "\"/var/log/testlog\" $ddch" >> /var/lib/logrotate.status
+EOF
diff --git a/engine/tests/Functional.logrotate/datas/testlog100k b/engine/tests/Functional.logrotate/datas/testlog100k
new file mode 100644
index 0000000000000000000000000000000000000000..1dc679f54731568a9cbda775a663b7ea51595fe3
GIT binary patch
literal 105984
zcmeI5d0-U9^2b*N!X;-EJdh;28zdV8yGaO9L{XdL$K@>wVs7M00!a`-{fUA^e4r2f
z0X{&`=Zyl&Q#|l~hzE+OPr(y!P(TqC1(8=ZGs|u^JKbNze|~PwA7rMhr<;7HQr%Ns
zU6bVTc!qWHcq*%_x`gQ5?O<8e*uv_n8n+rAPq1rNC?_k_H7l6i&ArxNU$S6WifZ-y
zk)EdQlWR@CZ4y=Z>I|EIwx%-6guez*l;{ECU-I)25dX$>-%vpRqn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<yat@4x>AP`)FD

literal 0
HcmV?d00001

diff --git a/engine/tests/Functional.logrotate/fuego_test.sh b/engine/tests/Functional.logrotate/fuego_test.sh
new file mode 100644
index 0000000..f9fb429
--- /dev/null
+++ b/engine/tests/Functional.logrotate/fuego_test.sh
@@ -0,0 +1,19 @@
+function test_pre_check {
+    is_on_target_path logrotate PROGRAM_LOGROTATE
+    assert_define PROGRAM_LOGROTATE "Missing 'logrotate' program on target board"
+}
+
+function test_deploy {
+    put $TEST_HOME/logrotate_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/
+    put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/
+    put -r $TEST_HOME/datas $BOARD_TESTDIR/fuego.$TESTDIR/
+}
+
+function test_run {
+    report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\
+    sh -v logrotate_test.sh"
+}
+
+function test_processing {
+    log_compare "$TESTDIR" "0" "TEST-FAIL" "n"
+}
diff --git a/engine/tests/Functional.logrotate/logrotate_test.sh b/engine/tests/Functional.logrotate/logrotate_test.sh
new file mode 100644
index 0000000..dd5ce37
--- /dev/null
+++ b/engine/tests/Functional.logrotate/logrotate_test.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+for i in tests/*.sh; do
+    sh $i
+done
diff --git a/engine/tests/Functional.logrotate/parser.py b/engine/tests/Functional.logrotate/parser.py
new file mode 100644
index 0000000..d85abd7
--- /dev/null
+++ b/engine/tests/Functional.logrotate/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/engine/tests/Functional.logrotate/spec.json b/engine/tests/Functional.logrotate/spec.json
new file mode 100644
index 0000000..6cfafd4
--- /dev/null
+++ b/engine/tests/Functional.logrotate/spec.json
@@ -0,0 +1,7 @@
+{
+    "testName": "Functional.logrotate",
+    "specs": {
+        "default": {}
+    }
+}
+
diff --git a/engine/tests/Functional.logrotate/tests/logrotate_01.sh b/engine/tests/Functional.logrotate/tests/logrotate_01.sh
new file mode 100644
index 0000000..e40647b
--- /dev/null
+++ b/engine/tests/Functional.logrotate/tests/logrotate_01.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  In the target to execute command logrotate and confirm the result.
+#  option : --help
+
+test="logrotate"
+
+if xmlcatalog --help | grep "Usage"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
diff --git a/engine/tests/Functional.logrotate/tests/logrotate_02.sh b/engine/tests/Functional.logrotate/tests/logrotate_02.sh
new file mode 100644
index 0000000..dda0245
--- /dev/null
+++ b/engine/tests/Functional.logrotate/tests/logrotate_02.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+#  In the target to execute command logrotate and confirm the result.
+#  option : -dv
+
+test="logrotate2"
+
+if [ -f /var/lib/logrotate.status ]
+then
+    rm -f /var/lib/logrotate.status
+fi
+
+cp datas/test.conf /etc/logrotate.d/test.conf
+
+chown root /etc/logrotate.d/test.conf
+
+if logrotate -dv /etc/logrotate.d/test.conf
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+rm -f /etc/logrotate.d/test.conf
diff --git a/engine/tests/Functional.logrotate/tests/logrotate_03.sh b/engine/tests/Functional.logrotate/tests/logrotate_03.sh
new file mode 100644
index 0000000..ef59c97
--- /dev/null
+++ b/engine/tests/Functional.logrotate/tests/logrotate_03.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+#  In the target to execute command logrotate and confirm the result.
+#  option : -v
+
+test="logrotate3"
+
+cp datas/test.conf /etc/logrotate.d/test.conf
+
+logrotate -v /etc/logrotate.d/test.conf
+
+if tail /var/lib/logrotate.status | grep testlog
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+rm -f /etc/logrotate.d/test.conf
+sed -i '/testlog/d' /var/lib/logrotate.status
diff --git a/engine/tests/Functional.logrotate/tests/logrotate_04.sh b/engine/tests/Functional.logrotate/tests/logrotate_04.sh
new file mode 100644
index 0000000..7f46357
--- /dev/null
+++ b/engine/tests/Functional.logrotate/tests/logrotate_04.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+#  In the target to execute command logrotate. Verify that the rotate file is created in the specified directory.
+#  option : -v
+
+test="logrotate4"
+
+if [ -f /var/log/testlog* ]
+then
+    rm -f /var/log/testlog*
+fi
+
+if [ -f /home/test/testlog.sh ]
+then
+    rm -f /home/test/testlog.sh
+fi
+
+if [ -f /var/lib/logrotate.status ]
+then
+    rm -f /var/lib/logrotate.status
+fi
+
+ntpdate 192.168.246.1
+
+cp datas/test.conf /etc/logrotate.d/test.conf
+
+touch /var/log/testlog
+
+chmod +x datas/testlog.sh
+datas/testlog.sh
+chown root /etc/logrotate.d/test.conf
+logrotate -v /etc/logrotate.d/test.conf
+if ls /var/log/testlog.1
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+
+rm -f /etc/logrotate.d/test.conf
+rm -f /var/log/testlog*
+sed -i '/testlog/d' /var/lib/logrotate.status
+sed -i '/logrotate/d' /var/lib/logrotate.status
diff --git a/engine/tests/Functional.logrotate/tests/logrotate_05.sh b/engine/tests/Functional.logrotate/tests/logrotate_05.sh
new file mode 100644
index 0000000..1f38e58
--- /dev/null
+++ b/engine/tests/Functional.logrotate/tests/logrotate_05.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#  In the target to execute command logrotate.Verify that the rotate file is created in the specified directory(Specify the file size).
+#  option : -v
+
+test="logrotate5"
+
+if [ -f /var/log/testlog* ]
+then
+    rm -f /var/log/testlog*
+fi
+
+cp datas/test.conf /etc/logrotate.d/test.conf
+
+cp testlog100k /var/log/testlog
+
+chmod +x datas/testlog.sh
+datas/testlog.sh
+chown root /etc/logrotate.d/test.conf
+logrotate -v /etc/logrotate.d/test.conf
+if ls /var/log/testlog.1
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+
+rm -f /etc/logrotate.d/test.conf
+rm -f /var/log/testlog*
+sed -i '/testlog/d' /var/lib/logrotate.status
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Fuego] [PATCH] m4: Add test cases for command m4.
  2018-09-04 11:32 [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Wang Mingyu
                   ` (5 preceding siblings ...)
  2018-09-04 11:32 ` [Fuego] [PATCH] logrotate: Add test cases for command logrotate Wang Mingyu
@ 2018-09-04 11:32 ` Wang Mingyu
  2018-11-09  4:40 ` [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Tim.Bird
  7 siblings, 0 replies; 9+ messages in thread
From: Wang Mingyu @ 2018-09-04 11:32 UTC (permalink / raw)
  To: fuego

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 engine/tests/Functional.m4/fuego_test.sh  | 18 ++++++++++++++++++
 engine/tests/Functional.m4/m4_test.sh     |  4 ++++
 engine/tests/Functional.m4/parser.py      | 22 ++++++++++++++++++++++
 engine/tests/Functional.m4/spec.json      |  7 +++++++
 engine/tests/Functional.m4/tests/m4_01.sh | 13 +++++++++++++
 engine/tests/Functional.m4/tests/m4_02.sh | 19 +++++++++++++++++++
 6 files changed, 83 insertions(+)
 create mode 100644 engine/tests/Functional.m4/fuego_test.sh
 create mode 100644 engine/tests/Functional.m4/m4_test.sh
 create mode 100644 engine/tests/Functional.m4/parser.py
 create mode 100644 engine/tests/Functional.m4/spec.json
 create mode 100644 engine/tests/Functional.m4/tests/m4_01.sh
 create mode 100644 engine/tests/Functional.m4/tests/m4_02.sh

diff --git a/engine/tests/Functional.m4/fuego_test.sh b/engine/tests/Functional.m4/fuego_test.sh
new file mode 100644
index 0000000..bc9326f
--- /dev/null
+++ b/engine/tests/Functional.m4/fuego_test.sh
@@ -0,0 +1,18 @@
+function test_pre_check {
+    is_on_target_path m4 PROGRAM_M4
+    assert_define PROGRAM_M4 "Missing 'm4' program on target board"
+}
+
+function test_deploy {
+    put $TEST_HOME/m4_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/
+    put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/
+}
+
+function test_run {
+    report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\
+    sh -v m4_test.sh"
+}
+
+function test_processing {
+    log_compare "$TESTDIR" "0" "TEST-FAIL" "n"
+}
diff --git a/engine/tests/Functional.m4/m4_test.sh b/engine/tests/Functional.m4/m4_test.sh
new file mode 100644
index 0000000..dd5ce37
--- /dev/null
+++ b/engine/tests/Functional.m4/m4_test.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+for i in tests/*.sh; do
+    sh $i
+done
diff --git a/engine/tests/Functional.m4/parser.py b/engine/tests/Functional.m4/parser.py
new file mode 100644
index 0000000..d85abd7
--- /dev/null
+++ b/engine/tests/Functional.m4/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/engine/tests/Functional.m4/spec.json b/engine/tests/Functional.m4/spec.json
new file mode 100644
index 0000000..d891e82
--- /dev/null
+++ b/engine/tests/Functional.m4/spec.json
@@ -0,0 +1,7 @@
+{
+    "testName": "Functional.m4",
+    "specs": {
+        "default": {}
+    }
+}
+
diff --git a/engine/tests/Functional.m4/tests/m4_01.sh b/engine/tests/Functional.m4/tests/m4_01.sh
new file mode 100644
index 0000000..0f77c17
--- /dev/null
+++ b/engine/tests/Functional.m4/tests/m4_01.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#  In target, run comannd m4.
+#  option: --help
+
+test="m4_01"
+
+if m4 --help | grep Usage
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
diff --git a/engine/tests/Functional.m4/tests/m4_02.sh b/engine/tests/Functional.m4/tests/m4_02.sh
new file mode 100644
index 0000000..63a5b69
--- /dev/null
+++ b/engine/tests/Functional.m4/tests/m4_02.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+#  In target, run comannd m4.
+#  option: none
+
+test="m4_02"
+
+mkdir m4
+echo "define(\`STR', \`hello world')" > m4/m4.test
+echo "syscmd(\`echo' STR)" >> m4/m4.test
+
+if m4 m4/m4.test | grep "hello world"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi;
+
+rm -fr m4
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission.
  2018-09-04 11:32 [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Wang Mingyu
                   ` (6 preceding siblings ...)
  2018-09-04 11:32 ` [Fuego] [PATCH] m4: Add test cases for command m4 Wang Mingyu
@ 2018-11-09  4:40 ` Tim.Bird
  7 siblings, 0 replies; 9+ messages in thread
From: Tim.Bird @ 2018-11-09  4:40 UTC (permalink / raw)
  To: wangmy, fuego



> -----Original Message-----
> From: Wang Mingyu on Tuesday, September 04, 2018 4:33 AM
> 
> Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
> ---
>  engine/tests/Functional.busybox/tests/busybox_umount.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/engine/tests/Functional.busybox/tests/busybox_umount.sh
> b/engine/tests/Functional.busybox/tests/busybox_umount.sh
> index 8688a20..dc07c4b 100644
> --- a/engine/tests/Functional.busybox/tests/busybox_umount.sh
> +++ b/engine/tests/Functional.busybox/tests/busybox_umount.sh
> @@ -6,7 +6,7 @@
>  test="umount"
> 
>  mkdir test_dir
> -mount -n -t tmpfs none test_dir
> +mount -t tmpfs none test_dir
> 
>  if mount | grep "none on .*test_dir"
>  then
> --
> 1.8.3.1

Applied.  Thanks.
 -- Tim


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-09  4:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 11:32 [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Wang Mingyu
2018-09-04 11:32 ` [Fuego] [PATCH] iperf: Add test cases for command iperf Wang Mingyu
2018-09-04 11:32 ` [Fuego] [PATCH] libxml: Add test cases for command libxml Wang Mingyu
2018-09-04 11:32 ` [Fuego] [PATCH] libtool: Add test cases for command libtool Wang Mingyu
2018-09-04 11:32 ` [Fuego] [PATCH] fbset: Add test cases for command fbset Wang Mingyu
2018-09-04 11:32 ` [Fuego] [PATCH] initscripts: Add test cases for command initscripts Wang Mingyu
2018-09-04 11:32 ` [Fuego] [PATCH] logrotate: Add test cases for command logrotate Wang Mingyu
2018-09-04 11:32 ` [Fuego] [PATCH] m4: Add test cases for command m4 Wang Mingyu
2018-11-09  4:40 ` [Fuego] [PATCH] busybox: Delete the option "-n" from umount to avoid using root permission Tim.Bird

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.