busybox: Delete the option "-n" from umount to avoid using root permission.
PATCH 1/1 busybox: Delete the option "-n" from umount to avoid using root permission.
Signed-off-by Wang Mingyu <[email protected]>
--- engine/tests/Functional.busybox/tests/busybox_umount.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
engine/tests/Functional.busybox/tests/busybox_umount.sh +1 -1
@@ -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
Signature · 1 line
1.8.3.1
PATCH 1/1 iperf: Add test cases for command iperf.
Signed-off-by Wang Mingyu <[email protected]>
--- 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
engine/tests/Functional.iperf/fuego_test.sh new file +18 -0
@@ -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" +}
engine/tests/Functional.iperf/iperf_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.iperf/parser.py new file +22 -0
@@ -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))
engine/tests/Functional.iperf/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.iperf", + "specs": { + "default": {} + } +} +
engine/tests/Functional.iperf/tests/iperf_help.sh new file +13 -0
@@ -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;
engine/tests/Functional.iperf/tests/iperf_server1.sh new file +26 -0
@@ -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
engine/tests/Functional.iperf/tests/iperf_server2.sh new file +18 -0
@@ -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
engine/tests/Functional.iperf/tests/iperf_server3.sh new file +22 -0
@@ -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 +
engine/tests/Functional.iperf/tests/iperf_server4.sh new file +22 -0
@@ -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
engine/tests/Functional.iperf/tests/iperf_server5.sh new file +18 -0
@@ -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
engine/tests/Functional.iperf/tests/iperf_server6.sh new file +23 -0
@@ -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
engine/tests/Functional.iperf/tests/iperf_version.sh new file +13 -0
@@ -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
Signature · 1 line
1.8.3.1
PATCH 1/1 libxml: Add test cases for command libxml.
In reply to Wang MingyuSigned-off-by Wang Mingyu <[email protected]>
--- 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
engine/tests/Functional.libxml/fuego_test.sh new file +20 -0
@@ -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" +}
engine/tests/Functional.libxml/libxml_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.libxml/parser.py new file +22 -0
@@ -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))
engine/tests/Functional.libxml/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.libxml", + "specs": { + "default": {} + } +} +
engine/tests/Functional.libxml/tests/xmlcatalog_create.sh new file +13 -0
@@ -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
engine/tests/Functional.libxml/tests/xmlcatalog_debug.sh new file +17 -0
@@ -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
engine/tests/Functional.libxml/tests/xmlcatalog_help.sh new file +13 -0
@@ -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
engine/tests/Functional.libxml/tests/xmllint_checkxml.sh new file +32 -0
@@ -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
engine/tests/Functional.libxml/tests/xmllint_debug.sh new file +32 -0
@@ -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
engine/tests/Functional.libxml/tests/xmllint_format.sh new file +19 -0
@@ -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
engine/tests/Functional.libxml/tests/xmllint_noout.sh new file +32 -0
@@ -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
Signature · 1 line
1.8.3.1
PATCH 1/1 libtool: Add test cases for command libtool.
In reply to Wang MingyuSigned-off-by Wang Mingyu <[email protected]>
--- 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
engine/tests/Functional.libtool/fuego_test.sh new file +18 -0
@@ -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" +}
engine/tests/Functional.libtool/libtool_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.libtool/parser.py new file +22 -0
@@ -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))
engine/tests/Functional.libtool/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.libtool", + "specs": { + "default": {} + } +} +
engine/tests/Functional.libtool/tests/libtool_config.sh new file +13 -0
@@ -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;
engine/tests/Functional.libtool/tests/libtool_help.sh new file +13 -0
@@ -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;
engine/tests/Functional.libtool/tests/libtool_version.sh new file +13 -0
@@ -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;
Signature · 1 line
1.8.3.1
PATCH 1/1 fbset: Add test cases for command fbset.
In reply to Wang MingyuSigned-off-by Wang Mingyu <[email protected]>
--- 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
engine/tests/Functional.fbset/fbset_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.fbset/fuego_test.sh new file +18 -0
@@ -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" +}
engine/tests/Functional.fbset/parser.py new file +22 -0
@@ -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))
engine/tests/Functional.fbset/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.fbset", + "specs": { + "default": {} + } +} +
engine/tests/Functional.fbset/tests/fbset_help.sh new file +15 -0
@@ -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
engine/tests/Functional.fbset/tests/fbset_show.sh new file +18 -0
@@ -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;
engine/tests/Functional.fbset/tests/fbset_verbose.sh new file +15 -0
@@ -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;
engine/tests/Functional.fbset/tests/fbset_xfree.sh new file +15 -0
@@ -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;
Signature · 1 line
1.8.3.1
PATCH 1/1 initscripts: Add test cases for command initscripts.
In reply to Wang MingyuSigned-off-by Wang Mingyu <[email protected]>
--- 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
engine/tests/Functional.initscripts/fuego_test.sh new file +22 -0
@@ -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" +}
engine/tests/Functional.initscripts/initscripts_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.initscripts/parser.py new file +22 -0
@@ -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))
engine/tests/Functional.initscripts/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.initscripts", + "specs": { + "default": {} + } +} +
engine/tests/Functional.initscripts/tests/initscripts_halt.sh new file +13 -0
@@ -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
engine/tests/Functional.initscripts/tests/initscripts_ifdown-ifup.sh new file +30 -0
@@ -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 +
engine/tests/Functional.initscripts/tests/initscripts_sendsigs.sh new file +13 -0
@@ -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
Signature · 1 line
1.8.3.1
PATCH 1/1 logrotate: Add test cases for command logrotate.
In reply to Wang MingyuSigned-off-by Wang Mingyu <[email protected]>
--- 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
engine/tests/Functional.logrotate/datas/test.conf new file +8 -0
@@ -0,0 +1,8 @@ +/var/log/testlog { + create 600 root root + ifempty + daily + nocompress + missingok + rotate 1 +}
engine/tests/Functional.logrotate/datas/testlog.sh new file +6 -0
@@ -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
engine/tests/Functional.logrotate/datas/testlog100k new file binary +0 -0
engine/tests/Functional.logrotate/fuego_test.sh new file +19 -0
@@ -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" +}
engine/tests/Functional.logrotate/logrotate_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.logrotate/parser.py new file +22 -0
@@ -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))
engine/tests/Functional.logrotate/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.logrotate", + "specs": { + "default": {} + } +} +
engine/tests/Functional.logrotate/tests/logrotate_01.sh new file +13 -0
@@ -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
engine/tests/Functional.logrotate/tests/logrotate_02.sh new file +23 -0
@@ -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
engine/tests/Functional.logrotate/tests/logrotate_03.sh new file +19 -0
@@ -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
engine/tests/Functional.logrotate/tests/logrotate_04.sh new file +43 -0
43 lines not on this page · raw message
engine/tests/Functional.logrotate/tests/logrotate_05.sh new file +30 -0
@@ -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
Signature · 1 line
1.8.3.1
PATCH 1/1 m4: Add test cases for command m4.
In reply to Wang MingyuSigned-off-by Wang Mingyu <[email protected]>
--- 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
engine/tests/Functional.m4/fuego_test.sh new file +18 -0
@@ -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" +}
engine/tests/Functional.m4/m4_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.m4/parser.py new file +22 -0
@@ -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))
engine/tests/Functional.m4/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.m4", + "specs": { + "default": {} + } +} +
engine/tests/Functional.m4/tests/m4_01.sh new file +13 -0
@@ -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;
engine/tests/Functional.m4/tests/m4_02.sh new file +19 -0
@@ -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
Signature · 1 line
1.8.3.1
[email protected]
AppliedQuoted 25 lines
-----Original Message-----
From: Wang Mingyu on Tuesday, September 04, 2018 4:33 AMSigned-off-by Wang Mingyu <[email protected]>--- engine/tests/Functional.busybox/tests/busybox_umount.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)engine/tests/Functional.busybox/tests/busybox_umount.sh +1
-2@@ -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 --
Quoted 1 line
1.8.3.1
Applied. Thanks.
-- Tim