aboutsummaryrefslogtreecommitdiff
path: root/build-aux
ModeNameSize
-rw-r--r--build-self.scm12721logplainabout
-rw-r--r--check-available-binaries.scm2465logplainabout
-rw-r--r--check-final-inputs-self-contained.scm3711logplainabout
-rw-r--r--compile-all.scm3965logplainabout
-rw-r--r--compile-as-derivation.scm2116logplainabout
d---------cuirass134logplain
-rw-r--r--generate-authors.scm3870logplainabout
-rwxr-xr-xgit-version-gen8027logplainabout
-rwxr-xr-xgitlog-to-changelog13396logplainabout
d---------hydra162logplain
-rw-r--r--pre-inst-env.in2845logplainabout
-rw-r--r--run-system-tests.scm3364logplainabout
-rw-r--r--test-driver.scm7869logplainabout
-rw-r--r--test-env.in5764logplainabout
-rw-r--r--update-NEWS.scm6507logplainabout
-rw-r--r--update-guix-package.scm5600logplainabout
))) (program-file "run-command-over-ssh" run)) (define (run-childhurd-test) (define (import-module? module) ;; This module is optional and depends on Guile-Gcrypt, do skip it. (and (guix-module-name? module) (not (equal? module '(guix store deduplication))))) (define os (marionette-operating-system %childhurd-os #:imported-modules (source-module-closure '((gnu services herd) (guix combinators) (gnu build install)) #:select? import-module?))) (define vm (virtual-machine (operating-system os) (memory-size (* 1024 3)))) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (gnu build marionette) (srfi srfi-64) (ice-9 match)) (define marionette ;; Emulate as much as the host CPU supports so that, possibly, KVM ;; is available inside as well ("nested KVM"), provided ;; /sys/module/kvm_intel/parameters/nested (or similar) allows it. (make-marionette (list #$vm "-cpu" "max"))) (test-runner-current (system-test-runner #$output)) (test-begin "childhurd") (test-assert "service running" (marionette-eval '(begin (use-modules (gnu services herd) (ice-9 match)) (match (start-service 'childhurd) (#f #f) (('service response-parts ...) (match (assq-ref response-parts 'running) ((pid) (number? pid)))))) marionette)) (test-equal "childhurd SSH server replies" "SSH" ;; Check from within the guest whether its childhurd's SSH ;; server is reachable. Do that from the guest: port forwarding ;; to the host won't work because QEMU listens on 127.0.0.1. (marionette-eval '(begin (use-modules (ice-9 match) (ice-9 textual-ports)) (let loop ((n 60)) (if (zero? n) 'all-attempts-failed (let ((s (socket PF_INET SOCK_STREAM 0)) (a (make-socket-address AF_INET INADDR_LOOPBACK 10022))) (format #t "connecting to childhurd SSH server...~%") (connect s a) (match (get-string-n s 3) ((? eof-object?) (close-port s) (sleep 1) (loop (- n 1))) (str (close-port s) str)))))) marionette)) (test-equal "SSH up and running" "childhurd GNU\n" ;; Connect from the guest to the chidhurd over SSH and run the ;; 'uname' command. (marionette-eval '(begin (use-modules (ice-9 popen) (ice-9 textual-ports)) (get-string-all (open-input-pipe #$(run-command-over-ssh '("uname" "-on"))))) marionette)) (test-assert "guix-daemon up and running" (let ((drv (marionette-eval '(begin (use-modules (ice-9 popen) (ice-9 textual-ports)) (get-string-all (open-input-pipe #$(run-command-over-ssh '("guix" "build" "coreutils" "--no-grafts" "-d"))))) marionette))) ;; We cannot compare the .drv with (raw-derivation-file ;; coreutils) on the host: they may differ due to fixed-output ;; derivations and changes introduced compared to the 'guix' ;; package snapshot. (and (string-suffix? ".drv" (pk 'drv (string-trim-right drv))) drv))) (test-assert "copy-on-write store" ;; Set up a writable store. The root partition is already an ;; overlayfs, which is not suitable as the bottom part of this ;; additional overlayfs; thus, create a tmpfs for the backing ;; store. ;; TODO: Remove this when <virtual-machine> creates a writable ;; store. (marionette-eval '(begin (use-modules (gnu build install) (guix build syscalls)) (mkdir "/run/writable-store") (mount "none" "/run/writable-store" "tmpfs") (mount-cow-store "/run/writable-store" "/backing-store") (system* "df" "-hT")) marionette)) (test-equal "offloading" 0 (marionette-eval '(and (file-exists? "/etc/guix/machines.scm") (system* "guix" "offload" "test")) marionette)) (test-end)))) (gexp->derivation "childhurd-test" test)) (define %test-childhurd (system-test (name "childhurd") (description "Connect to the GNU/Hurd virtual machine service, aka. a childhurd, making sure that the childhurd boots and runs its SSH server.") (value (run-childhurd-test)))) ;;; ;;; Virtual build machine. ;;; (define %build-vm-os (simple-operating-system (service virtual-build-machine-service-type (virtual-build-machine (cpu-count 1) (memory-size (* 1 1024)))))) (define (run-build-vm-test) (define (import-module? module) ;; This module is optional and depends on Guile-Gcrypt, do skip it. (and (guix-module-name? module) (not (equal? module '(guix store deduplication))))) (define os (marionette-operating-system %build-vm-os #:imported-modules (source-module-closure '((gnu services herd) (gnu build install)) #:select? import-module?))) (define vm (virtual-machine (operating-system os) (memory-size (* 1024 3)))) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (gnu build marionette) (srfi srfi-64) (ice-9 match)) (define marionette ;; Emulate as much as the host CPU supports so that, possibly, KVM ;; is available inside as well ("nested KVM"), provided ;; /sys/module/kvm_intel/parameters/nested (or similar) allows it. (make-marionette (list #$vm "-cpu" "max"))) (test-runner-current (system-test-runner #$output)) (test-begin "build-vm") (test-assert "service running" (marionette-eval '(begin (use-modules (gnu services herd) (ice-9 match)) (start-service 'build-vm)) marionette)) (test-assert "guest SSH up and running" ;; Note: Pass #:peek? #t because due to the way QEMU port ;; forwarding works, connecting to 11022 always works even if the ;; 'sshd' service hasn't been started yet in the guest. (wait-for-tcp-port 11022 marionette #:peek? #t)) (test-assert "copy-on-write store" ;; Set up a writable store. The root partition is already an ;; overlayfs, which is not suitable as the bottom part of this ;; additional overlayfs; thus, create a tmpfs for the backing ;; store. ;; TODO: Remove this when <virtual-machine> creates a writable ;; store. (marionette-eval '(begin (use-modules (gnu build install) (guix build syscalls)) (mkdir "/run/writable-store") (mount "none" "/run/writable-store" "tmpfs") (mount-cow-store "/run/writable-store" "/backing-store") (system* "df" "-hT")) marionette)) (test-equal "offloading" 0 (marionette-eval '(and (file-exists? "/etc/guix/machines.scm") (system* "guix" "offload" "test")) marionette)) (test-end)))) (gexp->derivation "build-vm-test" test)) (define %test-build-vm (system-test (name "build-vm") (description "Offload to a virtual build machine over SSH.") (value (run-build-vm-test))))