Add test cases of command samhain.
PATCH v2 1/1 Add test cases of command samhain.
Command samhain is used to check file integrity.
This test set is to check the initialization of the database of file signatures. And check the filesystem against the database of file signatures.
--- engine/tests/Functional.samhain/fuego_test.sh | 17 ++++++++ engine/tests/Functional.samhain/parser.py | 22 ++++++++++ engine/tests/Functional.samhain/samhain_test.sh | 4 ++ engine/tests/Functional.samhain/spec.json | 7 ++++ .../Functional.samhain/tests/samhain_check.sh | 48 ++++++++++++++++++++++ .../tests/Functional.samhain/tests/samhain_help.sh | 13 ++++++ .../tests/Functional.samhain/tests/samhain_init.sh | 32 +++++++++++++++ 7 files changed, 143 insertions(+) create mode 100644 engine/tests/Functional.samhain/fuego_test.sh create mode 100644 engine/tests/Functional.samhain/parser.py create mode 100755 engine/tests/Functional.samhain/samhain_test.sh create mode 100644 engine/tests/Functional.samhain/spec.json create mode 100644 engine/tests/Functional.samhain/tests/samhain_check.sh create mode 100644 engine/tests/Functional.samhain/tests/samhain_help.sh create mode 100644 engine/tests/Functional.samhain/tests/samhain_init.sh
engine/tests/Functional.samhain/fuego_test.sh new file +17 -0
@@ -0,0 +1,17 @@ +function test_pre_check { + assert_has_program samhain +} + +function test_deploy { + put $TEST_HOME/samhain_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/ + put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/ +} + +function test_run { + report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\ + ./samhain_test.sh" +} + +function test_processing { + log_compare "$TESTDIR" "0" "TEST-FAIL" "n" +}
engine/tests/Functional.samhain/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.samhain/samhain_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.samhain/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.samhain", + "specs": { + "default": {} + } +} +
engine/tests/Functional.samhain/tests/samhain_check.sh new file +48 -0
48 lines not on this page · raw message
engine/tests/Functional.samhain/tests/samhain_help.sh new file +13 -0
@@ -0,0 +1,13 @@ +#!/bin/sh + +# In target, run command samhain. +# option: --help + +test="help" + +if samhain --help | grep "Usage" +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fi
engine/tests/Functional.samhain/tests/samhain_init.sh new file +32 -0
@@ -0,0 +1,32 @@ +#!/bin/sh + +# In target, run command samhain. +# Initialize the database of file signatures. +# option: -t + +test="init" + +cp /etc/samhainrc /etc/samhainrc_bak +sed -i 's/dir = 99\/usr/dir = 99$BOARD_TESTDIR\/fuego.$TESTDIR\/test_dir\/samhain_test/' /etc/samhainrc + +rm -fr /var/samhain/* +rm -f /var/log/samhain_log + +sleep 1 + +mkdir -p test_dir/samhain_test/ +touch test_dir/samhain_test/test.txt + +samhain -t init -p info > /dev/null 2&> 1 + +sleep 1 + +if cat /var/log/samhain_log | grep "ALRT.*-.*-.*T.*:.*:.*msg=\"EXIT\"" +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fi + +rm -fr test_dir/samhain_test +mv /etc/samhainrc_bak /etc/samhainrc
Signature · 1 line
1.8.3.1
PATCH v2 1/1 Add test cases of command vconfig.
Command vconfig is VLAN (802.1q) configuration program. This test set is used to check the option add/rem/set_flag of vconfig.
--- engine/tests/Functional.vconfig/fuego_test.sh | 22 +++++++++++++++ engine/tests/Functional.vconfig/parser.py | 22 +++++++++++++++ engine/tests/Functional.vconfig/spec.json | 7 +++++ engine/tests/Functional.vconfig/test.yaml | 31 ++++++++++++++++++++++ .../Functional.vconfig/tests/vconfig_VLAN_tag.sh | 29 ++++++++++++++++++++ .../tests/Functional.vconfig/tests/vconfig_add.sh | 16 +++++++++++ .../Functional.vconfig/tests/vconfig_addaddr.sh | 17 ++++++++++++ .../tests/Functional.vconfig/tests/vconfig_help.sh | 13 +++++++++ .../Functional.vconfig/tests/vconfig_remove.sh | 15 +++++++++++ .../Functional.vconfig/tests/vconfig_set_flag.sh | 16 +++++++++++ engine/tests/Functional.vconfig/vconfig_test.sh | 4 +++ 11 files changed, 192 insertions(+) create mode 100644 engine/tests/Functional.vconfig/fuego_test.sh create mode 100644 engine/tests/Functional.vconfig/parser.py create mode 100644 engine/tests/Functional.vconfig/spec.json create mode 100644 engine/tests/Functional.vconfig/test.yaml create mode 100644 engine/tests/Functional.vconfig/tests/vconfig_VLAN_tag.sh create mode 100644 engine/tests/Functional.vconfig/tests/vconfig_add.sh create mode 100644 engine/tests/Functional.vconfig/tests/vconfig_addaddr.sh create mode 100644 engine/tests/Functional.vconfig/tests/vconfig_help.sh create mode 100644 engine/tests/Functional.vconfig/tests/vconfig_remove.sh create mode 100644 engine/tests/Functional.vconfig/tests/vconfig_set_flag.sh create mode 100755 engine/tests/Functional.vconfig/vconfig_test.sh
engine/tests/Functional.vconfig/fuego_test.sh new file +22 -0
@@ -0,0 +1,22 @@ +function test_pre_check { + assert_has_program vconfig + assert_has_program tcpdump + assert_has_program ping +} + +function test_deploy { + put $TEST_HOME/vconfig_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/ + put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/ +} + +function test_run { + report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\ + export vcon_ifeth=$IFETH;\ + export vcon_ip1=$VLAN_IP1;\ + export vcon_ip2=$VLAN_IP2;\ + ./vconfig_test.sh" +} + +function test_processing { + log_compare "$TESTDIR" "0" "TEST-FAIL" "n" +}
engine/tests/Functional.vconfig/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.vconfig/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.vconfig", + "specs": { + "default": {} + } +} +
engine/tests/Functional.vconfig/test.yaml new file +31 -0
@@ -0,0 +1,31 @@ +fuego_package_version: 1 +name: Functional.vconfig +description: | + The vconfig program allows you to create and remove vlan-devices on a vlan enabled kernel. + Vlan-devices are virtual ethernet devices which represents the virtual lans on the physical lan. + This is a simple test to check the option help/add/rem/set_flag + of command vconfig. +license: Unknown +author: Wang Mingyu <[email protected]> +maintainer: Tim Bird <[email protected]> +version: 1.00 +fuego_release: 1 +type: Functional +tags: ['vlan'] +params: + IFETH="the eth interface in your target board" Defined in board file + VLAN_IP1="IP address configured for eth interface" Defined in board file + VLAN_IP2="IP address which the eth to access" Defined in board file +data_files: + - vconfig_test.sh + - fuego_test.sh + - parser.py + - spec.json + - test.yaml + - tests + vconfig_addaddr.sh + vconfig_add.sh + vconfig_help.sh + vconfig_remove.sh + vconfig_set_flag.sh + vconfig_VLAN_tag.sh
engine/tests/Functional.vconfig/tests/vconfig_VLAN_tag.sh new file +29 -0
@@ -0,0 +1,29 @@ +#!/bin/sh + +# In target, run command vconfig. +# option: add/rem + +test="VLAN_tag" + +mkdir test_dir + +ifconfig $vcon_ifeth up +vconfig add $vcon_ifeth 100 + +# specify the address to vlanif by ifconfig. +ifconfig $vcon_ifeth.100 inet $vcon_ip1 netmask 0xffffff00 + +# to verify the IP address exists and can accept requests. +ping -q -c 50 -I $vcon_ifeth.100 $vcon_ip2 & + +# check the VLAN tag by tcpdump. +tcpdump -c 10 -ex -i $vcon_ifeth ether broadcast > test_dir/dumpdata + +if cat test_dir/dumpdata | grep "vlan 100" +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fi +rm -fr test_dir +vconfig rem $vcon_ifeth.100
engine/tests/Functional.vconfig/tests/vconfig_add.sh new file +16 -0
@@ -0,0 +1,16 @@ +#!/bin/sh + +# In target, run command vconfig. +# option: add + +test="add" + +vconfig add $vcon_ifeth 4 + +if ifconfig $vcon_ifeth.4 | grep "$vcon_ifeth.4" +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fi +vconfig rem $vcon_ifeth.4
engine/tests/Functional.vconfig/tests/vconfig_addaddr.sh new file +17 -0
@@ -0,0 +1,17 @@ +#!/bin/sh + +# In target, run command vconfig. +# option: add/rem + +test="addaddr" + +vconfig add $vcon_ifeth 100 +ifconfig $vcon_ifeth.100 inet 192.168.255.1 netmask 0xffffff00 + +if ifconfig $vcon_ifeth.100 | grep "192.168.255.1" +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fi +vconfig rem $vcon_ifeth.100
engine/tests/Functional.vconfig/tests/vconfig_help.sh new file +13 -0
@@ -0,0 +1,13 @@ +#!/bin/sh + +# In target, run command vconfig. +# option: none + +test="help" + +if vconfig | grep Usage +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fi;
engine/tests/Functional.vconfig/tests/vconfig_remove.sh new file +15 -0
@@ -0,0 +1,15 @@ +#!/bin/sh + +# In target, run command vconfig. +# option: rem + +test="remove" + +vconfig add $vcon_ifeth 4 + +if vconfig rem $vcon_ifeth.4 | grep "Removed VLAN" +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fi
engine/tests/Functional.vconfig/tests/vconfig_set_flag.sh new file +16 -0
@@ -0,0 +1,16 @@ +#!/bin/sh + +# In target, run command vconfig. +# option: set_flag + +test="set_flag" + +vconfig add $vcon_ifeth 4 + +if vconfig set_flag $vcon_ifeth.4 1 | grep "Set flag on device" +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fi +vconfig rem $vcon_ifeth.4
engine/tests/Functional.vconfig/vconfig_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
Signature · 1 line
1.8.3.1
PATCH v2 1/1 Add test cases of service tcsd.
In reply to Wang MingyuThe tcsd is a user space daemon that manages Trusted Computing resources. This test set is used to check if the service tcsd can be started.
--- engine/tests/Functional.trousers/fuego_test.sh | 18 ++++++++++++++++++ engine/tests/Functional.trousers/parser.py | 22 ++++++++++++++++++++++ engine/tests/Functional.trousers/spec.json | 7 +++++++ .../Functional.trousers/tests/trousers_help.sh | 15 +++++++++++++++ .../Functional.trousers/tests/trousers_start.sh | 18 ++++++++++++++++++ engine/tests/Functional.trousers/trousers_test.sh | 4 ++++ 6 files changed, 84 insertions(+) create mode 100644 engine/tests/Functional.trousers/fuego_test.sh create mode 100644 engine/tests/Functional.trousers/parser.py create mode 100644 engine/tests/Functional.trousers/spec.json create mode 100644 engine/tests/Functional.trousers/tests/trousers_help.sh create mode 100644 engine/tests/Functional.trousers/tests/trousers_start.sh create mode 100755 engine/tests/Functional.trousers/trousers_test.sh
engine/tests/Functional.trousers/fuego_test.sh new file +18 -0
@@ -0,0 +1,18 @@ +function test_pre_check { + assert_has_program tcsd +} + +function test_deploy { + put $TEST_HOME/trousers_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/ + put $FUEGO_CORE/engine/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;\ + ./trousers_test.sh" +} + +function test_processing { + log_compare "$TESTDIR" "0" "TEST-FAIL" "n" +}
engine/tests/Functional.trousers/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.trousers/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.trousers", + "specs": { + "default": {} + } +} +
engine/tests/Functional.trousers/tests/trousers_help.sh new file +15 -0
@@ -0,0 +1,15 @@ +#!/bin/sh + +# In target, run command tcsd. +# option: -h + +test="help" + +tcsd --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.trousers/tests/trousers_start.sh new file +18 -0
@@ -0,0 +1,18 @@ +#!/bin/sh + +# In target, start the service tcsd. + +test="start" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target tcsd stop + +if exec_service_on_target tcsd start +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fi
engine/tests/Functional.trousers/trousers_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
Signature · 1 line
1.8.3.1
[email protected]
AppliedRe: [Fuego] [PATCH v2] Add test cases of service tcsd.
Quoted 7 lines
-----Original Message-----
From: Wang MingyuThe tcsd is a user space daemon that manages Trusted Computing resources. This test set is used to check if the service tcsd can be started.
Thanks for the explanation, as requested.
It would be nice to know why this test is called 'trousers', but oh well.
Quoted 149 lines
Signed-off-by Wang Mingyu <[email protected]>--- engine/tests/Functional.trousers/fuego_test.sh | 18 ++++++++++++++++++ engine/tests/Functional.trousers/parser.py | 22 ++++++++++++++++++++++ engine/tests/Functional.trousers/spec.json | 7 +++++++ .../Functional.trousers/tests/trousers_help.sh | 15 +++++++++++++++ .../Functional.trousers/tests/trousers_start.sh | 18 ++++++++++++++++++ engine/tests/Functional.trousers/trousers_test.sh | 4 ++++ 6 files changed, 84 insertions(+) create mode 100644 engine/tests/Functional.trousers/fuego_test.sh create mode 100644 engine/tests/Functional.trousers/parser.py create mode 100644 engine/tests/Functional.trousers/spec.json create mode 100644 engine/tests/Functional.trousers/tests/trousers_help.sh create mode 100644 engine/tests/Functional.trousers/tests/trousers_start.sh create mode 100755 engine/tests/Functional.trousers/trousers_test.shengine/tests/Functional.trousers/fuego_test.sh new file +7
-0@@ -0,0 +1,18 @@ +function test_pre_check { + assert_has_program tcsd +} + +function test_deploy { + put $TEST_HOME/trousers_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/ + put $FUEGO_CORE/engine/scripts/fuego_board_function_lib.sh$BOARD_TESTDIR/fuego.$TESTDIR
engine/tests/Functional.trousers/fuego_test.sh new file +11
-0+ put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/ +} + +function test_run { + report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\ + ./trousers_test.sh" +} + +function test_processing { + log_compare "$TESTDIR" "0" "TEST-FAIL" "n" +}engine/tests/Functional.trousers/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.trousers/spec.json new file +7
-0@@ -0,0 +1,7 @@ +{ + "testName": "Functional.trousers", + "specs": { + "default": {} + } +} +engine/tests/Functional.trousers/tests/trousers_help.sh new file +15
-0@@ -0,0 +1,15 @@ +#!/bin/sh + +# In target, run command tcsd. +# option: -h + +test="help" + +tcsd --help > log 2>&1 +if cat log | grep "usage" +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fi +rm logengine/tests/Functional.trousers/tests/trousers_start.sh new file +18
-0@@ -0,0 +1,18 @@ +#!/bin/sh + +# In target, start the service tcsd. + +test="start" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target tcsd stop + +if exec_service_on_target tcsd start +then + echo " -> $test: TEST-PASS" +else + echo " -> $test: TEST-FAIL" +fiengine/tests/Functional.trousers/trousers_test.sh new file +4
-1@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done --
Quoted 1 line
1.8.3.1
Thanks for the fixups.
Applied.
-- Tim
PATCH v2 1/1 Add test cases for commands of at.
In reply to Wang Mingyucommands list:
at
atq
atrm
This test set is to check the service atd and command at/atq/atrm that if they can examine or delete jobs for later execution successfully.
--- engine/tests/Functional.at/at_test.sh | 4 ++ engine/tests/Functional.at/data/at_no.allow | 2 + engine/tests/Functional.at/data/at_no.deny | 0 engine/tests/Functional.at/data/at_test.allow | 2 + engine/tests/Functional.at/data/at_test.deny | 2 + engine/tests/Functional.at/data/test_add.sh | 3 + engine/tests/Functional.at/fuego_test.sh | 23 ++++++++ engine/tests/Functional.at/parser.py | 22 +++++++ engine/tests/Functional.at/spec.json | 7 +++ engine/tests/Functional.at/tests/atd_allow_deny.sh | 44 ++++++++++++++ .../Functional.at/tests/atd_allow_deny_no_user.sh | 45 ++++++++++++++ .../tests/Functional.at/tests/atd_allow_no_user.sh | 43 ++++++++++++++ engine/tests/Functional.at/tests/atd_atq.sh | 39 +++++++++++++ engine/tests/Functional.at/tests/atd_atrm.sh | 39 +++++++++++++ .../tests/Functional.at/tests/atd_deny_no_user.sh | 43 ++++++++++++++ engine/tests/Functional.at/tests/atd_job.sh | 68 ++++++++++++++++++++++ engine/tests/Functional.at/tests/atd_pidfile.sh | 55 +++++++++++++++++ engine/tests/Functional.at/tests/atd_ps.sh | 51 ++++++++++++++++ engine/tests/Functional.at/tests/atd_syslog.sh | 49 ++++++++++++++++ 19 files changed, 541 insertions(+) create mode 100755 engine/tests/Functional.at/at_test.sh create mode 100644 engine/tests/Functional.at/data/at_no.allow create mode 100644 engine/tests/Functional.at/data/at_no.deny create mode 100644 engine/tests/Functional.at/data/at_test.allow create mode 100644 engine/tests/Functional.at/data/at_test.deny create mode 100755 engine/tests/Functional.at/data/test_add.sh create mode 100644 engine/tests/Functional.at/fuego_test.sh create mode 100644 engine/tests/Functional.at/parser.py create mode 100644 engine/tests/Functional.at/spec.json create mode 100644 engine/tests/Functional.at/tests/atd_allow_deny.sh create mode 100644 engine/tests/Functional.at/tests/atd_allow_deny_no_user.sh create mode 100644 engine/tests/Functional.at/tests/atd_allow_no_user.sh create mode 100644 engine/tests/Functional.at/tests/atd_atq.sh create mode 100644 engine/tests/Functional.at/tests/atd_atrm.sh create mode 100644 engine/tests/Functional.at/tests/atd_deny_no_user.sh create mode 100644 engine/tests/Functional.at/tests/atd_job.sh create mode 100644 engine/tests/Functional.at/tests/atd_pidfile.sh create mode 100644 engine/tests/Functional.at/tests/atd_ps.sh create mode 100644 engine/tests/Functional.at/tests/atd_syslog.sh
engine/tests/Functional.at/at_test.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +for i in tests/*.sh; do + sh $i +done
engine/tests/Functional.at/data/at_no.allow new file +2 -0
@@ -0,0 +1,2 @@ + +
engine/tests/Functional.at/data/at_no.deny new file +0 -0
engine/tests/Functional.at/data/at_test.allow new file +2 -0
@@ -0,0 +1,2 @@ +test_for_fuego +
engine/tests/Functional.at/data/at_test.deny new file +2 -0
@@ -0,0 +1,2 @@ +test_for_fuego +
engine/tests/Functional.at/data/test_add.sh new file +3 -0
@@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/bin/logger -i "hello fuego autotest! from at"
engine/tests/Functional.at/fuego_test.sh new file +23 -0
@@ -0,0 +1,23 @@ +function test_pre_check { + assert_has_program at + assert_has_program atq + assert_has_program atrm + assert_has_program useradd + assert_has_program userdel +} + +function test_deploy { + put $TEST_HOME/at_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/ + put $FUEGO_CORE/engine/scripts/fuego_board_function_lib.sh $BOARD_TESTDIR/fuego.$TESTDIR + put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/ + put -r $TEST_HOME/data $BOARD_TESTDIR/fuego.$TESTDIR/ +} + +function test_run { + report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\ + ./at_test.sh" +} + +function test_processing { + log_compare "$TESTDIR" "0" "TEST-FAIL" "n" +}
engine/tests/Functional.at/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.at/spec.json new file +7 -0
@@ -0,0 +1,7 @@ +{ + "testName": "Functional.at", + "specs": { + "default": {} + } +} +
engine/tests/Functional.at/tests/atd_allow_deny.sh new file +44 -0
44 lines not on this page · raw message
engine/tests/Functional.at/tests/atd_allow_deny_no_user.sh new file +45 -0
45 lines not on this page · raw message
engine/tests/Functional.at/tests/atd_allow_no_user.sh new file +43 -0
43 lines not on this page · raw message
engine/tests/Functional.at/tests/atd_atq.sh new file +39 -0
@@ -0,0 +1,39 @@ +#!/bin/sh + +# In the target start atd, check the status of job. + +test="atq" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target atd stop + +if exec_service_on_target atd start +then + echo " -> start atd succeeded." +else + echo " -> start atd failed." + echo " -> $test: TEST-FAIL" + exit +fi + +mkdir test_dir +cp data/test_add.sh test_dir/ + +at -f test_dir/test_add.sh now + 5 minutes + +if atq +then + echo " -> $test: TEST-PASS" +else + echo " -> list job failed." + echo " -> $test: TEST-FAIL" +fi + +rm -fr test_dir + +at -d $(at -l | cut -b 1-2) + +exec_service_on_target atd stop
engine/tests/Functional.at/tests/atd_atrm.sh new file +39 -0
@@ -0,0 +1,39 @@ +#!/bin/sh + +# In the target start atd, check the status of job. + +test="atrm" + +. ./fuego_board_function_lib.sh + +set_init_manager + +exec_service_on_target atd stop + +if exec_service_on_target atd start +then + echo " -> start atd succeeded." +else + echo " -> start atd failed." + echo " -> $test: TEST-FAIL" + exit +fi + +mkdir test_dir +cp data/test_add.sh test_dir/ + +at -f test_dir/test_add.sh now + 5 minutes + +if atrm $(at -l | cut -b 1-2) +then + echo " -> $test: TEST-PASS" +else + echo " -> remove the job failed." + echo " -> $test: TEST-FAIL" +fi + +rm -fr test_dir + +at -d $(at -l | cut -b 1-2) + +exec_service_on_target atd stop
engine/tests/Functional.at/tests/atd_deny_no_user.sh new file +43 -0
43 lines not on this page · raw message
engine/tests/Functional.at/tests/atd_job.sh new file +68 -0
68 lines not on this page · raw message
engine/tests/Functional.at/tests/atd_pidfile.sh new file +55 -0
55 lines not on this page · raw message
engine/tests/Functional.at/tests/atd_ps.sh new file +51 -0
51 lines not on this page · raw message
engine/tests/Functional.at/tests/atd_syslog.sh new file +49 -0
49 lines not on this page · raw message
Signature · 1 line
1.8.3.1