All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] util-linux: Add ptest
@ 2015-11-23 23:41 Tudor Florea
  2015-11-23 23:41 ` [PATCH 1/1] " Tudor Florea
  0 siblings, 1 reply; 5+ messages in thread
From: Tudor Florea @ 2015-11-23 23:41 UTC (permalink / raw)
  To: openembedded-core

Some of util-linux tool tests have not been added because of gcc dependency.

Sample ptest output:
root@qemuppc:/usr/lib/util-linux/ptest# ./run-ptest 

-------------------- util-linux regression tests --------------------

                    For development purpose only.                    
                 Don't execute on production system!                 

PASS:        bitops: swap bytes                    
SKIP:     build-sys: config                         (optional)
PASS:           cal: 1 month                       
PASS:           cal: 1 month with week numbers     
PASS:           cal: 3 months                      
PASS:           cal: 3 months with week numbers    
PASS:           cal: Year 2147483646               
PASS:           cal: Year 2147483646 with week numbers
PASS:           cal: color                         
PASS:           cal: color with week numbers       
PASS:           cal: September 1752                
PASS:           cal: September 1752 with week numbers
PASS:           cal: week number given as argument 
PASS:           cal: week number corner cases      
PASS:           cal: year                          
PASS:           cal: year with week numbers        
PASS:           col: multibyte input               
PASS:         colrm: basic check                   
PASS:        column: fill row                      
PASS:        column: invalid multibyte             
PASS:        column: multiple files                
PASS:        column: separator & table             
PASS:         dmesg: levels                        
PASS:         dmesg: decode                        
PASS:         dmesg: delta                         
PASS:         dmesg: facilities                    
SKIP:          fsck: is mounted                     (missing in PATH: mkfs.ext3)
      hexdump: format-strings                 ...
PASS:       hexdump: empty-format                  
PASS:       hexdump: 1b_octal                      
PASS:       hexdump: 1b_char                       
PASS:       hexdump: canon                         
PASS:       hexdump: 2b_dec                        
PASS:       hexdump: 2b_octal                      
PASS:       hexdump: 2b_hex                        
           ... OK (all 7 sub-tests PASSED)
      hexdump: highlighting                   ...
PASS:       hexdump: 1b_octal-1                    
PASS:       hexdump: 1b_octal-2                    
PASS:       hexdump: 1b_octal-3                    
PASS:       hexdump: 1b_octal-4                    
PASS:       hexdump: 1b_octal-5                    
PASS:       hexdump: 1b_octal-6                    
PASS:       hexdump: 1b_octal-7                    
PASS:       hexdump: 1b_octal-8                    
PASS:       hexdump: 1b_octal-9                    
PASS:       hexdump: 1b_char-1                     
PASS:       hexdump: 1b_char-2                     
PASS:       hexdump: 1b_char-3                     
PASS:       hexdump: canon-1                       
PASS:       hexdump: canon-2                       
PASS:       hexdump: 2b_dec-1                      
PASS:       hexdump: 2b_dec-2                      
PASS:       hexdump: 2b_dec-3                      
PASS:       hexdump: 2b_dec-4                      
PASS:       hexdump: 2b_dec-5                      
PASS:       hexdump: 2b_dec-6                      
PASS:       hexdump: 2b_dec-7                      
PASS:       hexdump: 2b_dec-8                      
PASS:       hexdump: 4b_dec-1                      
PASS:       hexdump: 4b_dec-2                      
PASS:       hexdump: 4b_dec-3                      
PASS:       hexdump: 4b_dec-4                      
PASS:       hexdump: 4b_dec-5                      
PASS:       hexdump: 4b_dec-6                      
PASS:       hexdump: 4b_dec-7                      
           ... OK (all 29 sub-tests PASSED)
SKIP:       hwclock: system to hw                   (missing in PATH: bc)
PASS:          ipcs: headers                       
SKIP:          ipcs: limits overflow                (missing in PATH: bc)
SKIP:          ipcs: basic limits                   (missing in PATH: bc)
PASS:          ipcs: mk-rm-msg                     
PASS:          ipcs: mk-rm-sem                     
PASS:          ipcs: mk-rm-shm                     
      isosize: print-size                     ...
PASS:       isosize: default_output                
PASS:       isosize: sector_output                 
PASS:       isosize: divisor_output                
           ... OK (all 3 sub-tests PASSED)
PASS:         login: islocal                       
PASS:         login: defs                          
PASS:          look: separator                     
PASS:           md5:                               
PASS:          misc: fallocate                     
PASS:          misc: getopt                        
         misc: getopt2                        ...
PASS:          misc: alternative_option_clash      
PASS:          misc: alternative_option_long       
PASS:          misc: alternative_option_short      
PASS:          misc: invalid_getopt_option         
PASS:          misc: invocation_model_one          
PASS:          misc: invocation_model_three_as_one 
PASS:          misc: invocation_model_two_as_one   
PASS:          misc: invocation_without_parameters 
PASS:          misc: long_option_ambiguous_1       
PASS:          misc: longopts                      
PASS:          misc: name_option_long              
PASS:          misc: name_option_short             
PASS:          misc: quiet_option_long             
PASS:          misc: quiet_option_short            
PASS:          misc: quiet_output_option_long      
PASS:          misc: quiet_output_option_short     
PASS:          misc: same_long_short_options       
PASS:          misc: test_for_enhanced_getopt      
PASS:          misc: unknown_options               
PASS:          misc: unquoted_option_bash          
PASS:          misc: unquoted_option_tcsh          
PASS:          misc: weird_quoting_bash            
PASS:          misc: weird_quoting_tcsh            
           ... OK (all 23 sub-tests PASSED)
         misc: getopt3                        ...
PASS:          misc: compatible                    
PASS:          misc: sh                            
PASS:          misc: csh                           
PASS:          misc: no-arguments                  
PASS:          misc: posix_correctly               
PASS:          misc: non-option                    
           ... OK (all 6 sub-tests PASSED)
PASS:          misc: ionice                        
SKIP:          misc: line                           (line not found)
PASS:          misc: mcookie                       
PASS:          misc: rev                           
PASS:          misc: setarch                       
PASS:          misc: setsid                        
PASS:          misc: strtosize                     
FAIL:          misc: swaplabel                      (misc/swaplabel)
FAIL:          misc: ul                             (misc/ul)
PASS:          misc: whereis                       
PASS:          more: regexp                        
PASS:          more: squeeze                       
PASS:         namei: basic functionality           
FAIL:         paths: built-in                       (paths/built-in)
PASS:    schedutils: cpuset                        
SKIP:        script: race conditions                (optional)
SKIP:        swapon: by devname                     (no loop-device support)
SKIP:        swapon: fix page size                  (no loop-device support)
SKIP:        swapon: fix signature                  (no loop-device support)
SKIP:        swapon: by label                       (no loop-device support)
SKIP:        swapon: by uuid                        (no loop-device support)
PASS:         tailf: simple                        

---------------------------------------------------------------------
  3 tests of 67 FAILED
---------------------------------------------------------------------


Tudor Florea (1):
  util-linux: Add ptest

 meta/recipes-core/util-linux/util-linux.inc        |  31 ++++-
 .../util-linux/avoid_parallel_tests.patch          | 145 +++++++++++++++++++++
 .../util-linux/avoid_unsupported_sleep_param.patch |  20 +++
 .../util-linux/display_testname_for_subtest.patch  |  18 +++
 .../recipes-core/util-linux/util-linux/ptest.patch |  17 +++
 meta/recipes-core/util-linux/util-linux/run-ptest  |  10 ++
 meta/recipes-core/util-linux/util-linux_2.26.2.bb  |   5 +
 7 files changed, 245 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/ptest.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/run-ptest

-- 
1.9.1



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

* [PATCH 1/1] util-linux: Add ptest
  2015-11-23 23:41 [PATCH 0/1] util-linux: Add ptest Tudor Florea
@ 2015-11-23 23:41 ` Tudor Florea
  2015-11-25 21:33   ` Burton, Ross
  0 siblings, 1 reply; 5+ messages in thread
From: Tudor Florea @ 2015-11-23 23:41 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Tudor Florea <tudor.florea@enea.com>
---
 meta/recipes-core/util-linux/util-linux.inc        |  31 ++++-
 .../util-linux/avoid_parallel_tests.patch          | 145 +++++++++++++++++++++
 .../util-linux/avoid_unsupported_sleep_param.patch |  20 +++
 .../util-linux/display_testname_for_subtest.patch  |  18 +++
 .../recipes-core/util-linux/util-linux/ptest.patch |  17 +++
 meta/recipes-core/util-linux/util-linux/run-ptest  |  10 ++
 meta/recipes-core/util-linux/util-linux_2.26.2.bb  |   5 +
 7 files changed, 245 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/ptest.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/run-ptest

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 594108f..95a7297 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -17,7 +17,7 @@ LIC_FILES_CHKSUM = "file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c
                     file://libmount/COPYING;md5=fb93f01d4361069c5616327705373b16 \
                     file://libblkid/COPYING;md5=fb93f01d4361069c5616327705373b16"
 
-inherit autotools gettext pkgconfig systemd update-alternatives python-dir
+inherit autotools gettext pkgconfig systemd update-alternatives python-dir ptest
 DEPENDS = "zlib ncurses"
 DEPENDS_append_class-native = " lzo-native"
 DEPENDS_append_class-nativesdk = " lzo-native"
@@ -272,3 +272,32 @@ python populate_packages_prepend() {
                       description='util-linux lib%s',
                       extra_depends='', prepend=True, allow_links=True)
 }
+
+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 md5 misc more namei paths schedutils script swapon tailf"
+    # 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
+    # lscpu gcc dependant
+    # 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
+}
diff --git a/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch b/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
new file mode 100644
index 0000000..ece260c
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
@@ -0,0 +1,145 @@
+Ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+Revert run.sh script accordingly to serialize running tests 
+
+Signed-off-by: Tudor Florea  <tudor.florea@enea.com>
+Upstream-Status: Inappropriate 
+
+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])])
+--- a/tests/run.sh	2015-11-18 15:09:05.517018566 +0100
++++ b/tests/run.sh	2015-11-18 20:02:15.492749213 +0100
+@@ -16,22 +16,12 @@
+ # GNU General Public License for more details.
+ #
+ 
+-TS_TOPDIR=$(cd ${0%/*} && pwd)
++TS_TOPDIR=$(cd $(dirname $0) && pwd)
+ SUBTESTS=
+ OPTS=
+ 
+ top_srcdir=
+ top_builddir=
+-paraller_jobs=1
+-
+-function num_cpus()
+-{
+-	if lscpu -p &>/dev/null; then
+-		lscpu -p | grep -cv '^#'
+-	else
+-		echo 1
+-	fi
+-}
+ 
+ while [ -n "$1" ]; do
+ 	case "$1" in
+@@ -47,9 +37,6 @@
+ 	--verbose)
+ 		OPTS="$OPTS --verbose"
+ 		;;
+-	--skip-loopdevs)
+-		OPTS="$OPTS --skip-loopdevs"
+-		;;
+ 	--nonroot)
+ 		if [ $(id -ru) -eq 0 ]; then
+ 			echo "Ignore util-linux test suite [non-root UID expected]."
+@@ -62,14 +49,6 @@
+ 	--builddir=*)
+ 		top_builddir="${1##--builddir=}"
+ 		;;
+-	--parallel=*)
+-		paraller_jobs="${1##--parallel=}"
+-		OPTS="$OPTS --parallel"
+-		;;
+-	--parallel)
+-		paraller_jobs=$(num_cpus)
+-		OPTS="$OPTS --parallel"
+-		;;
+ 	--*)
+ 		echo "Unknown option $1"
+ 		echo "Usage: "
+@@ -82,7 +61,6 @@
+ 		echo "  --nonroot         ignore test suite if user is root"
+ 		echo "  --srcdir=<path>   autotools top source directory"
+ 		echo "  --builddir=<path> autotools top build directory"
+-		echo "  --parallel=<num>  number of parallel test jobs, default: num cpus"
+ 		echo
+ 		exit 1
+ 		;;
+@@ -109,24 +87,24 @@
+ 
+ OPTS="$OPTS --srcdir=$top_srcdir --builddir=$top_builddir"
+ 
+-declare -a comps
+ if [ -n "$SUBTESTS" ]; then
+ 	# selected tests only
+ 	for s in $SUBTESTS; do
+ 		if [ -d "$top_srcdir/tests/ts/$s" ]; then
+-			comps+=( $(find $top_srcdir/tests/ts/$s -type f -perm /a+x -regex ".*/[^\.~]*") )
++			co=$(find $top_srcdir/tests/ts/$s -type f -perm -111 -regex ".*/[^\.~]*" |  sort)
++			comps="$comps $co"
+ 		else
+ 			echo "Unknown test component '$s'"
+ 			exit 1
+ 		fi
+ 	done
+ else
+-	if [ ! -f "$top_builddir/test_ttyutils" ]; then
++	if [ ! -f "$top_builddir/test_ttyutils" ];  then
+ 		echo "Tests not compiled! Run 'make check' to fix the problem."
+ 		exit 1
+ 	fi
+ 
+-	comps=( $(find $top_srcdir/tests/ts/ -type f -perm /a+x -regex ".*/[^\.~]*") )
++	comps=$(find $top_srcdir/tests/ts/ -type f -perm -111 -regex ".*/[^\.~]*" |  sort)
+ fi
+ 
+ 
+@@ -141,27 +119,21 @@
+ echo "                 Don't execute on production system!                 "
+ echo
+ 
+-if [ $paraller_jobs -gt 1 ]; then
+-	echo "              Executing the tests in parallel ($paraller_jobs jobs)    "
+-	echo
+-fi
+-
++res=0
+ count=0
+->| $top_builddir/tests/failures
+-printf "%s\n" ${comps[*]} |
+-	sort |
+-	xargs -I '{}' -P $paraller_jobs -n 1 bash -c "'{}' \"$OPTS\" ||
+-		echo 1 >> $top_builddir/tests/failures"
+-declare -a fail_file
+-fail_file=( $( < $top_builddir/tests/failures ) ) || exit 1
+-rm -f $top_builddir/tests/failures
++for ts in $comps; do
++	$ts "$OPTS"
++	res=$(( $res + $? ))
++	count=$(( $count + 1 ))
++done
++
+ echo
+ echo "---------------------------------------------------------------------"
+-if [ ${#fail_file[@]} -eq 0 ]; then
+-	echo "  All ${#comps[@]} tests PASSED"
++if [ $res -eq 0 ]; then
++	echo "  All $count tests PASSED"
+ 	res=0
+ else
+-	echo "  ${#fail_file[@]} tests of ${#comps[@]} FAILED"
++	echo "  $res tests of $count FAILED"
+ 	res=1
+ fi
+ echo "---------------------------------------------------------------------"
diff --git a/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
new file mode 100644
index 0000000..7a63a4e
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
@@ -0,0 +1,20 @@
+Avoid unsupported sleep parameter
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/simple b/simple
+--- a/tests/ts/tailf/simple	2015-11-12 11:34:49.971817130 +0200
++++ b/tests/ts/tailf/simple	2013-11-12 11:34:37.876325128 +0200
+@@ -27,9 +27,9 @@
+ 
+ $TS_CMD_TAILF $INPUT > $TS_OUTPUT 2>&1 &
+ 
+-sleep 0.5
++sleep 1
+ echo {0..9} >> $INPUT
+-sleep 0.5
++sleep 1
+ 
+ rm -f $INPUT
+ 
diff --git a/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch b/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
new file mode 100644
index 0000000..0eb8810
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
@@ -0,0 +1,18 @@
+Display testname for subtest
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/functions.sh b/functions.sh
+--- a/tests/functions.sh	2015-11-12 21:32:02.434542124 +0100
++++ b/tests/functions.sh	2015-11-12 21:40:37.095317280 +0100
+@@ -297,7 +297,7 @@
+ 	if [ "$TS_PARALLEL" == "yes" ]; then
+ 		TS_TITLE=$(printf "%13s: %-30s ...\n%16s: %-27s ..." "$TS_COMPONENT" "$TS_DESC" "" "$TS_SUBNAME")
+ 	else
+-		TS_TITLE=$(printf "%16s: %-27s ..." "" "$TS_SUBNAME")
++               TS_TITLE=$(printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME")
+ 		echo -n "$TS_TITLE"
+ 	fi
+ }
+
diff --git a/meta/recipes-core/util-linux/util-linux/ptest.patch b/meta/recipes-core/util-linux/util-linux/ptest.patch
new file mode 100644
index 0000000..837f189
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/ptest.patch
@@ -0,0 +1,17 @@
+Define TESTS variable
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/Makefile.am b/Makefile.am
+--- a/Makefile.am	2015-11-12 20:29:46.778396936 +0100
++++ b/Makefile.am	2015-11-12 20:32:24.342450279 +0100
+@@ -48,7 +48,7 @@
+ dist_bashcompletion_DATA =
+ check_PROGRAMS =
+ dist_check_SCRIPTS =
+-TESTS =
++TESTS = $(check_PROGRAMS)
+ 
+ PATHFILES =
+
diff --git a/meta/recipes-core/util-linux/util-linux/run-ptest b/meta/recipes-core/util-linux/util-linux/run-ptest
new file mode 100644
index 0000000..e155ec6
--- /dev/null
+++ b/meta/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/^\(.*\):\(.*\) \.\.\. SKIPPED \(.*\)$/SKIP: \1:\2 \3/
+   }'
+}
diff --git a/meta/recipes-core/util-linux/util-linux_2.26.2.bb b/meta/recipes-core/util-linux/util-linux_2.26.2.bb
index e09fdfa..bba7dc8 100644
--- a/meta/recipes-core/util-linux/util-linux_2.26.2.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.26.2.bb
@@ -16,6 +16,11 @@ SRC_URI += "file://util-linux-ng-replace-siginterrupt.patch \
             file://runuser.pamd \
             file://runuser-l.pamd \
             ${OLDHOST} \
+            file://ptest.patch \
+            file://run-ptest \
+            file://avoid_unsupported_sleep_param.patch \
+            file://display_testname_for_subtest.patch \
+            file://avoid_parallel_tests.patch \
 "
 SRC_URI[md5sum] = "9bdf368c395f1b70325d0eb22c7f48fb"
 SRC_URI[sha256sum] = "0e29bda142528a48a0a953c39ff63093651a4809042e1790fbd6aa8663fd9666"
-- 
1.9.1



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

* Re: [PATCH 1/1] util-linux: Add ptest
  2015-11-23 23:41 ` [PATCH 1/1] " Tudor Florea
