diff options
| author | Tudor Florea <tudor.florea@enea.com> | 2015-11-18 08:44:53 +0100 |
|---|---|---|
| committer | Adrian Dudau <adrian.dudau@enea.com> | 2015-11-18 10:58:59 +0100 |
| commit | f40b6f3d51b5637f357d7eb08cde33b320528615 (patch) | |
| tree | 0f2f2d767cd4e5c13c54fcd46b3aa8744f4cc356 /recipes-core/util-linux | |
| parent | d94fd9a92c28523914bf3fb196bea7f863a98782 (diff) | |
| download | meta-el-common-f40b6f3d51b5637f357d7eb08cde33b320528615.tar.gz | |
util-linux: add ptest
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'recipes-core/util-linux')
8 files changed, 218 insertions, 0 deletions
diff --git a/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch b/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch new file mode 100644 index 0000000..9f6a720 --- /dev/null +++ b/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | ptest needs buildtest-TESTS and runtest-TESTS targets. | ||
| 2 | serial-tests is required to generate those targets. | ||
| 3 | |||
| 4 | Signed-off-by: Alexandra Safta <alexandra.safta@enea.com> | ||
| 5 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
| 6 | Upstream-Status: Inapporpriate | ||
| 7 | |||
| 8 | diff -ruN a/configure.ac b/configure.ac | ||
| 9 | --- a/configure.ac 2014-05-27 12:37:42.119772658 +0200 | ||
| 10 | +++ b/configure.ac 2014-05-27 12:41:46.225573272 +0200 | ||
| 11 | @@ -10,7 +10,7 @@ | ||
| 12 | dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run | ||
| 13 | dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors. | ||
| 14 | AC_USE_SYSTEM_EXTENSIONS | ||
| 15 | -AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects]) | ||
| 16 | +AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects serial-tests]) | ||
| 17 | |||
| 18 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], | ||
| 19 | [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) | ||
diff --git a/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch b/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch new file mode 100644 index 0000000..13dc7dd --- /dev/null +++ b/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | Avoid unsupported find options | ||
| 2 | |||
| 3 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
| 4 | Upstream-Status: Pending | ||
| 5 | |||
| 6 | diff -ruN a/tests/run.sh b/tests/run.sh | ||
| 7 | --- a/tests/run.sh 2013-08-26 23:48:48.868279097 +0200 | ||
| 8 | +++ b/tests/run.sh 2013-08-27 00:14:35.646730004 +0200 | ||
| 9 | @@ -91,7 +91,7 @@ | ||
| 10 | # selected tests only | ||
| 11 | for s in $SUBTESTS; do | ||
| 12 | if [ -d "$top_srcdir/tests/ts/$s" ]; then | ||
| 13 | - co=$(find $top_srcdir/tests/ts/$s -type f -perm /a+x -regex ".*/[^\.~]*" | sort) | ||
| 14 | + co=$(find $top_srcdir/tests/ts/$s -type f -perm -111 -regex ".*/[^\.~]*" | sort) | ||
| 15 | comps="$comps $co" | ||
| 16 | else | ||
| 17 | echo "Unknown test component '$s'" | ||
| 18 | @@ -104,7 +104,7 @@ | ||
| 19 | exit 1 | ||
| 20 | fi | ||
| 21 | |||
| 22 | - comps=$(find $top_srcdir/tests/ts/ -type f -perm /a+x -regex ".*/[^\.~]*" | sort) | ||
| 23 | + comps=$(find $top_srcdir/tests/ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort) | ||
| 24 | fi | ||
| 25 | |||
| 26 | |||
| 27 | diff -ruN a/tests/ts/build-sys/config b/tests/ts/build-sys/config | ||
| 28 | --- a/tests/ts/build-sys/config 2013-08-26 23:50:26.800131581 +0200 | ||
| 29 | +++ b/tests/ts/build-sys/config 2013-08-27 00:10:02.806302850 +0200 | ||
| 30 | @@ -32,7 +32,7 @@ | ||
| 31 | ./configure $opts &> /dev/null | ||
| 32 | make -j &> /dev/null | ||
| 33 | |||
| 34 | - bins=$(find . -type f -perm /a+x | sort) | ||
| 35 | + bins=$(find . -type f -perm -111 | sort) | ||
| 36 | for b in $bins; do | ||
| 37 | libs=$(readelf --dynamic $b 2> /dev/null | \ | ||
| 38 | awk '/NEEDED/ { print $5 }' | \ | ||
diff --git a/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch b/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch new file mode 100644 index 0000000..a0d5efa --- /dev/null +++ b/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | Avoid unsupported grep options | ||
| 2 | |||
| 3 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
| 4 | Upstream-Status: Pending | ||
| 5 | |||
| 6 | diff -ruN a/ts/ipcs/headers b/ts/ipcs/headers | ||
| 7 | --- a/tests/ts/ipcs/headers 2013-09-04 11:03:36.118613250 +0200 | ||
| 8 | +++ b/teste/ts/ipcs/headers 2013-09-04 11:03:27.906958437 +0200 | ||
| 9 | @@ -22,35 +22,35 @@ | ||
| 10 | ts_init "$*" | ||
| 11 | |||
| 12 | ts_log "test: shm headers" | ||
| 13 | -$TS_CMD_IPCS -m -t | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 14 | -$TS_CMD_IPCS -m -p | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 15 | -$TS_CMD_IPCS -m -c | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 16 | +$TS_CMD_IPCS -m -t | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 17 | +$TS_CMD_IPCS -m -p | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 18 | +$TS_CMD_IPCS -m -c | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 19 | $TS_CMD_IPCS -m -l | grep "^---" >> $TS_OUTPUT | ||
| 20 | $TS_CMD_IPCS -m -u | grep "^---" >> $TS_OUTPUT | ||
| 21 | echo >> $TS_OUTPUT | ||
| 22 | |||
| 23 | ts_log "test: mesg headers" | ||
| 24 | -$TS_CMD_IPCS -q -t | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 25 | -$TS_CMD_IPCS -q -p | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 26 | -$TS_CMD_IPCS -q -c | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 27 | +$TS_CMD_IPCS -q -t | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 28 | +$TS_CMD_IPCS -q -p | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 29 | +$TS_CMD_IPCS -q -c | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 30 | $TS_CMD_IPCS -q -l | grep "^---" >> $TS_OUTPUT | ||
| 31 | $TS_CMD_IPCS -q -u | grep "^---" >> $TS_OUTPUT | ||
| 32 | echo >> $TS_OUTPUT | ||
| 33 | |||
| 34 | ts_log "test: sem headers" | ||
| 35 | -$TS_CMD_IPCS -s -t | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 36 | -$TS_CMD_IPCS -s -p | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 37 | -$TS_CMD_IPCS -s -c | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 38 | +$TS_CMD_IPCS -s -t | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 39 | +$TS_CMD_IPCS -s -p | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 40 | +$TS_CMD_IPCS -s -c | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 41 | $TS_CMD_IPCS -s -l | grep "^---" >> $TS_OUTPUT | ||
| 42 | $TS_CMD_IPCS -s -u | grep "^---" >> $TS_OUTPUT | ||
| 43 | echo >> $TS_OUTPUT | ||
| 44 | |||
| 45 | ts_log "test: all headers" | ||
| 46 | -$TS_CMD_IPCS -a | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 47 | +$TS_CMD_IPCS -a | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 48 | |||
| 49 | -$TS_CMD_IPCS -a -t | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 50 | -$TS_CMD_IPCS -a -p | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 51 | -$TS_CMD_IPCS -a -c | grep --after-context=1 "^---" >> $TS_OUTPUT | ||
| 52 | +$TS_CMD_IPCS -a -t | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 53 | +$TS_CMD_IPCS -a -p | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 54 | +$TS_CMD_IPCS -a -c | grep -A 1 "^---" >> $TS_OUTPUT | ||
| 55 | $TS_CMD_IPCS -a -l | grep "^---" >> $TS_OUTPUT | ||
| 56 | $TS_CMD_IPCS -a -u | grep "^---" >> $TS_OUTPUT | ||
| 57 | |||
diff --git a/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch b/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch new file mode 100644 index 0000000..3a62067 --- /dev/null +++ b/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | Avoid unsupported sleep parameter | ||
| 2 | |||
| 3 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
| 4 | Upstream-Status: Pending | ||
| 5 | |||
| 6 | diff -ruN a/simple b/simple | ||
| 7 | --- a/tests/ts/tailf/simple 2013-09-04 11:34:49.971817130 +0200 | ||
| 8 | +++ b/tests/ts/tailf/simple 2013-09-04 11:34:37.876325128 +0200 | ||
| 9 | @@ -25,9 +25,9 @@ | ||
| 10 | |||
| 11 | $TS_CMD_TAILF $INPUT > $TS_OUTPUT 2>&1 & | ||
| 12 | |||
| 13 | -sleep 0.1 | ||
| 14 | +sleep 1 | ||
| 15 | echo {0..9} >> $INPUT | ||
| 16 | -sleep 0.1 | ||
| 17 | +sleep 1 | ||
| 18 | |||
| 19 | rm -f $INPUT | ||
| 20 | |||
diff --git a/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch b/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch new file mode 100644 index 0000000..64f02d5 --- /dev/null +++ b/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | Display testname for subtest | ||
| 2 | |||
| 3 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
| 4 | Upstream-Status: Pending | ||
| 5 | |||
| 6 | diff -ruN a/functions.sh b/functions.sh | ||
| 7 | --- a/tests/functions.sh 2013-09-04 12:41:07.625488953 +0200 | ||
| 8 | +++ b/tests/functions.sh 2013-09-04 17:33:02.402802957 +0200 | ||
| 9 | @@ -209,7 +209,7 @@ | ||
| 10 | [ $TS_NSUBTESTS -eq 0 ] && echo | ||
| 11 | TS_NSUBTESTS=$(( $TS_NSUBTESTS + 1 )) | ||
| 12 | |||
| 13 | - printf "%16s: %-27s ..." "" "$TS_SUBNAME" | ||
| 14 | + printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME" | ||
| 15 | } | ||
| 16 | |||
| 17 | function ts_init { | ||
diff --git a/recipes-core/util-linux/util-linux/ptest.patch b/recipes-core/util-linux/util-linux/ptest.patch new file mode 100644 index 0000000..e9adc90 --- /dev/null +++ b/recipes-core/util-linux/util-linux/ptest.patch | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | Define TESTS variable | ||
| 2 | |||
| 3 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
| 4 | Upstream-Status: Pending | ||
| 5 | |||
| 6 | diff -ruN a/Makefile.am b/Makefile.am | ||
| 7 | --- a/Makefile.am 2013-08-26 16:29:42.151429221 +0200 | ||
| 8 | +++ b/Makefile.am 2013-08-26 17:52:31.013898120 +0200 | ||
| 9 | @@ -43,7 +43,7 @@ | ||
| 10 | dist_usrbin_exec_SCRIPTS = | ||
| 11 | systemdsystemunit_DATA = | ||
| 12 | check_PROGRAMS = | ||
| 13 | -TESTS = | ||
| 14 | +TESTS = $(check_PROGRAMS) | ||
| 15 | |||
| 16 | PATHFILES = | ||
diff --git a/recipes-core/util-linux/util-linux/run-ptest b/recipes-core/util-linux/util-linux/run-ptest new file mode 100644 index 0000000..b04f14a --- /dev/null +++ b/recipes-core/util-linux/util-linux/run-ptest | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | cd tests || exit 1 | ||
| 4 | sh ./run.sh 2>&1 | { | ||
| 5 | sed '{ | ||
| 6 | s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/ | ||
| 7 | s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/ | ||
| 8 | s/^\(.*\):\(.*\) \.\.\. IGNORE \(.*\)$/SKIP: \1:\2 \3/ | ||
| 9 | }' | ||
| 10 | } | ||
diff --git a/recipes-core/util-linux/util-linux_%.bbappend b/recipes-core/util-linux/util-linux_%.bbappend new file mode 100644 index 0000000..c5f09ba --- /dev/null +++ b/recipes-core/util-linux/util-linux_%.bbappend | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
| 2 | |||
| 3 | inherit ptest | ||
| 4 | |||
| 5 | SRC_URI += " \ | ||
| 6 | file://ptest.patch \ | ||
| 7 | file://run-ptest \ | ||
| 8 | file://avoid_unsupported_find_opts.patch \ | ||
| 9 | file://avoid_unsupported_grep_opts.patch \ | ||
| 10 | file://avoid_unsupported_sleep_param.patch \ | ||
| 11 | file://display_testname_for_subtest.patch \ | ||
| 12 | file://avoid_parallel_tests.patch \ | ||
| 13 | " | ||
| 14 | |||
| 15 | RDEPENDS_${PN}-ptest += " bash" | ||
| 16 | |||
| 17 | do_compile_ptest() { | ||
| 18 | oe_runmake buildtest-TESTS | ||
| 19 | } | ||
| 20 | |||
| 21 | do_install_ptest() { | ||
| 22 | mkdir -p ${D}${PTEST_PATH}/tests/ts | ||
| 23 | find . -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; | ||
| 24 | cp ${S}/tests/functions.sh ${D}${PTEST_PATH}/tests/ | ||
| 25 | cp ${S}/tests/commands.sh ${D}${PTEST_PATH}/tests/ | ||
| 26 | cp ${S}/tests/run.sh ${D}${PTEST_PATH}/tests/ | ||
| 27 | cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected | ||
| 28 | |||
| 29 | list="bitops build-sys cal col colrm column dmesg fsck hexdump hwclock ipcs isosize login look lscpu md5 misc more namei paths schedutils script swapon tailf utmpdump" | ||
| 30 | # The following tests are not installed yet: | ||
| 31 | # blkid scsi_debug module dependent | ||
| 32 | # cramfs gcc dependent | ||
| 33 | # eject gcc dependent | ||
| 34 | # fdisk scsi_debug module and gcc dependent | ||
| 35 | # libmount uuidgen dependent | ||
| 36 | # mount gcc dependant | ||
| 37 | # partx blkid dependant | ||
| 38 | for d in $list; do | ||
| 39 | cp -pR ${S}/tests/ts/$d ${D}${PTEST_PATH}/tests/ts/ | ||
| 40 | done | ||
| 41 | } | ||
