test-name: mount, ENOENT location: /data/paul/sourceCode/guix/tests/syscalls.scm:40 source: + (test-equal + "mount, ENOENT" + ENOENT + (catch 'system-error + (lambda () + (mount "/dev/null" "/does-not-exist" "ext2") + #f) + (compose system-error-errno list))) expected-value: 2 actual-value: 2 result: PASS test-name: umount, ENOENT/EPERM location: /data/paul/sourceCode/guix/tests/syscalls.scm:48 source: + (test-assert + "umount, ENOENT/EPERM" + (catch 'system-error + (lambda () (umount "/does-not-exist") #f) + (lambda args + (memv (system-error-errno args) + (list EPERM ENOENT))))) actual-value: (1 2) result: PASS test-name: mount-points location: /data/paul/sourceCode/guix/tests/syscalls.scm:57 source: + (test-assert + "mount-points" + (any (cute member <> (mount-points)) + '("/" "/proc" "/sys" "/dev"))) actual-value: ("/" "/sys" "/proc" "/dev" "/sys/kernel/security" "/dev/shm" "/dev/pts" "/run" "/sys/fs/cgroup" "/sys/fs/cgroup/systemd" "/sys/fs/pstore" "/sys/firmware/efi/efivars" "/sys/fs/cgroup/pids" "/sys/fs/cgroup/cpuset" "/sys/fs/cgroup/freezer" "/sys/fs/cgroup/hugetlb" "/sys/fs/cgroup/perf_event" "/sys/fs/cgroup/net_cls,net_prio" "/sys/fs/cgroup/cpu,cpuacct" "/sys/fs/cgroup/memory" "/sys/fs/cgroup/devices" "/sys/fs/cgroup/blkio" "/sys/kernel/config" "/" "/sys/fs/selinux" "/proc/sys/fs/binfmt_misc" "/dev/hugepages" "/dev/mqueue" "/sys/kernel/debug" "/proc/fs/nfsd" "/boot" "/data" "/home" "/boot/efi" "/var/lib/nfs/rpc_pipefs" "/run/user/1000") result: PASS test-name: swapon, ENOENT/EPERM location: /data/paul/sourceCode/guix/tests/syscalls.scm:63 source: + (test-assert + "swapon, ENOENT/EPERM" + (catch 'system-error + (lambda () (swapon "/does-not-exist") #f) + (lambda args + (memv (system-error-errno args) + (list EPERM ENOENT))))) actual-value: (1 2) result: PASS test-name: swapoff, ENOENT/EINVAL/EPERM location: /data/paul/sourceCode/guix/tests/syscalls.scm:71 source: + (test-assert + "swapoff, ENOENT/EINVAL/EPERM" + (catch 'system-error + (lambda () (swapoff "/does-not-exist") #f) + (lambda args + (memv (system-error-errno args) + (list EPERM EINVAL ENOENT))))) actual-value: (1 22 2) result: PASS test-name: mkdtemp! location: /data/paul/sourceCode/guix/tests/syscalls.scm:79 source: + (test-assert + "mkdtemp!" + (let* ((tmp (or (getenv "TMPDIR") "/tmp")) + (dir (mkdtemp! + (string-append tmp "/guix-test-XXXXXX")))) + (and (file-exists? dir) (begin (rmdir dir) #t)))) actual-value: #t result: PASS test-name: statfs, ENOENT location: /data/paul/sourceCode/guix/tests/syscalls.scm:87 source: + (test-equal + "statfs, ENOENT" + ENOENT + (catch 'system-error + (lambda () (statfs "/does-not-exist")) + (compose system-error-errno list))) expected-value: 2 actual-value: 2 result: PASS test-name: statfs location: /data/paul/sourceCode/guix/tests/syscalls.scm:94 source: + (test-assert + "statfs" + (let ((fs (statfs "/"))) + (and (file-system? fs) + (> (file-system-block-size fs) 0) + (>= (file-system-blocks-available fs) 0) + (>= (file-system-blocks-free fs) + (file-system-blocks-available fs))))) actual-value: #t result: PASS test-name: clone location: /data/paul/sourceCode/guix/tests/syscalls.scm:111 source: + (test-assert + "clone" + (match (clone (logior CLONE_NEWUSER SIGCHLD)) + (0 (primitive-exit 42)) + (pid (and (not (equal? + (readlink (user-namespace pid)) + (readlink (user-namespace (getpid))))) + (match (waitpid pid) + ((_ . status) (= 42 (status:exit-val status)))))))) actual-value: #f actual-error: + (system-error + "clone" + "~d: ~A" + (268435473 "Invalid argument") + (22)) result: FAIL test-name: setns location: /data/paul/sourceCode/guix/tests/syscalls.scm:124 source: + (test-assert + "setns" + (match (clone (logior CLONE_NEWUSER SIGCHLD)) + (0 (primitive-exit 0)) + (clone-pid + (match (pipe) + ((in . out) + (match (primitive-fork) + (0 + (close in) + (call-with-input-file + (user-namespace clone-pid) + (lambda (port) (setns (port->fdes port) 0))) + (write 'done out) + (close out) + (primitive-exit 0)) + (fork-pid + (close out) + (read in) + (let ((result + (and (equal? + (readlink + (user-namespace clone-pid)) + (readlink + (user-namespace fork-pid)))))) + (waitpid clone-pid) + (waitpid fork-pid) + result)))))))) actual-value: #f actual-error: + (system-error + "clone" + "~d: ~A" + (268435473 "Invalid argument") + (22)) result: FAIL test-name: pivot-root location: /data/paul/sourceCode/guix/tests/syscalls.scm:162 source: + (test-equal + "pivot-root" + #t + (match (pipe) + ((in . out) + (match (clone (logior CLONE_NEWUSER CLONE_NEWNS SIGCHLD)) + (0 + (dynamic-wind + (const #t) + (lambda () + (close in) + (call-with-temporary-directory + (lambda (root) + (let ((put-old (string-append root "/real-root"))) + (mount "none" root "tmpfs") + (mkdir put-old) + (call-with-output-file + (string-append root "/test") + (lambda (port) (display "testing\n" port))) + (pivot-root root put-old) + (write (file-exists? "/test") out) + (close out))))) + (lambda () (primitive-exit 0)))) + (pid (close out) + (let ((result (read in))) + (close in) + (and (zero? (match (waitpid pid) + ((_ . status) + (status:exit-val status)))) + (eq? #t result)))))))) expected-value: #t actual-value: #f actual-error: + (system-error + "clone" + "~d: ~A" + (268566545 "Invalid argument") + (22)) result: FAIL test-name: scandir*, ENOENT location: /data/paul/sourceCode/guix/tests/syscalls.scm:195 source: + (test-equal + "scandir*, ENOENT" + ENOENT + (catch 'system-error + (lambda () (scandir* "/does/not/exist")) + (lambda args (system-error-errno args)))) expected-value: 2 actual-value: 2 result: PASS test-name: scandir*, ASCII file names location: /data/paul/sourceCode/guix/tests/syscalls.scm:203 source: + (test-equal + "scandir*, ASCII file names" + (scandir + (dirname + (search-path %load-path "guix/base32.scm")) + (const #t) + stringprocedure + int + (dynamic-func "creat" (dynamic-link)) + (list '* int)))) + (creat (string->pointer + (string-append directory "/?") + "UTF-8") + 420) + (creat (string->pointer + (string-append directory "/?") + "UTF-8") + 420) + (let ((locale (setlocale LC_ALL))) + (dynamic-wind + (lambda () (setlocale LC_ALL "C")) + (lambda () + (match (scandir* directory) + (((names . properties) ...) names))) + (lambda () (setlocale LC_ALL locale)))))))) expected-value: ("." ".." "?" "?") actual-value: ("." ".." "?" "?") result: PASS test-name: scandir*, properties location: /data/paul/sourceCode/guix/tests/syscalls.scm:237 source: + (test-assert + "scandir*, properties" + (let ((directory + (dirname + (search-path %load-path "guix/base32.scm")))) + (every (lambda (entry name) + (match entry + ((name2 . properties) + (and (string=? name2 name) + (let* ((full (string-append directory "/" name)) + (stat (lstat full)) + (inode (assoc-ref properties 'inode)) + (type (assoc-ref properties 'type))) + (and (= inode (stat:ino stat)) + (or (eq? type 'unknown) + (eq? type (stat:type stat))))))))) + (scandir* directory) + (scandir directory (const #t) string (termios-input-speed termios) 0) + (> (termios-output-speed termios) 0)))) actual-value: #t result: PASS test-name: tcsetattr location: /data/paul/sourceCode/guix/tests/syscalls.scm:505 source: + (test-assert + "tcsetattr" + (let ((first (tcgetattr 0))) + (tcsetattr 0 (tcsetattr-action TCSANOW) first) + (equal? first (tcgetattr 0)))) actual-value: #t result: PASS test-name: terminal-window-size ENOTTY location: /data/paul/sourceCode/guix/tests/syscalls.scm:510 source: + (test-assert + "terminal-window-size ENOTTY" + (call-with-input-file + "/dev/null" + (lambda (port) + (catch 'system-error + (lambda () (terminal-window-size port)) + (lambda args + (memv (system-error-errno args) + (list ENOTTY EINVAL))))))) actual-value: (25 22) result: PASS test-name: terminal-columns location: /data/paul/sourceCode/guix/tests/syscalls.scm:521 source: + (test-assert + "terminal-columns" + (> (terminal-columns) 0)) actual-value: #t result: PASS test-name: terminal-columns non-file port location: /data/paul/sourceCode/guix/tests/syscalls.scm:524 source: + (test-assert + "terminal-columns non-file port" + (> (terminal-columns + (open-input-string + "Join us now, share the software!")) + 0)) actual-value: #t result: PASS test-name: utmpx-entries location: /data/paul/sourceCode/guix/tests/syscalls.scm:528 source: + (test-assert + "utmpx-entries" + (match (utmpx-entries) + (((? utmpx? entries) ...) + (every (lambda (entry) + (match (utmpx-user entry) + ((? string?) + (or (not (memv (utmpx-login-type entry) + (list (login-type INIT_PROCESS) + (login-type LOGIN_PROCESS) + (login-type USER_PROCESS)))) + (> (utmpx-pid entry) 0))) + (#f #t))) + entries)))) actual-value: #t result: PASS test-name: read-utmpx, EOF location: /data/paul/sourceCode/guix/tests/syscalls.scm:545 source: + (test-assert + "read-utmpx, EOF" + (eof-object? (read-utmpx (%make-void-port "r")))) actual-value: #t result: PASS test-name: read-utmpx location: /data/paul/sourceCode/guix/tests/syscalls.scm:550 source: + (test-assert + "read-utmpx" + (let ((result + (call-with-input-file + "/var/run/utmpx" + read-utmpx))) + (or (utmpx? result) (eof-object? result)))) result: SKIP