aboutsummaryrefslogtreecommitdiff
path: root/tests/ipfs.scm
blob: 3b662b22bd9b00b2cbd6355897c2055fab846195 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 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-ipfs)
  #:use-module (guix ipfs)
  #:use-module ((guix utils) #:select (call-with-temporary-directory))
  #:use-module (guix tests)
  #:use-module (web uri)
  #:use-module (srfi srfi-64))

;; Test the (guix ipfs) module.

(define (ipfs-gateway-running?)
  "Return true if the IPFS gateway is running at %IPFS-BASE-URL."
  (let* ((uri    (string->uri (%ipfs-base-url)))
         (socket (socket AF_INET SOCK_STREAM 0)))
    (define connected?
      (catch 'system-error
        (lambda ()
          (format (current-error-port)
                  "probing IPFS gateway at localhost:~a...~%"
                  (uri-port uri))
          (connect socket AF_INET INADDR_LOOPBACK (uri-port uri))
          #t)
        (const #f)))

    (close-port socket)
    connected?))

(unless (ipfs-gateway-running?)
  (test-skip 1))

(test-assert "add-file-tree + restore-file-tree"
  (call-with-temporary-directory
   (lambda (directory)
     (let* ((source  (dirname (search-path %load-path "guix/base32.scm")))
            (target  (string-append directory "/r"))
            (content (pk 'content (add-file-tree source))))
       (restore-file-tree (content-name content) target)
       (file=? source target)))))
sformations.scm ("options->transformation, with-latest"): Adjust fieldname accordingly. Hartmut Goebel 2022-09-29transformations: '--with-source' now operates in depth....The '--with-source' option is the first one that was implemented, and it's the only one that would operate only on leaf packages rather than traversing the dependency graph. This change makes it consistent with the rest of the transformation options. * guix/transformations.scm (evaluate-source-replacement-specs): New procedure. (transform-package-source): Rewrite using it. * tests/transformations.scm ("options->transformation, with-source, no matches"): Rewrite since we no longer get a warning. ("options->transformation, with-source, in depth"): New test. * doc/guix.texi (Package Transformation Options): Adjust examples. Ludovic Courtès Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Adjust hack for locating libsodium. Add custom check phase. [native-inputs]: Remove PYTHON-PYHAMCREST. Add PYTHON-POETRY-CORE. Marius Bakke 2023-09-22gnu: python-certauth: Fix test failure with newer PyOpenSSL....* gnu/packages/python-crypto.scm (python-certauth)[arguments]: New field. Marius Bakke 2023-08-24gnu: python-asn1crypto: Respect #:tests?....* gnu/packages/python-crypto.scm (python-asn1crypto)[#:phases]<check>: Honor argument #:tests?. Hilton Chain 2023-08-24gnu: python-asn1crypto: Update to 1.5.1....* gnu/packages/python-crypto.scm (python-asn1crypto): Update to 1.5.1. [description]: Adjust according to lint warning. Signed-off-by: Hilton Chain <hako@ultrarare.space> fanquake 2023-08-14gnu: python-cryptography-rust: Enable tests....* gnu/packages/python-crypto.scm (python-cryptography-rust) [arguments]: Don't skip the tests. Add a custom 'check phase. Efraim Flashner 2023-08-14gnu: python-cryptography: Update to 40.0.2....* gnu/packages/python-crypto.scm (python-cryptography): Update to 40.0.2. (python-cryptography-rust)[cargo-inputs]: Move rust-cc-1 here from cargo-development-inputs. [cargo-development-inputs]: Remove field. Efraim Flashner 2023-08-14gnu: python-cryptography-vectors: Update to 40.0.2....* gnu/packages/python-crypto.scm (python-cryptography-vectors): Update to 40.0.2. Efraim Flashner