Skip to contentSkip to conversation

libsolv: add ptest support

PATCH In review Pratik Farkase 2 participants 3 messages Feb 11 – Feb 13

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsolv: add ptest support

Add ptest support to enable automated testing of libsolv using ptest-runner.

The implementation uses upstream's test infrastructure:
testsolv binary, runtestcases.sh script, and testcase data. The test suite runs 28 test categories covering solver functionality, package dependencies, and repository handling.

All 28 upstream tests pass successfully on qemux86-64:
START: ptest-runner
BEGIN: /usr/lib/libsolv/ptest
conflict.t ....................................... Passed
forcebest.t ...................................... Passed
PASS: testcases/allowuninstall

job.t ............................................   Passed
learnt.t .........................................   Passed
recommends.t .....................................   Passed
requires.t .......................................   Passed
strongrecommends.t ...............................   Passed
update.t .........................................   Passed
yumobs.t .........................................   Passed

PASS: testcases/alternative
ptf.t ............................................ Passed
retracted.t ...................................... Passed
PASS: testcases/blacklist

choice1.t ........................................   Passed
choice1b.t .......................................   Passed
choice2.t ........................................   Passed
choice2b.t .......................................   Passed
choice3.t ........................................   Passed
choice3b.t .......................................   Passed
choice4.t ........................................   Passed
choice5.t ........................................   Passed
choice6.t ........................................   Passed
choice7.t ........................................   Passed
PASS: testcases/choicerules
default.t ........................................   Passed
enhanced.t .......................................   Passed
oldversion.t .....................................   Passed
suggested.t ......................................   Passed
versioned.t ......................................   Passed
versioned2.t .....................................   Passed
PASS: testcases/choose
cleandeps_dup.t ..................................   Passed
cleandeps_in.t ...................................   Passed
cleandeps_up.t ...................................   Passed
cleandeps_up3.t ..................................   Passed
mistake.t ........................................   Passed
PASS: testcases/cleandeps
and.t ............................................   Passed
andor.t ..........................................   Passed
if.t .............................................   Passed
ifelse.t .........................................   Passed
ifelse_rec.t .....................................   Passed
or.t .............................................   Passed
orand.t ..........................................   Passed
PASS: testcases/cplxdeps
dup_allowuninstall.t .............................   Passed
dup_multiversion1.t ..............................   Passed
dup_multiversion2.t ..............................   Passed
dup_multiversion3.t ..............................   Passed
dup_noarchchange.t ...............................   Passed
dup_orphan1.t ....................................   Passed
dup_orphan2.t ....................................   Passed
dup_orphan3.t ....................................   Passed

PASS: testcases/distupgrade
caret.t .......................................... Passed
testevr.t ........................................ Passed
PASS: testcases/evrcmp
excludefromweak-obsoletes.t ...................... Passed
excludefromweak.t ................................ Passed
PASS: testcases/excludefromweak

recommends.t .....................................   Passed
recommends2.t ....................................   Passed
requires.t .......................................   Passed
single.t .........................................   Passed
supplements.t ....................................   Passed
PASS: testcases/favor
best.t ...........................................   Passed
installed.t ......................................   Passed
new1.t ...........................................   Passed
new2.t ...........................................   Passed
normal.t .........................................   Passed
PASS: testcases/focus
forcebest_dup.t ..................................   Passed
forcebest_in.t ...................................   Passed
forcebest_up.t ...................................   Passed

PASS: testcases/forcebest
best.t ........................................... Passed
dup.t ............................................ Passed
PASS: testcases/lock

infarch_install_best.t ...........................   Passed
lockstep_install.t ...............................   Passed
lockstep_update.t ................................   Passed
PASS: testcases/lockstep
multiversion.t ...................................   Passed
update.t .........................................   Passed
update2.t ........................................   Passed

PASS: testcases/multiversion
namespaceprovides.t .............................. Passed
PASS: testcases/namespace
pubg1.t .......................................... Passed
pubg2.t .......................................... Passed
PASS: testcases/proof

recommended_conflicts.t ..........................   Passed
recommended_multirepo.t ..........................   Passed
recommended_oldversion.t .........................   Passed
recommended_targeted.t ...........................   Passed
recommended_version.t ............................   Passed
suggested_conflicts.t ............................   Passed
suggested_multirepo.t ............................   Passed
suggested_oldversion.t ...........................   Passed
suggested_targeted.t .............................   Passed
suggested_version.t ..............................   Passed
PASS: testcases/recommendations
assert.t .........................................   Passed
mm-test.t ........................................   Passed
reuse.t ..........................................   Passed
PASS: testcases/sat
disable: unknown package 'E-1-1.src@available'
disable: unknown package 'F-1-1.src@available'
selection_canon_rpm.t ............................   Passed
selection_filelist.t .............................   Passed
selection_matchdeps.t ............................   Passed
selection_matchsolvable.t ........................   Passed
selection_name.t .................................   Passed
selection_provides.t .............................   Passed
PASS: testcases/selection
strictrepoprio.t .................................   Passed
PASS: testcases/strictrepoprio
break.t ..........................................   Passed
disfavored.t .....................................   Passed
strongr.t ........................................   Passed
PASS: testcases/strongrecommends
targeted_color.t .................................   Passed
targeted_dup.t ...................................   Passed
targeted_up.t ....................................   Passed

