From f40b6f3d51b5637f357d7eb08cde33b320528615 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Wed, 18 Nov 2015 08:44:53 +0100 Subject: util-linux: add ptest Signed-off-by: Tudor Florea Signed-off-by: Adrian Dudau --- .../util-linux/avoid_parallel_tests.patch | 19 ++++++++ .../util-linux/avoid_unsupported_find_opts.patch | 38 +++++++++++++++ .../util-linux/avoid_unsupported_grep_opts.patch | 57 ++++++++++++++++++++++ .../util-linux/avoid_unsupported_sleep_param.patch | 20 ++++++++ .../util-linux/display_testname_for_subtest.patch | 17 +++++++ recipes-core/util-linux/util-linux/ptest.patch | 16 ++++++ recipes-core/util-linux/util-linux/run-ptest | 10 ++++ recipes-core/util-linux/util-linux_%.bbappend | 41 ++++++++++++++++ 8 files changed, 218 insertions(+) create mode 100644 recipes-core/util-linux/util-linux/avoid_parallel_tests.patch create mode 100644 recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch create mode 100644 recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch create mode 100644 recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch create mode 100644 recipes-core/util-linux/util-linux/display_testname_for_subtest.patch create mode 100644 recipes-core/util-linux/util-linux/ptest.patch create mode 100644 recipes-core/util-linux/util-linux/run-ptest create mode 100644 recipes-core/util-linux/util-linux_%.bbappend (limited to 'recipes-core') 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 @@ +ptest needs buildtest-TESTS and runtest-TESTS targets. +serial-tests is required to generate those targets. + +Signed-off-by: Alexandra Safta +Signed-off-by: Tudor Florea +Upstream-Status: Inapporpriate + +diff -ruN a/configure.ac b/configure.ac +--- a/configure.ac 2014-05-27 12:37:42.119772658 +0200 ++++ b/configure.ac 2014-05-27 12:41:46.225573272 +0200 +@@ -10,7 +10,7 @@ + dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run + dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors. + AC_USE_SYSTEM_EXTENSIONS +-AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects]) ++AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects serial-tests]) + + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], + [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 @@ +Avoid unsupported find options + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/tests/run.sh b/tests/run.sh +--- a/tests/run.sh 2013-08-26 23:48:48.868279097 +0200 ++++ b/tests/run.sh 2013-08-27 00:14:35.646730004 +0200 +@@ -91,7 +91,7 @@ + # selected tests only + for s in $SUBTESTS; do + if [ -d "$top_srcdir/tests/ts/$s" ]; then +- co=$(find $top_srcdir/tests/ts/$s -type f -perm /a+x -regex ".*/[^\.~]*" | sort) ++ co=$(find $top_srcdir/tests/ts/$s -type f -perm -111 -regex ".*/[^\.~]*" | sort) + comps="$comps $co" + else + echo "Unknown test component '$s'" +@@ -104,7 +104,7 @@ + exit 1 + fi + +- comps=$(find $top_srcdir/tests/ts/ -type f -perm /a+x -regex ".*/[^\.~]*" | sort) ++ comps=$(find $top_srcdir/tests/ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort) + fi + + +diff -ruN a/tests/ts/build-sys/config b/tests/ts/build-sys/config +--- a/tests/ts/build-sys/config 2013-08-26 23:50:26.800131581 +0200 ++++ b/tests/ts/build-sys/config 2013-08-27 00:10:02.806302850 +0200 +@@ -32,7 +32,7 @@ + ./configure $opts &> /dev/null + make -j &> /dev/null + +- bins=$(find . -type f -perm /a+x | sort) ++ bins=$(find . -type f -perm -111 | sort) + for b in $bins; do + libs=$(readelf --dynamic $b 2> /dev/null | \ + 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 @@ +Avoid unsupported grep options + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/ts/ipcs/headers b/ts/ipcs/headers +--- a/tests/ts/ipcs/headers 2013-09-04 11:03:36.118613250 +0200 ++++ b/teste/ts/ipcs/headers 2013-09-04 11:03:27.906958437 +0200 +@@ -22,35 +22,35 @@ + ts_init "$*" + + ts_log "test: shm headers" +-$TS_CMD_IPCS -m -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -m -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -m -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -m -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -m -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -m -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -m -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -m -u | grep "^---" >> $TS_OUTPUT + echo >> $TS_OUTPUT + + ts_log "test: mesg headers" +-$TS_CMD_IPCS -q -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -q -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -q -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -q -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -q -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -q -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -q -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -q -u | grep "^---" >> $TS_OUTPUT + echo >> $TS_OUTPUT + + ts_log "test: sem headers" +-$TS_CMD_IPCS -s -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -s -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -s -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -s -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -s -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -s -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -s -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -s -u | grep "^---" >> $TS_OUTPUT + echo >> $TS_OUTPUT + + ts_log "test: all headers" +-$TS_CMD_IPCS -a | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a | grep -A 1 "^---" >> $TS_OUTPUT + +-$TS_CMD_IPCS -a -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -a -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -a -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -a -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -a -u | grep "^---" >> $TS_OUTPUT + 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 @@ +Avoid unsupported sleep parameter + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/simple b/simple +--- a/tests/ts/tailf/simple 2013-09-04 11:34:49.971817130 +0200 ++++ b/tests/ts/tailf/simple 2013-09-04 11:34:37.876325128 +0200 +@@ -25,9 +25,9 @@ + + $TS_CMD_TAILF $INPUT > $TS_OUTPUT 2>&1 & + +-sleep 0.1 ++sleep 1 + echo {0..9} >> $INPUT +-sleep 0.1 ++sleep 1 + + rm -f $INPUT + 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 @@ +Display testname for subtest + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/functions.sh b/functions.sh +--- a/tests/functions.sh 2013-09-04 12:41:07.625488953 +0200 ++++ b/tests/functions.sh 2013-09-04 17:33:02.402802957 +0200 +@@ -209,7 +209,7 @@ + [ $TS_NSUBTESTS -eq 0 ] && echo + TS_NSUBTESTS=$(( $TS_NSUBTESTS + 1 )) + +- printf "%16s: %-27s ..." "" "$TS_SUBNAME" ++ printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME" + } + + 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 @@ +Define TESTS variable + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/Makefile.am b/Makefile.am +--- a/Makefile.am 2013-08-26 16:29:42.151429221 +0200 ++++ b/Makefile.am 2013-08-26 17:52:31.013898120 +0200 +@@ -43,7 +43,7 @@ + dist_usrbin_exec_SCRIPTS = + systemdsystemunit_DATA = + check_PROGRAMS = +-TESTS = ++TESTS = $(check_PROGRAMS) + + 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 @@ +#!/bin/sh + +cd tests || exit 1 +sh ./run.sh 2>&1 | { + sed '{ + s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/ + s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/ + s/^\(.*\):\(.*\) \.\.\. IGNORE \(.*\)$/SKIP: \1:\2 \3/ + }' +} 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 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +inherit ptest + +SRC_URI += " \ + file://ptest.patch \ + file://run-ptest \ + file://avoid_unsupported_find_opts.patch \ + file://avoid_unsupported_grep_opts.patch \ + file://avoid_unsupported_sleep_param.patch \ + file://display_testname_for_subtest.patch \ + file://avoid_parallel_tests.patch \ + " + +RDEPENDS_${PN}-ptest += " bash" + +do_compile_ptest() { + oe_runmake buildtest-TESTS +} + +do_install_ptest() { + mkdir -p ${D}${PTEST_PATH}/tests/ts + find . -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; + cp ${S}/tests/functions.sh ${D}${PTEST_PATH}/tests/ + cp ${S}/tests/commands.sh ${D}${PTEST_PATH}/tests/ + cp ${S}/tests/run.sh ${D}${PTEST_PATH}/tests/ + cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected + + 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" + # The following tests are not installed yet: + # blkid scsi_debug module dependent + # cramfs gcc dependent + # eject gcc dependent + # fdisk scsi_debug module and gcc dependent + # libmount uuidgen dependent + # mount gcc dependant + # partx blkid dependant + for d in $list; do + cp -pR ${S}/tests/ts/$d ${D}${PTEST_PATH}/tests/ts/ + done +} -- cgit v1.2.3-54-g00ecf