~ruther/guix-local

83305987401f215100847ad16a51716b8bcc7d7c — Maxim Cournoyer 4 months ago 20e063e
tests/pack: Fix rpm tests.

The rpm-for-tests would no longer build, due to the parent package having
migrated to CMake. Use the --dbpath argument instead of a variant test
package.

* tests/pack.scm (rpm-for-tests): Delete variable.
(rpm archive can be installed/uninstalled): Invoke rpm, not rpm-for-tests, but
with the --dbpath location specified.

Change-Id: I1b578db3ef8f1309c32c6ef92615814ca49fd22c
1 files changed, 7 insertions(+), 16 deletions(-)

M tests/pack.scm
M tests/pack.scm => tests/pack.scm +7 -16
@@ 1,7 1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017-2021, 2023, 2024 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021, 2023 Maxim Cournoyer <maxim@guixotic.coop>
;;; Copyright © 2021, 2023, 2025 Maxim Cournoyer <maxim@guixotic.coop>
;;; Copyright © 2023 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2024 Noé Lopez <noelopez@free.fr>
;;;


@@ 61,17 61,6 @@

(define %ar-bootstrap %bootstrap-binutils)

;;; This is a variant of the RPM package configured so that its database can
;;; be created on a writable location readily available inside the build
;;; container ("/tmp").
(define rpm-for-tests
  (package
    (inherit rpm)
    (arguments (substitute-keyword-arguments (package-arguments rpm)
                 ((#:configure-flags flags '())
                  #~(cons "--localstatedir=/tmp"
                          (delete "--localstatedir=/var" #$flags)))))))


(test-begin "pack")



@@ 517,14 506,15 @@
                 (use-modules (guix build utils))

                 (define fakeroot #+(file-append fakeroot "/bin/fakeroot"))
                 (define rpm #+(file-append rpm-for-tests "/bin/rpm"))
                 (mkdir-p "/tmp/lib/rpm")
                 (define rpm #+(file-append rpm "/bin/rpm"))
                 (define dbpath (string-append (getcwd) "/var/lib/rpm"))
                 (mkdir-p dbpath)

                 ;; Install the RPM package.  This causes RPM to validate the
                 ;; signatures, header as well as the file digests, which
                 ;; makes it a rather thorough test.
                 (mkdir "test-prefix")
                 (invoke fakeroot rpm "--install"
                 (invoke fakeroot rpm "--dbpath" dbpath "--install"
                         (string-append "--prefix=" (getcwd) "/test-prefix")
                         #$rpm-pack)



@@ 532,7 522,8 @@
                 (invoke "./test-prefix/bin/guile" "--version")

                 ;; Uninstall the RPM package.
                 (invoke fakeroot rpm "--erase" "guile-bootstrap")
                 (invoke fakeroot rpm "--dbpath" dbpath
                         "--erase" "guile-bootstrap")

                 ;; Required so the above is run.
                 (mkdir #$output))))))