aboutsummaryrefslogtreecommitdiff
path: root/test/mocha.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/mocha.js')
0 files changed, 0 insertions, 0 deletions
$(virtual-machine os)))) (test-runner-current (system-test-runner #$output)) (test-begin "singularity") (test-assert "singularity exec /bin/guile (as root)" (marionette-eval '#$singularity-exec marionette)) (test-equal "singularity exec /bin/guile (unprivileged)" 0 (marionette-eval `(begin (use-modules (ice-9 match)) (match (primitive-fork) (0 (dynamic-wind (const #f) (lambda () (setgid 1000) (setuid 1000) (execl #$(program-file "singularity-exec-test" #~(exit #$singularity-exec)) "test")) (lambda () (primitive-exit 127)))) (pid (cdr (waitpid pid))))) marionette)) (test-equal "singularity run" ;test the entry point 42 (marionette-eval `(status:exit-val (system* #$(file-append singularity "/bin/singularity") "run" #$image "-c" "(exit 42)")) marionette)) ;; FIXME: Singularity 2.x doesn't directly honor ;; /.singularity.d/env/*.sh. Instead, you have to load those files ;; manually, which we don't do. Remove 'test-skip' call once we've ;; switch to Singularity 3.x. (test-skip 1) (test-equal "singularity run, with environment" 0 (marionette-eval ;; Check whether GUILE_LOAD_PATH is properly set, allowing us to ;; find the (json) module. `(status:exit-val (system* #$(file-append singularity "/bin/singularity") "--debug" "run" #$image "-c" "(use-modules (json))")) marionette)) (test-end)))) (gexp->derivation "singularity-test" test)) (define (build-tarball&run-singularity-test) (mlet* %store-monad ((_ (set-grafting #f)) (guile (set-guile-for-build (default-guile))) ;; 'singularity exec' insists on having /bin/sh in the image. (profile (profile-derivation (packages->manifest (list bash-minimal guile-2.2 guile-json-3)) #:hooks '() #:locales? #f)) (tarball (squashfs-image "singularity-pack" profile #:entry-point "bin/guile" #:symlinks '(("/bin" -> "bin"))))) (run-singularity-test tarball))) (define %test-singularity (system-test (name "singularity") (description "Test Singularity container of Guix.") (value (build-tarball&run-singularity-test))))