test-name: not a number location: /home/alexvong1995/scm/guix/tests/substitute.scm:100 source: + (test-equal + "not a number" + '(1 #t) + (let ((error-output (open-output-string))) + (parameterize + ((guix-warning-port error-output)) + (catch 'quit + (lambda () + (narinfo-signature->canonical-sexp + (signature-field "foo" #:version "not a number")) + #f) + (lambda (key value) + (list value + (let ((message (get-output-string error-output))) + (->bool + (string-match "signature version" message))))))))) expected-value: (1 #t) actual-value: (1 #t) result: PASS test-name: wrong version number location: /home/alexvong1995/scm/guix/tests/substitute.scm:105 source: + (test-equal + "wrong version number" + '(1 #t) + (let ((error-output (open-output-string))) + (parameterize + ((guix-warning-port error-output)) + (catch 'quit + (lambda () + (narinfo-signature->canonical-sexp + (signature-field "foo" #:version "2")) + #f) + (lambda (key value) + (list value + (let ((message (get-output-string error-output))) + (->bool + (string-match + "unsupported.*version" + message))))))))) expected-value: (1 #t) actual-value: (1 #t) result: PASS test-name: valid narinfo-signature->canonical-sexp location: /home/alexvong1995/scm/guix/tests/substitute.scm:110 source: + (test-assert + "valid narinfo-signature->canonical-sexp" + (canonical-sexp? + (narinfo-signature->canonical-sexp + (signature-field "foo")))) actual-value: #t result: PASS test-name: query narinfo without signature location: /home/alexvong1995/scm/guix/tests/substitute.scm:173 source: + (test-equal + "query narinfo without signature" + "" + (with-narinfo + %narinfo + (string-trim-both + (with-output-to-string + (lambda () + (with-input-from-string + (string-append + "have " + (%store-prefix) + "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") + (lambda () (guix-substitute "--query")))))))) expected-value: actual-value: #f actual-error: + (system-error + "lstat" + "~A: ~S" + ("No such file or directory" + "/home/alexvong1995/scm/guix/test-tmp/var/17702/cache-17702/guix/substitute/") + (2)) result: FAIL test-name: query narinfo with invalid hash location: /home/alexvong1995/scm/guix/tests/substitute.scm:185 source: + (test-equal + "query narinfo with invalid hash" + "" + (with-narinfo + (string-append + %narinfo + "Signature: " + (signature-field "different body") + "\n") + (string-trim-both + (with-output-to-string + (lambda () + (with-input-from-string + (string-append + "have " + (%store-prefix) + "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") + (lambda () (guix-substitute "--query")))))))) expected-value: actual-value: #f actual-error: + (system-error + "lstat" + "~A: ~S" + ("No such file or directory" + "/home/alexvong1995/scm/guix/test-tmp/var/17702/cache-17702/guix/substitute/") + (2)) result: FAIL test-name: query narinfo signed with authorized key location: /home/alexvong1995/scm/guix/tests/substitute.scm:200 source: + (test-equal + "query narinfo signed with authorized key" + (string-append + (%store-prefix) + "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") + (with-narinfo + (string-append + %narinfo + "Signature: " + (signature-field %narinfo) + "\n") + (string-trim-both + (with-output-to-string + (lambda () + (with-input-from-string + (string-append + "have " + (%store-prefix) + "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") + (lambda () (guix-substitute "--query")))))))) expected-value: /home/alexvong1995/scm/guix/test-tmp/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo actual-value: #f actual-error: + (system-error + "lstat" + "~A: ~S" + ("No such file or directory" + "/home/alexvong1995/scm/guix/test-tmp/var/17702/cache-17702/guix/substitute/") + (2)) result: FAIL test-name: query narinfo signed with unauthorized key location: /home/alexvong1995/scm/guix/tests/substitute.scm:214 source: + (test-equal + "query narinfo signed with unauthorized key" + "" + (with-narinfo + (string-append + %narinfo + "Signature: " + (signature-field + %narinfo + #:public-key + %wrong-public-key) + "\n") + (string-trim-both + (with-output-to-string + (lambda () + (with-input-from-string + (string-append + "have " + (%store-prefix) + "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") + (lambda () (guix-substitute "--query")))))))) expected-value: actual-value: #f actual-error: + (system-error + "lstat" + "~A: ~S" + ("No such file or directory" + "/home/alexvong1995/scm/guix/test-tmp/var/17702/cache-17702/guix/substitute/") + (2)) result: FAIL test-name: substitute, no signature location: /home/alexvong1995/scm/guix/tests/substitute.scm:230 source: + (test-equal + "substitute, no signature" + '(1 #t) + (let ((error-output (open-output-string))) + (parameterize + ((guix-warning-port error-output)) + (catch 'quit + (lambda () + (with-narinfo + %narinfo + (guix-substitute + "--substitute" + (string-append + (%store-prefix) + "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") + "foo")) + #f) + (lambda (key value) + (list value + (let ((message (get-output-string error-output))) + (->bool + (string-match "lacks a signature" message))))))))) expected-value: (1 #t) actual-value: #f actual-error: + (system-error + "lstat" + "~A: ~S" + ("No such file or directory" + "/home/alexvong1995/scm/guix/test-tmp/var/17702/cache-17702/guix/substitute/") + (2)) result: FAIL test-name: substitute, invalid hash location: /home/alexvong1995/scm/guix/tests/substitute.scm:238 source: + (test-equal + "substitute, invalid hash" + '(1 #t) + (let ((error-output (open-output-string))) + (parameterize + ((guix-warning-port error-output)) + (catch 'quit + (lambda () + (with-narinfo + (string-append + %narinfo + "Signature: " + (signature-field "different body") + "\n") + (guix-substitute + "--substitute" + (string-append + (%store-prefix) + "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") + "foo")) + #f) + (lambda (key value) + (list value + (let ((message (get-output-string error-output))) + (->bool (string-match "hash" message))))))))) expected-value: (1 #t) actual-value: #f actual-error: + (system-error + "lstat" + "~A: ~S" + ("No such file or directory" + "/home/alexvong1995/scm/guix/test-tmp/var/17702/cache-17702/guix/substitute/") + (2)) result: FAIL test-name: substitute, unauthorized key location: /home/alexvong1995/scm/guix/tests/substitute.scm:249 source: + (test-equal + "substitute, unauthorized key" + '(1 #t) + (let ((error-output (open-output-string))) + (parameterize + ((guix-warning-port error-output)) + (catch 'quit + (lambda () + (with-narinfo + (string-append + %narinfo + "Signature: " + (signature-field + %narinfo + #:public-key + %wrong-public-key) + "\n") + (guix-substitute + "--substitute" + (string-append + (%store-prefix) + "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") + "foo")) + #f) + (lambda (key value) + (list value + (let ((message (get-output-string error-output))) + (->bool (string-match "unauthorized" message))))))))) expected-value: (1 #t) actual-value: #f actual-error: + (system-error + "lstat" + "~A: ~S" + ("No such file or directory" + "/home/alexvong1995/scm/guix/test-tmp/var/17702/cache-17702/guix/substitute/") + (2)) result: FAIL test-name: substitute, authorized key location: /home/alexvong1995/scm/guix/tests/substitute.scm:261 source: + (test-equal + "substitute, authorized key" + "Substitutable data." + (with-narinfo + (string-append + %narinfo + "Signature: " + (signature-field %narinfo)) + (dynamic-wind + (const #t) + (lambda () + (guix-substitute + "--substitute" + (string-append + (%store-prefix) + "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo") + "substitute-retrieved") + (call-with-input-file + "substitute-retrieved" + get-string-all)) + (lambda () + (false-if-exception + (delete-file "substitute-retrieved")))))) sha256:1cbw33db7fhwill1klnjx1h439lpnf2ppdk5kpciwfy5pb5ah9si warning: authentication and authorization of substitutes disabled! warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable Found valid signature for /home/alexvong1995/scm/guix/test-tmp/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo From file:/home/alexvong1995/scm/guix/test-tmp/var/17702/substituter-data/example.nar Downloading /home/alexvong1995/scm/guix/test-tmp/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo (42B installed)...  example.nar 136B 0B/s 00:00 [####################] 100.0%expected-value: Substitutable data. actual-value: #f actual-error: + (system-error + "lstat" + "~A: ~S" + ("No such file or directory" + "/home/alexvong1995/scm/guix/test-tmp/var/17702/cache-17702/guix/substitute/") + (2)) result: FAIL