Skip to contentSkip to conversation

e2fsprogs: fix ptest bug for second running

PATCH New Khem Raj 1 participant 2 messages May 5, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 e2fsprogs: fix ptest bug for second running

From: Qiu Tingting <[email protected]>

At second running, there are four new failed case:
d_loaddump f_bigalloc_badinode f_bigalloc_orphan_list f_dup_resize

The test_data.tmp is necessary, but it is deleted by run-ptest. So it should be restored after testing.

---
 meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest | 1 +
 meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb | 3 +++
 2 files changed, 4 insertions(+)
meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest +1 -0
index 1f873b055e..020bb69b16 100644
@@ -8,3 +8,4 @@ rm -f *.tmp
 rm -f *.ok
 rm -f *.failed
 rm -f *.log
+cp ../data/test_data.tmp ./
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb +3 -0
index f29c55e346..d3786d6f4c 100644
@@ -141,4 +141,7 @@ do_install_ptest() {
 
         install -d ${D}${PTEST_PATH}/lib
         install -m 0644 ${B}/lib/config.h  ${D}${PTEST_PATH}/lib/
+
+        install -d ${D}${PTEST_PATH}/data
+        install -m 0644 ${B}/tests/test_data.tmp ${D}${PTEST_PATH}/data/
 }
Signature · 1 line
2.40.1
author
#1 lore raw

PATCH 2/2 Fix error SRCDIR when using usrmerge DISTRO_FEATURES

From: Qiu Tingting <[email protected]>

When build e2fsprogs ptest with usrmerge DISTRO_FEATURES, in test_script and test_one scripts, value of SRCDIR has problem.
SRCDIR=/usr/usr/lib/e2fsprogs/ptest/test

ptest log

  # ptest-runner e2fsprogs
  START: ptest-runner
  2022-12-17T11:08
  BEGIN: /usr/lib/e2fsprogs/ptest
  ls: cannot access '/usr/usr/lib/e2fsprogs/ptest/test/[a-zA-Z]_*': No such file or directory
  ./test_script: line 54: /usr/usr/lib/e2fsprogs/ptest/test/test_post: No such file or directory
  DURATION: 0
  END: /usr/lib/e2fsprogs/ptest
  2022-12-17T11:08
  STOP: ptest-runner
  TOTAL: 1 FAIL: 0

Reason
In Makefile.in, SRCDIR is set by prefix and libdir.

    @echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_one
    @echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_script

prefix=/usr
libdir=/usr/lib (when usrmerge is set)

solution
After ptest compiling, check and modify SRCDIR in test_script and test_one.

---
 meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.47.0.bb +3 -0
index d3786d6f4c..037fdbb395 100644
@@ -123,6 +123,9 @@ RDEPENDS:${PN}-ptest += "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck
 
 do_compile_ptest() {
 	oe_runmake -C ${B}/tests
+	sed -i 's,/usr/usr,/usr,g' \
+	    ${B}/tests/test_one \
+	    ${B}/tests/test_script
 }
 
 do_install_ptest() {
Signature · 1 line
2.40.1