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)))))
Signed-off-by: Zheng Junjie <zhengjunjie@iscas.ac.cn> Artyom V. Poptsov 2024-08-29gnu: ascii2binary: Fix cross-compilation....* gnu/packages/textutils.scm (ascii2binary): Fix cross-compilation. [native-inputs]: Add autoconf, automake. [arguments]: Add fix-rpl_malloc phase. Change-Id: Iefaca353490a17f9263431f60db33218a22e914c Zheng Junjie 2024-08-14gnu: Add goawk....* gnu/packages/gawk.scm (goawk): New variable. Co-authored-by: Ashish SHUKLA <ashish.is@lostca.se> Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com> Change-Id: I4011e97962b23bab10c516c7d4d2b25f92330f9d Paul A. Patience 2024-07-22gnu: vale: Update to 3.4.2....* gnu/packages/textutils.scm (vale): Update to 3.4.2. [source]: Change snippets removing vendored modules as they are not provided any more, to one adjusting module import path. [arguments]: <#:phases>: Add 'disable-failing-tests, 'copy-input-to-vendor-directory and 'remove-vendor-directory phases. Use custom 'check phase. [native-inputs]: Remove go-github-com-fatih-color, go-github-com-mitchellh-go-homedir, go-github-com-spf13-afero, go-github-com-urfave-cli, and go-gopkg-in-ini-v1; add go-github-com-masterminds-sprig-v3, go-github-com-adrg-strutil, go-github-com-adrg-xdg, go-github-com-bmatcuk-doublestar-v4, go-github-com-d5-tengo-v2, go-github-com-errata-ai-ini, go-github-com-errata-ai-regexp2, go-github-com-expr-lang-expr, go-github-com-jdkato-twine, go-github-com-karrick-godirwalk, go-github-com-mholt-archiver-v3, go-github-com-niklasfasching-go-org, go-github-com-otiai10-copy, go-github-com-pterm-pterm, go-github-com-remeh-sizedwaitgroup, go-github-com-spf13-pflag, go-golang-org-x-exp, and go-golang-org-x-sys. Change-Id: Ie378b419e34a924a5f1c8b383b029706d9846216 Sharlatan Hellseher 2024-07-15gnu: Remove go-github-com-errata-ai-vale....* gnu/packages/textutils.scm (go-github-com-errata-ai-vale): Delete variable. Change-Id: I457b50a280481792804e1a45703ac55b482e5029 Sharlatan Hellseher 2024-07-15gnu: Remove go-github-com-aswinkarthik-csvdiff....* gnu/packages/textutils.scm (go-github-com-aswinkarthik-csvdiff): Delete variable. Change-Id: I582399e8decbe82445b82d3e69dceeb743829ee4 Sharlatan Hellseher 2024-07-15gnu: packages/golang: Set default go version to 1.21....Golang versions 1.17 (02 Aug 2022), 1.18 (01 Feb 2023), 1.19 (06 Sep 2023) and 1.20 (06 Feb 2024) are EOL <https://endoflife.date/go>. These changes set preferable default version to the minimal currently maintained one e.g. 1.21 * gnu/packages/golang.scm (go): Set default to go-1.21, add annotation for the future maintenance. Remove field <#:go> setting Golang version to go-1.18, go-1.19, 1.20 and 1.21: * gnu/packages/admin.scm * gnu/packages/configuration-management.scm * gnu/packages/databases.scm * gnu/packages/disk.scm * gnu/packages/education.scm * gnu/packages/file-systems.scm * gnu/packages/finance.scm * gnu/packages/golang-check.scm * gnu/packages/golang-crypto.scm * gnu/packages/golang-web.scm * gnu/packages/golang-xyz.scm * gnu/packages/golang.scm * gnu/packages/high-availability.scm * gnu/packages/ipfs.scm * gnu/packages/irc.scm * gnu/packages/messaging.scm * gnu/packages/networking.scm * gnu/packages/syncthing.scm * gnu/packages/textutils.scm * gnu/packages/time.scm * gnu/packages/version-control.scm * gnu/packages/video.scm Change-Id: Ieba6a5d7a18423f838d14c02ad55a2ba9c8559eb Sharlatan Hellseher 2024-06-29gnu: Remove go-golang-org-x-net-html....golang.org/x/net is distributed as a single module according to provided go.mod file. This changes remove the last reference to golang.org/x/net/html. * gnu/packages/golang-build.scm (go-golang-org-x-net) [propagated-inputs]: Add go-golang-org-x-sys, go-golang-org-x-term and go-golang-org-x-text. (go-golang-org-x-net-html): Remove variable. * gnu/packages/version-control.scm (ghq) [inputs]: Remove go-golang-org-x-net-html. Add go-golang-org-x-net. * gnu/packages/textutils.scm (vale) [inputs]: Remove go-golang-org-x-net-html. Add go-golang-org-x-net. Change-Id: Ic275f2f7ccd145edfd376d65bd24599a550e849a Sharlatan Hellseher