commit:     166efc12379fac3ce3b5d3d68ad8ab621bb9c71d
Author:     Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Tue Jul 15 20:17:37 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul 16 02:51:44 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=166efc12

app-crypt/johntheripper-jumbo: fix tests

Closes: https://bugs.gentoo.org/960245
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/43016
Closes: https://github.com/gentoo/gentoo/pull/43016
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../johntheripper-jumbo-1.9.0_p20250703.ebuild           | 16 +++++++++++++---
 .../johntheripper-jumbo/johntheripper-jumbo-9999.ebuild  | 16 +++++++++++++---
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git 
a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250703.ebuild 
b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250703.ebuild
index 5d93ad04dc9e..8897a6fffd87 100644
--- a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250703.ebuild
+++ b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.9.0_p20250703.ebuild
@@ -119,14 +119,24 @@ src_compile() {
 src_test() {
        pax-mark -mr run/john
 
+       # Replace system (/etc/john) includes with cwd-relative for tests
+       # bug #960245.
+       mkdir test || die
+       cp -r run/*.conf run/rules test || die
+       cd test || die
+       for file in *.conf; do
+               sed -E 's/^.include <(.+)>$/.include "\1"/g' -i "$file" || die
+       done
+
        if use opencl; then
                # GPU tests fail in portage, so run cpu only tests
-               ./run/john --config=run/john.conf --device=cpu --test=0 
--verbosity=2 || die
+               # Reasons: kernels not in /etc/john/opencl (yet) and sandbox
+               ../run/john --config=john.conf --device=cpu --test=0 
--verbosity=2 || die
        else
                # Weak tests
-               ./run/john --config=run/john.conf --test=0 --verbosity=2 || die
+               ../run/john --config=john.conf --test=0 --verbosity=2 || die
                # Strong tests
-               #./run/john --test=1 --verbosity=2 || die
+               #../run/john --config=john.conf --test=1 --verbosity=2 || die
        fi
 }
 

diff --git a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-9999.ebuild 
b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-9999.ebuild
index 5d93ad04dc9e..8897a6fffd87 100644
--- a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-9999.ebuild
+++ b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-9999.ebuild
@@ -119,14 +119,24 @@ src_compile() {
 src_test() {
        pax-mark -mr run/john
 
+       # Replace system (/etc/john) includes with cwd-relative for tests
+       # bug #960245.
+       mkdir test || die
+       cp -r run/*.conf run/rules test || die
+       cd test || die
+       for file in *.conf; do
+               sed -E 's/^.include <(.+)>$/.include "\1"/g' -i "$file" || die
+       done
+
        if use opencl; then
                # GPU tests fail in portage, so run cpu only tests
-               ./run/john --config=run/john.conf --device=cpu --test=0 
--verbosity=2 || die
+               # Reasons: kernels not in /etc/john/opencl (yet) and sandbox
+               ../run/john --config=john.conf --device=cpu --test=0 
--verbosity=2 || die
        else
                # Weak tests
-               ./run/john --config=run/john.conf --test=0 --verbosity=2 || die
+               ../run/john --config=john.conf --test=0 --verbosity=2 || die
                # Strong tests
-               #./run/john --test=1 --verbosity=2 || die
+               #../run/john --config=john.conf --test=1 --verbosity=2 || die
        fi
 }
 

Reply via email to