PASS: testcases/targeted
nested.t ......................................... Passed
str2dep.t ........................................ Passed
PASS: testcases/testcase
supplements_implicitobsoleteusescolors.t ......... Passed
PASS: testcases/weakdeps

dup.t ............................................   Passed
dup2.t ...........................................   Passed
forcebest_in.t ...................................   Passed
forcebest_up.t ...................................   Passed

PASS: testcases/whatprovideswithdisabled
split.t .......................................... Passed
split2.t ......................................... Passed
PASS: testcases/yumobs
DURATION: 7
END: /usr/lib/libsolv/ptest
STOP: ptest-runner

Note: runtestcases.sh requires bash as it uses bash-specific features.

---
 .../conf/distro/include/ptest-packagelists.inc |  1 +
 .../recipes-extended/libsolv/libsolv/run-ptest | 12 ++++++++++++
 .../recipes-extended/libsolv/libsolv_0.7.35.bb | 18 +++++++++++++++++-
 3 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100755 meta/recipes-extended/libsolv/libsolv/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index b9616e9bf4..fbbd118255 100644
@@ -36,6 +36,7 @@ PTESTS_FAST = "\
     libnl \
     libpcre \
     librsvg \
+    libsolv \
     libssh2 \
     libtest-fatal-perl \
     libtest-needs-perl \
meta/recipes-extended/libsolv/libsolv/run-ptest new file +12 -0
new file mode 100755
index 0000000000..857b719ae5
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+cd test
+
+for t in testcases/*; do
+    ./runtestcases.sh ../tools/testsolv $t
+    if [ $? -eq 0 ]; then
+        echo "PASS: $t"
+    else
+        echo "FAIL: $t"
+    fi
+done
meta/recipes-extended/libsolv/libsolv_0.7.35.bb +17 -1
index ec74308bb5..d42623b413 100644
@@ -10,13 +10,14 @@ DEPENDS = "expat zlib zstd"
 
 SRC_URI = "git://github.com/openSUSE/libsolv.git;branch=master;protocol=https;tag=${PV} \
            file://0001-utils-Conside-musl-when-wrapping-qsort_r.patch \
+           file://run-ptest \
 "
 
 SRCREV = "fb4b4340d46108cb365113e432642d6024886c7a"
 
 UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
 
-inherit cmake
+inherit cmake ptest
 
 PACKAGECONFIG ??= "${@bb.utils.contains('PACKAGE_CLASSES','package_rpm','rpm','',d)}"
 PACKAGECONFIG[rpm] = "-DENABLE_RPMMD=ON -DENABLE_RPMDB=ON,,rpm"
@@ -29,3 +30,18 @@ FILES:${PN}-tools = "${bindir}/*"
 FILES:${PN}ext = "${libdir}/${PN}ext.so.*"
 
 BBCLASSEXTEND = "native nativesdk"
+
+do_compile_ptest() {
+    cmake_runcmake_build --target testsolv
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tools
+    install -d ${D}${PTEST_PATH}/test
+
+    install -m 0755 ${B}/tools/testsolv ${D}${PTEST_PATH}/tools/
+    install -m 0755 ${S}/test/runtestcases.sh ${D}${PTEST_PATH}/test/
+    cp -r ${S}/test/testcases ${D}${PTEST_PATH}/test/
+}
+
+RDEPENDS:${PN}-ptest += "bash"
Signature · 1 line
2.43.0
#1 lore raw
Quoted 8 lines · Pratik Farkase

Add ptest support to enable automated testing of libsolv using ptest-runner.

The implementation uses upstream's test infrastructure:
testsolv binary, runtestcases.sh script, and testcase data. The test suite runs 28 test categories covering solver functionality, package dependencies, and repository handling.

Sorry, maybe my previous message was not clear enough: a previous version of this patch has been merged:
https://git.openembedded.org/openembedded-core/commit/?id=f5432d1c45f9eb47182049c6930cfc6d5b26bc8d

So you have to rebase on top of it or on top of master before sending your patch.

I can see this patch here is adding meta/recipes-extended/libsolv/libsolv/run-ptest, which was already added by the merged patch, so something seems to be wrong here.

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

Hi Mathieu,

Sent a correction patch on top of master here : https://lists.openembedded.org/g/openembedded-core/message/230995

Best Regards,
Pratik

________________________________________
From: Mathieu Dubois-Briand <[email protected]>
Sent: Wednesday, February 11, 2026 4:27 PM
To: Pratik Farkase; [email protected]
Cc: [email protected]
Subject: Re: [OE-core][PATCH v1] libsolv: add ptest support

Quoted 8 lines · Pratik Farkase

Add ptest support to enable automated testing of libsolv using ptest-runner.

The implementation uses upstream's test infrastructure:
testsolv binary, runtestcases.sh script, and testcase data. The test suite runs 28 test categories covering solver functionality, package dependencies, and repository handling.

Sorry, maybe my previous message was not clear enough: a previous version of this patch has been merged:
https://git.openembedded.org/openembedded-core/commit/?id=f5432d1c45f9eb47182049c6930cfc6d5b26bc8d

So you have to rebase on top of it or on top of master before sending your patch.

I can see this patch here is adding meta/recipes-extended/libsolv/libsolv/run-ptest, which was already added by the merged patch, so something seems to be wrong here.

Thanks,
Mathieu

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com