;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 David Thompson ;;; Copyright © 2016, 2017, 2019, 2023 Ludovic Courtès ;;; ;;; 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 . (define-module (test-containers) #:use-module (guix utils) #:use-module (guix build syscalls) #:use-module (gnu build linux-container) #:use-module ((gnu system linux-container)
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Le Vaillant <glv@posteo.net>2024-05-30 11:29:35 +0200
committerGuillaume Le Vaillant <glv@posteo.net>2024-05-30 11:29:35 +0200
commit5b2ee0f3d2575e7c3983c241bcd96e696e1f25f3 (patch)
tree536c4b7666aed286dc3cf58868874eea6e0c2f8e /gnu/installer/parted.scm
parent970d2c4a11fb4d844b14b2942e886906167fea4e (diff)
downloadguix-5b2ee0f3d2575e7c3983c241bcd96e696e1f25f3.tar.gz
guix-5b2ee0f3d2575e7c3983c241bcd96e696e1f25f3.zip
gnu: electron-cash: Update to 4.4.1.
* gnu/packages/finance.scm (electron-cash): Update to 4.4.1. Change-Id: I79e4bd3b039074440d897a72ca145c2b2adf0c48
Diffstat (limited to 'gnu/installer/parted.scm')
0 files changed, 0 insertions, 0 deletions
amespaces (namespaces (getpid))))))))) (close end-in) ;; Stop the container. (write 'done end-out) (close end-out) (waitpid pid) (zero? result))))))) (skip-if-unsupported) (test-equal "container-excursion, same namespaces" 42 ;; The parent and child are in the same namespaces. 'container-excursion' ;; should notice that and avoid calling 'setns' since that would fail. (status:exit-val (container-excursion (getpid) (lambda () (primitive-exit 42))))) (skip-if-unsupported) (test-assert "container-excursion*" (call-with-temporary-directory (lambda (root) (define (namespaces pid) (let ((pid (number->string pid))) (map (lambda (ns) (readlink (string-append "/proc/" pid "/ns/" ns))) '("user" "ipc" "uts" "net" "pid" "mnt")))) (let* ((pid (run-container root '() %namespaces 1 (lambda () (sleep 100)))) (expected (namespaces pid)) (result (container-excursion* pid (lambda () (namespaces 1))))) (kill pid SIGKILL) (equal? result expected))))) (skip-if-unsupported) (test-equal "container-excursion*, same namespaces" 42 (container-excursion* (getpid) (lambda () (* 6 7)))) (skip-if-unsupported) (test-equal "container-excursion*, /proc" '("1" "2") (call-with-temporary-directory (lambda (root) (let* ((pid (run-container root '() %namespaces 1 (lambda () (sleep 100)))) (result (container-excursion* pid (lambda () ;; We expect to see exactly two processes in this ;; namespace. (scandir "/proc" (lambda (file) (char-set-contains? char-set:digit (string-ref file 0)))))))) (kill pid SIGKILL) result)))) (skip-if-unsupported) (test-equal "eval/container, exit status" 42 (let* ((store (open-connection-for-tests)) (status (run-with-store store (eval/container #~(exit 42))))) (close-connection store) (status:exit-val status))) (skip-if-unsupported) (test-assert "eval/container, writable user mapping" (call-with-temporary-directory (lambda (directory) (define store (open-connection-for-tests)) (define result (string-append directory "/r")) (define requisites* (store-lift requisites)) (call-with-output-file result (const #t)) (run-with-store store (mlet %store-monad ((status (eval/container #~(begin (use-modules (ice-9 ftw)) (call-with-output-file "/result" (lambda (port) (write (scandir #$(%store-prefix)) port)))) #:mappings (list (file-system-mapping (source result) (target "/result") (writable? #t))))) (reqs (requisites* (list (derivation->output-path (%guile-for-build)))))) (close-connection store) (return (and (zero? (pk 'status status)) (lset= string=? (cons* "." ".." (map basename reqs)) (pk (call-with-input-file result read)))))))))) (skip-if-unsupported) (test-assert "eval/container, non-empty load path" (call-with-temporary-directory (lambda (directory) (define store (open-connection-for-tests)) (define result (string-append directory "/r")) (define requisites* (store-lift requisites)) (mkdir result) (run-with-store store (mlet %store-monad ((status (eval/container (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils)) (mkdir-p "/result/a/b/c"))) #:mappings (list (file-system-mapping (source result) (target "/result") (writable? #t)))))) (close-connection store) (return (and (zero? status) (file-is-directory? (string-append result "/a/b/c"))))))))) (test-end)