Subject: Re: bug#63618: [PATCH WIP] Socat tests

From: Maxim Cournoyer <[email-masked]>
Date: Mon, 14 Apr 2025 13:35:38 +0900

Hi Bruno,

Bruno Victal <[email-masked]> writes:

> * gnu/packages/networking.scm (socat)[arguments]: Enable tests.
> [native-inputs]: Add test dependencies: net-tools, which and procps.
> ---
>  gnu/packages/networking.scm | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
> index 85fb352ebf..4a2ed0e8a5 100644
> --- a/gnu/packages/networking.scm
> +++ b/gnu/packages/networking.scm
> @@ -1204,9 +1204,25 @@ (define-public socat
>                      version ".tar.bz2"))
>                (sha256
>                 (base32
> -                "01w0hpqf5xmgn40s1ablfd4y67dlrx5y9zlx24spc1qm8h81hwyl"))))
> +                "01w0hpqf5xmgn40s1ablfd4y67dlrx5y9zlx24spc1qm8h81hwyl"))
> +              (modules '((guix build utils)))
> +              (snippet
> +               #~(begin
> +                   (substitute* "test.sh"
> +                     (("/sbin/ifconfig") "ifconfig")
> +                     (("^/bin/rm") "rm"))))))
>      (build-system gnu-build-system)
> -    (arguments '(#:tests? #f))          ; no test suite
> +    (arguments
> +     (list
> +      #:test-target "test"
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (add-after 'patch-source-shebangs 'patch-test-shebangs
> +            (lambda* (#:key inputs #:allow-other-keys)
> +              ;; test.sh embeds some shell scripts.
> +              (substitute*  "test.sh"
> +                (("/usr/bin/env") (search-input-file inputs "/bin/env"))))))))
> +    (native-inputs (list net-tools which procps))  ; for tests
>      (inputs (list openssl))
>      (home-page "http://www.dest-unreach.org/socat/")
>      (synopsis

I came up with something similar in #77765, you may want to take a look.
Closing this one.

-- 
Thanks,
Maxim