@ 2015-11-25 21:33   ` Burton, Ross
  2015-11-25 23:00     ` Tudor Florea
  0 siblings, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2015-11-25 21:33 UTC (permalink / raw)
  To: Tudor Florea; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

On 23 November 2015 at 23:41, Tudor Florea <tudor.florea@enea.com> wrote:

> +--- a/tests/run.sh     2015-11-18 15:09:05.517018566 +0100
> ++++ b/tests/run.sh     2015-11-18 20:02:15.492749213 +0100
>

Would it be possible to keep run.sh as it is but pass --parallel 1 from
run-ptest so it doesn't run the jobs in parallel?  Or, do we care if it
runs the tests in parallel?  I'm looking at that patch and thinking it's
going to be a nightmare to maintain when upstream modifies their script.

Ross

[-- Attachment #2: Type: text/html, Size: 937 bytes --]

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

* Re: [PATCH 1/1] util-linux: Add ptest
  2015-11-25 21:33   ` Burton, Ross
@ 2015-11-25 23:00     ` Tudor Florea
  0 siblings, 0 replies; 5+ messages in thread
From: Tudor Florea @ 2015-11-25 23:00 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core



On 25/11/2015 23:33, Burton, Ross wrote:
> 
> On 23 November 2015 at 23:41, Tudor Florea <tudor.florea@enea.com 
> <mailto:tudor.florea@enea.com>> wrote:
> 
> +--- a/tests/run.sh     2015-11-18 15:09:05.517018566 +0100 ++++
> b/tests/run.sh     2015-11-18 20:02:15.492749213 +0100
> 
> 
> Would it be possible to keep run.sh as it is but pass --parallel 1
> from run-ptest so it doesn't run the jobs in parallel?
Short answer is no. In the latest version the package run.sh has been
adapted to work with parallel test driver (only). Ptest however works
with serial test driver only at this moment.

Partly off-topic: This automake patch [1] would we a good step toward
having Ptest working in parallel. However the patch was not yet
applied in poky and upstream still haven't answered the query [2]

> Or, do we care if it runs the tests in parallel?
Running tests in parallel have the benefit of spending less time with
testing. Otherwise, the results should be the same.
> I'm looking at that patch and thinking it's going to be a nightmare
> to maintain when upstream modifies their script.
I agree is not the best patch. I simply revert to the file used in
version 2.24.2 ( plus a minor grep option addition) to make it work.
We will get rid of this patch when we eventually make Ptest run with
parallel test driver.

Another option is to ignore run.sh wrapper and add the logic "run all
testcases" into run-ptest.

> 
> Ross

[1]
http://lists.openembedded.org/pipermail/openembedded-core/2014-November/098932.html
[2] https://lists.gnu.org/archive/html/bug-automake/2014-11/msg00005.html

Regards,
  Tudor.


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

* [PATCH 1/1] util-linux: Add ptest
@ 2015-12-03  3:08 Tudor Florea
  0 siblings, 0 replies; 5+ messages in thread
From: Tudor Florea @ 2015-12-03  3:08 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Tudor Florea <tudor.florea@enea.com>
---
 meta/recipes-core/util-linux/util-linux.inc        | 31 +++++++++++-
 .../util-linux/avoid_parallel_tests.patch          | 19 ++++++++
 .../util-linux/avoid_unsupported_grep_opts.patch   | 57 ++++++++++++++++++++++
 .../util-linux/avoid_unsupported_sleep_param.patch | 20 ++++++++
 .../util-linux/display_testname_for_subtest.patch  | 18 +++++++
 .../recipes-core/util-linux/util-linux/ptest.patch | 17 +++++++
 meta/recipes-core/util-linux/util-linux/run-ptest  | 25 ++++++++++
 meta/recipes-core/util-linux/util-linux_2.26.2.bb  |  6 +++
 8 files changed, 192 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/ptest.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/run-ptest

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 594108f..95a7297 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -17,7 +17,7 @@ LIC_FILES_CHKSUM = "file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c
                     file://libmount/COPYING;md5=fb93f01d4361069c5616327705373b16 \
                     file://libblkid/COPYING;md5=fb93f01d4361069c5616327705373b16"
 
-inherit autotools gettext pkgconfig systemd update-alternatives python-dir
+inherit autotools gettext pkgconfig systemd update-alternatives python-dir ptest
 DEPENDS = "zlib ncurses"
 DEPENDS_append_class-native = " lzo-native"
 DEPENDS_append_class-nativesdk = " lzo-native"
@@ -272,3 +272,32 @@ python populate_packages_prepend() {
                       description='util-linux lib%s',
                       extra_depends='', prepend=True, allow_links=True)
 }
