aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019, 2023 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (test-store-deduplication)
  #:use-module (guix tests)
  #:use-module (guix store)
  #:use-module (guix store roots)
  #:use-module ((guix utils) #:select (call-with-temporary-directory))
  #:use-module ((guix build utils) #:select (delete-file-recursively))
  #:use-module ((guix config) #:select (%state-directory))
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-64))

(define %store #f)

(test-begin "store-roots")

;; The 'open-connection' call below gets guix-daemon to create
;; %STATE-DIRECTORY/profiles.
(set! %store (open-connection))

(test-assert "gc-roots, regular root"
  (let* ((item (add-text-to-store %store "something"
                                  (random-text)))
         (root (string-append %gc-roots-directory "/test-gc-root")))
    (symlink item root)
    (let ((result (member root (gc-roots))))
      (delete-file root)
      result)))

(test-assert "gc-roots, indirect root"
  (call-with-temporary-directory
   (lambda (directory)
     (let* ((item (add-text-to-store %store "something"
                                     (random-text)))
            (root (string-append directory "/gc-root")))
       (symlink item root)
       (add-indirect-root %store root)
       (let ((result (member root (gc-roots))))
         (delete-file root)
         result)))))

(test-end "store-roots")
t-serde-json-1, rust-subplot-build-0.7. Replace rust-clap-2 with 4, rust-itertools-0.9 with 0.10, rust-rpassword-5 with 6, rust-sequoia-autocrypt-0.23 with 0.25, rust-sequoia-net-0.23 with 0.27, rust-tokio-0.2 with 1. [cargo-development-inputs]: Add rust-assert-cmd-2, rust-fehler-1, rust-predicates-2, rust-subplotlib-0.7. Remove rust-assert-cli-0.6. [inputs]: Add sqlite. Efraim Flashner 2023-08-14gnu: Remove libsequoia....* gnu/packages/sequoia.scm (libsequoia): Remove variable. Efraim Flashner 2023-08-14gnu: rust-sequoia-openpgp-1: Update to 1.16.0....* gnu/packages/sequoia.scm (rust-sequoia-openpgp-1): Update to 1.16.0. [source]: Remove snippet. [arguments]: Don't skip build. Add a feature-flag to use sequoia-openpgp/crypto-nettle. Add cargo-test-flags. [cargo-inputs]: Add rust-aes-0.8, rust-block-padding-0.3, rust-blowfish-0.9, rust-botan-0.10, rust-cast5-0.11, rust-cfb-mode-0.8, rust-cipher-0.4, rust-des-0.8, rust-digest-0.10, rust-eax-0.5, rust-ecb-0.1, rust-ecdsa-0.16, rust-ed25519-1, rust-ed25519-dalek-1, rust-generic-array-0.14, rust-getrandom-0.2, rust-idea-0.5, rust-md-5-0.10, rust-num-bigint-dig-0.8, rust-once-cell-1, rust-openssl-0.10, rust-openssl-sys-0.9, rust-p256-0.13, rust-rand-0.7, rust-rand-0.8, rust-rand-core-0.6, rust-ripemd-0.1, rust-rsa-0.9, rust-sha-1-0.10, rust-twofish-0.7, rust-typenum-1, rust-win-crypto-ng-0.5, rust-winapi-0.3, rust-x25519-dalek-ng-1. Replace rust-base64-0.13 with 0.21, rust-idna-0.2 with 0.3, Remove rust-backtrace-0.3, rust-itertools-0.10, rust-plotters-0.3, rust-unicode-normalization-0.1. [cargo-development-inputs]: Replace rust-criterion-0.3 with 0.4, rust-quickcheck-0.9 with 1, rust-rand-0.7 with 0.8, rust-rpassword-5 with 6. Efraim Flashner 2023-08-14gnu: Add rust-sequoia-autocrypt-0.25....* gnu/packages/crates-io.scm (rust-sequoia-autocrypt-0.25): Replace rust-sequoia-autocrypt-0.23. [arguments]: Don't skip build. Add a feature-flag for sequoia-openpgp/crypto-nettle. Remove phase adjusting crypto features. [cargo-development-inputs]: Add rust-sequoia-openpgp-1. [inputs]: Add gmp, nettle. [native-inputs]: Add clang, pkg-config. Efraim Flashner 2023-08-14gnu: Add rust-sequoia-net-0.27....* gnu/packages/crates-io.scm (rust-sequoia-net-0.27): Replace rust-sequoia-net-0.23. [arguments]: Don't skip build. Add feature flags for sequoia-openpgp/crypto-nettle. Remove phase adjusting crypto features. [cargo-inputs]: Add rust-base64-0.13, rust-tokio-1, rust-trust-dns-client-0.22, rust-trust-dns-resolver-0.22. Replace rust-hyper-0.13 with 0.14, rust-hyper-tls-0.4 with 0.5. [cargo-development-inputs]: Add rust-hyper-0.14, rust-rand-0.8, rust-sequoia-openpgp-1. [inputs]: Add gmp, nettle, openssl. [native-inputs]: Add clang, pkg-config. Efraim Flashner 2023-08-14gnu: Add rust-sequoia-cert-store-0.3....* gnu/packages/crates-io.scm (rust-sequoia-cert-store-0.3): New variable. Efraim Flashner 2023-08-14gnu: Add rust-sequoia-policy-config-0.6....* gnu/packages/crates-io.scm (rust-sequoia-policy-config-0.6): New variable. Efraim Flashner 2023-08-14gnu: Add rust-sequoia-wot-0.8....* gnu/packages/crates-io.scm (rust-sequoia-wot-0.8): New variable. Efraim Flashner 2023-08-14gnu: Add rust-sequoia-ipc-0.30....* gnu/packages/sequoia.scm (rust-sequoia-ipc-0.30): Replace rust-sequoia-ipc-0.26. [arguments]: Don't skip build. Add features flag for sequoia-openpgp/crypto-nettle. Remove phase adjusting crypto features. [cargo-inputs]: Add rust-crossbeam-utils-0.8. Replace rust-capnp-rpc-0.13 with 0.14, rust-dirs-2 with 4, rust-rand-0.7 with 0.8, rust-socket2-0.3 with 0.4, rust-tokio-0.2 with 1, rust-tokio-util-0.3 with 0.7. [cargo-development-inputs]: Add rust-sequoia-openpgp-1, rust-tokio-1. Replace rust-clap-2 with 3, rust-quickcheck-0.9 with 1. [inputs]: Add nettle. [native-inputs]: Add clang, pkg-config. Efraim Flashner