aboutsummaryrefslogtreecommitdiff
;;; 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)))))
5:13 +0200'>2020-04-06services/web: Add default values to all mumi-configuration fields....Ricardo Wurmus 2020-04-06gnu: mumi: Update to 0.0.0-12.bb2fe92....Ricardo Wurmus 2020-03-16services/web: Export nginx-configuration-global-directives....Ricardo Wurmus 2020-03-16services: nginx: Fix broken default configuration....Tobias Geerinckx-Rice 2020-03-15services/web: nginx-configuration: Add support for global directives....Ricardo Wurmus 2020-03-15services/web: Remove empty events directive from default-nginx-config....Ricardo Wurmus 2020-03-12services: mumi-service-type: Update to latest version of mumi....Ricardo Wurmus 2020-02-09services: web: Use the Patchwork default-from-email....Christopher Baines 2019-12-21services: Add Mumi service....Ludovic Courtès 2019-11-28services: nginx: Add description....Ludovic Courtès 2019-11-09services: hpcguix-web: Delete lock files during activation....Ludovic Courtès 2019-11-09services: hpcguix-web: Explicitly import (guix build utils)....Ludovic Courtès 2019-11-07services: Make it possible to include dynamic modules in nginx....Florian Pelz 2019-11-05services: patchwork: Fix typo....Efraim Flashner 2019-10-04services: httpd: Fix virtual-host doc and config....Jan Nieuwenhuizen 2019-09-04services: nginx: Pass run-directory on config test....Robert Vollmert 2019-05-31services: Add patchwork....Christopher Baines 2019-04-28gnu: Remove unused module reference....Ricardo Wurmus 2019-03-18Correct name and email address for ng0....ng0 2018-12-17services: php-fpm: Add 'timezone' configuration....Oleg Pykhalov 2018-10-27services: httpd: Allow using it with PHP....Florian Pelz 2018-09-26services: Add Varnish service....Marius Bakke 2018-09-10services: hpcguix-web: Produce a log file and rotate it....Ludovic Courtès 2018-09-10services: tailon: Move to (gnu services web)....Ludovic Courtès 2018-09-08services: nginx: 'stop' returns #f....Ludovic Courtès 2018-09-08services: nginx: Don't read PID file when passed a custom config file....Ludovic Courtès 2018-09-06services: hpcguix-web: Set SSL_CERT_DIR....Ludovic Courtès 2018-08-31services: nginx: Get the Shepherd to respawn NGINX....Clément Lassieur 2018-08-13services: nginx: Use 'invoke' rather than 'system*'....Clément Lassieur 2018-06-12services: nginx: Support extra content in the http block....Christopher Baines 2018-06-01services: Add hpcguix-web....Rouby Pierre-Antoine 2018-03-20Correct name and Email for ng0....ng0 2018-02-14gnu: Add cat-avatar-generator-service....Julien Lepiller 2018-01-17gnu: services: web: Add service for httpd....Christopher Baines 2017-12-18services: nginx: Allow to add raw content to the server blocks....Clément Lassieur 2017-12-18services: nginx: Replace 'http-port' and 'https-port' with 'listen'....Clément Lassieur 2017-12-12gnu: services: Add php-fpm....nee 2017-12-11services: web: Switch nginx related functions to use match-record....Christopher Baines 2017-12-11services: web: Add support for configuring the nginx server names hash....Christopher Baines 2017-12-11services: web: Remove default certificate and key files for nginx....Christopher Baines 2017-12-11web: Don't error about missing ssl related files....Christopher Baines