+
+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 md5 misc more namei paths schedutils script swapon tailf"
+    # 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
+    # lscpu gcc dependant
+    # 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
+}
diff --git a/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch b/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
new file mode 100644
index 0000000..46d4d37
--- /dev/null
+++ b/meta/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.
+Revert run.sh script accordingly to serialize running tests 
+
+Signed-off-by: Tudor Florea  <tudor.florea@enea.com>
+Upstream-Status: Inappropriate 
+
+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/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch
new file mode 100644
index 0000000..a0d5efa
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch
@@ -0,0 +1,57 @@
+Avoid unsupported grep options
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+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/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
new file mode 100644
index 0000000..7a63a4e
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
@@ -0,0 +1,20 @@
+Avoid unsupported sleep parameter
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/simple b/simple
+--- a/tests/ts/tailf/simple	2015-11-12 11:34:49.971817130 +0200
++++ b/tests/ts/tailf/simple	2013-11-12 11:34:37.876325128 +0200
+@@ -27,9 +27,9 @@
+ 
+ $TS_CMD_TAILF $INPUT > $TS_OUTPUT 2>&1 &
+ 
+-sleep 0.5
++sleep 1
+ echo {0..9} >> $INPUT
+-sleep 0.5
++sleep 1
+ 
+ rm -f $INPUT
+ 
diff --git a/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch b/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
new file mode 100644
index 0000000..0eb8810
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
@@ -0,0 +1,18 @@
+Display testname for subtest
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/functions.sh b/functions.sh
+--- a/tests/functions.sh	2015-11-12 21:32:02.434542124 +0100
++++ b/tests/functions.sh	2015-11-12 21:40:37.095317280 +0100
+@@ -297,7 +297,7 @@
+ 	if [ "$TS_PARALLEL" == "yes" ]; then
+ 		TS_TITLE=$(printf "%13s: %-30s ...\n%16s: %-27s ..." "$TS_COMPONENT" "$TS_DESC" "" "$TS_SUBNAME")
+ 	else
+-		TS_TITLE=$(printf "%16s: %-27s ..." "" "$TS_SUBNAME")
++               TS_TITLE=$(printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME")
+ 		echo -n "$TS_TITLE"
+ 	fi
+ }
+
diff --git a/meta/recipes-core/util-linux/util-linux/ptest.patch b/meta/recipes-core/util-linux/util-linux/ptest.patch
new file mode 100644
index 0000000..837f189
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/ptest.patch
@@ -0,0 +1,17 @@
+Define TESTS variable
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/Makefile.am b/Makefile.am
+--- a/Makefile.am	2015-11-12 20:29:46.778396936 +0100
++++ b/Makefile.am	2015-11-12 20:32:24.342450279 +0100
+@@ -48,7 +48,7 @@
+ dist_bashcompletion_DATA =
+ check_PROGRAMS =
+ dist_check_SCRIPTS =
+-TESTS =
++TESTS = $(check_PROGRAMS)
+ 
+ PATHFILES =
+
diff --git a/meta/recipes-core/util-linux/util-linux/run-ptest b/meta/recipes-core/util-linux/util-linux/run-ptest
new file mode 100644
index 0000000..fbc2f9b
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/run-ptest
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+cd tests || exit 1                                                          
+
+comps=$(find ts/ -type f -perm -111 -regex ".*/[^\.~]*" |  sort)
+
+
+echo
+echo "-------------------- util-linux regression tests --------------------"
+echo
+echo "                    For development purpose only.                    "
+echo "                 Don't execute on production system!                 "
+echo
+
+res=0
+count=0
+for ts in $comps; 
+do 
+   $ts | sed '{        
+      s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/                              
+      s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/                
+      s/^\(.*\):\(.*\) \.\.\. SKIPPED \(.*\)$/SKIP: \1:\2 \3/               
+   }' 
+done
+
diff --git a/meta/recipes-core/util-linux/util-linux_2.26.2.bb b/meta/recipes-core/util-linux/util-linux_2.26.2.bb
index e09fdfa..02e42c1 100644
--- a/meta/recipes-core/util-linux/util-linux_2.26.2.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.26.2.bb
@@ -16,6 +16,12 @@ SRC_URI += "file://util-linux-ng-replace-siginterrupt.patch \
             file://runuser.pamd \
             file://runuser-l.pamd \
             ${OLDHOST} \
+            file://ptest.patch \
+            file://run-ptest \
+            file://avoid_unsupported_sleep_param.patch \
+            file://avoid_unsupported_grep_opts.patch \
+            file://display_testname_for_subtest.patch \
+            file://avoid_parallel_tests.patch \
 "
 SRC_URI[md5sum] = "9bdf368c395f1b70325d0eb22c7f48fb"
 SRC_URI[sha256sum] = "0e29bda142528a48a0a953c39ff63093651a4809042e1790fbd6aa8663fd9666"
-- 
1.9.1



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

end of thread, other threads:[~2015-12-03  3:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-23 23:41 [PATCH 0/1] util-linux: Add ptest Tudor Florea
2015-11-23 23:41 ` [PATCH 1/1] " Tudor Florea
2015-11-25 21:33   ` Burton, Ross
2015-11-25 23:00     ` Tudor Florea
2015-12-03  3:08 Tudor Florea

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.