@@ -109,6 +109,7 @@ PTESTS_SLOW = "\
python3-cryptography \
python3 \
strace \
+ tar \
tcl \
util-linux \
valgrind \
@@ -24,6 +24,9 @@ IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-mdadm = "1524288"
IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-strace = "1024288"
IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-lttng-tools = "1524288"
+# tar-ptest in particular needs more space
+IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-tar = "1524288"
+
# ptests need more memory than standard to avoid the OOM killer
QB_MEM = "-m 1024"
QB_MEM:virtclass-mcextend-lttng-tools = "-m 4096"
new file mode 100644
@@ -0,0 +1,107 @@
+tar: add support of --am-fmt
+
+Add --am-fmt into testsuites.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Qiu Tingting <qiutt@fujitsu.com>
+
+diff -rNu a/tests/testsuite b/tests/testsuite
+--- a/tests/testsuite 2023-09-22 13:42:29.696287678 +0800
++++ b/tests/testsuite 2023-09-22 13:54:54.592276865 +0800
+@@ -592,6 +592,8 @@
+ at_recheck=
+ # Whether a write failure occurred
+ at_write_fail=0
++# Automake result format "result: testname"
++at_am_fmt=false
+
+ # The directory we run the suite in. Default to . if no -C option.
+ at_dir=`pwd`
+@@ -947,7 +949,9 @@
+ at_trace_echo=echo
+ at_check_filter_trace=at_fn_filter_trace
+ ;;
+-
++ --am-fmt | -A )
++ at_am_fmt=:
++ ;;
+ [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
+ at_fn_validate_ranges at_option
+ as_fn_append at_groups "$at_option$as_nl"
+@@ -1156,6 +1160,7 @@
+ -d, --debug inhibit clean up and top-level logging
+ default for debugging scripts
+ -x, --trace enable tests shell tracing
++ -A, --am-fmt automake result format "result: testname"
+ _ATEOF
+ cat <<_ATEOF || at_write_fail=1
+
+@@ -1917,7 +1922,9 @@
+ *) at_desc_line="$1: " ;;
+ esac
+ as_fn_append at_desc_line "$3$4"
+- $at_quiet printf %s "$at_desc_line"
++ if ! $at_am_fmt; then
++ $at_quiet printf %s "$at_desc_line"
++ fi
+ echo "# -*- compilation -*-" >> "$at_group_log"
+ }
+
+@@ -1944,42 +1951,51 @@
+ case $at_xfail:$at_status in
+ yes:0)
+ at_msg="UNEXPECTED PASS"
++ at_am_msg="XPASS"
+ at_res=xpass
+ at_errexit=$at_errexit_p
+ at_color=$at_red
+ ;;
+ no:0)
+ at_msg="ok"
++ at_am_msg="PASS"
+ at_res=pass
+ at_errexit=false
+ at_color=$at_grn
+ ;;
+ *:77)
+ at_msg='skipped ('`cat "$at_check_line_file"`')'
++ at_am_msg="SKIP"
+ at_res=skip
+ at_errexit=false
+ at_color=$at_blu
+ ;;
+ no:* | *:99)
+ at_msg='FAILED ('`cat "$at_check_line_file"`')'
++ at_am_msg="FAIL"
+ at_res=fail
+ at_errexit=$at_errexit_p
+ at_color=$at_red
+ ;;
+ yes:*)
+ at_msg='expected failure ('`cat "$at_check_line_file"`')'
++ at_am_msg="XFAIL"
+ at_res=xfail
+ at_errexit=false
+ at_color=$at_lgn
+ ;;
+ esac
+ echo "$at_res" > "$at_job_dir/$at_res"
+- # In parallel mode, output the summary line only afterwards.
+- if test $at_jobs -ne 1 && test -n "$at_verbose"; then
+- printf "%s\n" "$at_desc_line $at_color$at_msg$at_std"
++ if $at_am_fmt; then
++ printf "%s\n" "$at_am_msg: $at_desc"
+ else
+- # Make sure there is a separator even with long titles.
+- printf "%s\n" " $at_color$at_msg$at_std"
++ # In parallel mode, output the summary line only afterwards.
++ if test $at_jobs -ne 1 && test -n "$at_verbose"; then
++ printf "%s\n" "$at_desc_line $at_color$at_msg$at_std"
++ else
++ # Make sure there is a separator even with long titles.
++ printf "%s\n" " $at_color$at_msg$at_std"
++ fi
+ fi
+ at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
+ case $at_status in
new file mode 100644
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Define tar test work dir
+WORKDIR=/usr/lib/tar/ptest/tests/
+
+# Run test
+cd ${WORKDIR}
+./atconfig ./atlocal ./testsuite
+
+# clear log
+rm -rf testsuite.dir
+rm -rf testsuite.log
+
+./testsuite --am-fmt AUTOTEST_PATH=${PWD} abs_builddir=${PWD} COMPAT=1
@@ -42,6 +42,34 @@ do_install:append:class-target() {
fi
}
+# add for ptest support
+SRC_URI += " \
+ file://run-ptest \
+ file://ptest.patch \
+"
+
+inherit ptest
+
+do_compile_ptest() {
+ oe_runmake -C ${B}/gnu/ check
+ oe_runmake -C ${B}/lib/ check
+ oe_runmake -C ${B}/rmt/ check
+ oe_runmake -C ${B}/src/ check
+ oe_runmake -C ${B}/tests/ genfile checkseekhole ckmtime
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests/
+ sed -i "/abs_/d" ${B}/tests/atconfig
+ install --mode=755 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/
+ sed -i "s%${B}/../tar-1.34.build-aux:%%g" ${B}/tests/atlocal
+ install --mode=755 ${B}/tests/atlocal ${D}${PTEST_PATH}/tests/
+ install --mode=755 ${B}/tests/genfile ${D}${PTEST_PATH}/tests/
+ install --mode=755 ${B}/tests/checkseekhole ${D}${PTEST_PATH}/tests/
+ install --mode=755 ${B}/tests/ckmtime ${D}${PTEST_PATH}/tests/
+ install --mode=755 ${S}/tests/testsuite ${D}${PTEST_PATH}/tests/
+}
+
PACKAGES =+ "${PN}-rmt"
FILES:${PN}-rmt = "${sbindir}/rmt*"