From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Castillo Subject: bug#30868: test-suite fails: publish.scm Date: Tue, 20 Mar 2018 00:48:10 +0100 Message-ID: <73b813f2-da13-8432-0774-965efbe2c2e3@uni-bremen.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="weSHgE2OmMEqH6S545icN4o0VLSpiqRiR" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey4XZ-0004tt-LO for bug-guix@gnu.org; Mon, 19 Mar 2018 19:50:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey4XS-00068r-LZ for bug-guix@gnu.org; Mon, 19 Mar 2018 19:50:09 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:34470) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ey4XS-00068c-Fy for bug-guix@gnu.org; Mon, 19 Mar 2018 19:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ey4XS-00016C-8u for bug-guix@gnu.org; Mon, 19 Mar 2018 19:50:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey4WU-0004lk-Lz for bug-guix@gnu.org; Mon, 19 Mar 2018 19:49:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey4WP-0005U9-N8 for bug-guix@gnu.org; Mon, 19 Mar 2018 19:49:02 -0400 Received: from gabriel-vm-2.zfn.uni-bremen.de ([134.102.50.10]:50282 helo=smtp.uni-bremen.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ey4WO-0005PU-Vr for bug-guix@gnu.org; Mon, 19 Mar 2018 19:48:57 -0400 Received: from [192.168.178.5] (unknown [77.23.57.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.uni-bremen.de (Postfix) with ESMTPSA id B9B3620308 for ; Tue, 20 Mar 2018 00:48:47 +0100 (CET) List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 30868@debbugs.gnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --weSHgE2OmMEqH6S545icN4o0VLSpiqRiR Content-Type: multipart/mixed; boundary="TTLntnnxh2gG22ocN1KLJ6RyykQGTzTRZ"; protected-headers="v1" From: Martin Castillo To: bug-guix@gnu.org Message-ID: <73b813f2-da13-8432-0774-965efbe2c2e3@uni-bremen.de> Subject: test-suite fails: publish.scm --TTLntnnxh2gG22ocN1KLJ6RyykQGTzTRZ Content-Type: multipart/mixed; boundary="------------4F0E019F1D570A0C1D164C95" Content-Language: en-US This is a multi-part message in MIME format. --------------4F0E019F1D570A0C1D164C95 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable make check TESTS=3Dtests/publish.scm results in the attached log --=20 GPG: 7FDE 7190 2F73 2C50 236E 403D CC13 48F1 E644 08EC --------------4F0E019F1D570A0C1D164C95 Content-Type: text/x-log; name="test-suite.log" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="test-suite.log" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= GNU Guix 0.14.0.3450-be5ed: ./test-suite.log =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= # TOTAL: 18 # PASS: 17 # SKIP: 0 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 =2E. contents:: :depth: 2 FAIL: tests/publish =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D test-name: /nix-cache-info location: /home/mcd/guix/tests/publish.scm:128 source: + (test-equal + "/nix-cache-info" + (format + #f + "StoreDir: ~a\nWantMassQuery: 0\nPriority: 100\n" + %store-directory) + (http-get-body (publish-uri "/nix-cache-info"))) expected-value: "StoreDir: /home/mcd/guix/test-tmp/store\nWantMassQuery: = 0\nPriority: 100\n" actual-value: "StoreDir: /home/mcd/guix/test-tmp/store\nWantMassQuery: 0\= nPriority: 100\n" result: PASS test-name: /*.narinfo location: /home/mcd/guix/tests/publish.scm:133 source: + (test-equal + "/*.narinfo" + (let* ((info (query-path-info %store %item)) + (unsigned-info + (format + #f + "StorePath: ~a\nURL: nar/~a\nCompression: none\nNarHash: s= ha256:~a\nNarSize: ~d\nReferences: ~a\nFileSize: ~a~%" + %item + (basename %item) + (bytevector->nix-base32-string + (path-info-hash info)) + (path-info-nar-size info) + (basename (first (path-info-references info))) + (path-info-nar-size info))) + (signature + (base64-encode + (string->utf8 + (canonical-sexp->string + ((@@ (guix scripts publish) signed-string) + unsigned-info)))))) + (format + #f + "~aSignature: 1;~a;~a~%" + unsigned-info + (gethostname) + signature)) + (utf8->string + (http-get-body + (publish-uri + (string-append + "/" + (store-path-hash-part %item) + ".narinfo"))))) expected-value: "StorePath: /home/mcd/guix/test-tmp/store/9qcfwy1pkzc6jgl= 4ql997g2fxd6mkrnp-item\nURL: nar/9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp-item\nC= ompression: none\n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YzNzg1NzQ5MzZBNDc1ODBEQkNCNDUjKQogICAoZSAjMDEwMDAxIykKICAgKQogICkKIC= kK\n" actual-value: "StorePath: /home/mcd/guix/test-tmp/store/9qcfwy1pkzc6jgl4q= l997g2fxd6mkrnp-item\nURL: nar/9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp-item\nCom= pression: none\nNarHash: sha256:1xngcmsdkdvaycaqjfzvq4gr3gib56p2l8illglns= qzhpss47pxz\nNarSize: 120\nReferences: dlrzhcp38i3rglimlc5sd9cfv7sv6ybn-r= ef\nFileSize: 120\nSignature: 1;komputilo;KHNpZ25hdHVyZSAKIChkYXRhIAogICh= mbGFncyBwa2NzMSkKICAoaGFzaCBzaGEyNTYgI0M5NUVBNEI2NzdERDgwMDFCNDkyNjlGMzA5= MUY0QTg3OEVDRUVCNzRFMjFEQzdBMjVENUIyNDM5QzQ4MUJEQjYjKQogICkKIChzaWctdmFsI= AogIChyc2EgCiAgIChzICM1MkQzN0RDQUZCNkFCMEZBMTY2OENFNDlGRDkwMTBCN0MyOUI1Qj= kwNDE3OTU5NzcxQTVDRUQyNTI5MUIxQUY3OEYzRTEzQkFDN0U1M0VCRjRDNUE5Q0VCMDg4MEU= 3RjYyMzlFODJBQUNGMTUwNkQ5NjdGQjNDREM3QjFGNEEyQTYzMEQwMjEzQTE5RTM0MjI1QjJD= NjI1MzhBNkU2RDRCNjhGMjI5QTQ2NDVFQTI1OTBDQkZGREVEM0Q3RjM1QTQ4QUE2MDYxMDc4N= DBDRDc1N0I4RTlFRTEzN0IzOTEyQzBCQTBDMzNCRUZBMjgwMzZCMUNGQTdDNjBGQjAxRTg0Iy= kKICAgKQogICkKIChwdWJsaWMta2V5IAogIChyc2EgCiAgIChuICMwMEMxRjc2NDA2OUY1NEZ= GRTkzQTEyNkIwMjMyODkwM0U5ODRFNEFFM0FGNkRGNDAyQjVCNkIzOTA3OTExQjg4QzM4NUYx= QkE3NkEwMDJFQzlERUExMDlBNTIyOEVGMEU2MkVFMzFBMDZEMUE1ODYxQ0FCNDc0RjZDODU3Q= UM2NkVCNjVBMTkwNUYyNUJCQTE4Njk1NzlFNzNBM0I3RkVEMTNBRjVBMTY2NzMyNkY4OENERk= MyRkYyNEIwM0MxNEZEMTM4NEFBN0U3M0NBODk1NzI4ODBCNjA2RTNBOTc0RTE1MzQ3OTYzRkM= 3QjYzNzg1NzQ5MzZBNDc1ODBEQkNCNDUjKQogICAoZSAjMDEwMDAxIykKICAgKQogICkKICkK= \n" result: PASS test-name: /*.narinfo with properly encoded '+' sign location: /home/mcd/guix/tests/publish.scm:163 source: + (test-equal + "/*.narinfo with properly encoded '+' sign" + (let* ((item (add-text-to-store + %store + "fake-gtk+" + "Congrats!")) + (info (query-path-info %store item)) + (unsigned-info + (format + #f + "StorePath: ~a\nURL: nar/~a\nCompression: none\nNarHash: s= ha256:~a\nNarSize: ~d\nReferences: ~%FileSize: ~a~%" + item + (uri-encode (basename item)) + (bytevector->nix-base32-string + (path-info-hash info)) + (path-info-nar-size info) + (path-info-nar-size info))) + (signature + (base64-encode + (string->utf8 + (canonical-sexp->string + ((@@ (guix scripts publish) signed-string) + unsigned-info)))))) + (format + #f + "~aSignature: 1;~a;~a~%" + unsigned-info + (gethostname) + signature)) + (let ((item (add-text-to-store + %store + "fake-gtk+" + "Congrats!"))) + (utf8->string + (http-get-body + (publish-uri + (string-append + "/" + (store-path-hash-part item) + ".narinfo")))))) expected-value: "StorePath: /home/mcd/guix/test-tmp/store/zyrwqbnww52cg9l= 22d8hjn2apqx95jgb-fake-gtk+\nURL: nar/zyrwqbnww52cg9l22d8hjn2apqx95jgb-fa= ke-gtk%2B\nCompression: none\nNarHash: sha256:1ysbwi8icaw2g5qmwjf9k0qd4d9= gazd91kf1djycpk5ahwh4kmlp\nNarSize: 128\nReferences: \nFileSize: 128\nSig= nature: 1;komputilo;KHNpZ25hdHVyZSAKIChkYXRhIAogIChmbGFncyBwa2NzMSkKICAoa= GFzaCBzaGEyNTYgI0UyMUEyOEM3QzREMjQxMjk2Qjk0OUJCMEZCODFFM0U4RjRCQTEwNzg1Mk= ExNTdFQjkxQUQ3RTkwQTJGREY3OUYjKQogICkKIChzaWctdmFsIAogIChyc2EgCiAgIChzICM= 1MTY3RkRCRUNDNjU3MjgyMkIyQTRCQzE4NkNGMjc0MUI0N0ExNjdBMjJDMzI4OTgzM0Q4ODZC= RkVBODdDNjE3QUYwRjU2MEFDOUM3MUVDOTlFQjVGOTlGMEU0RDU0QTVDMkM2QTI2MThBRTUzQ= kJERDk5NzcyQUIyODk4ODYyQzcwMzRGMDdCMkNFQzAzMDQ4NTU4Qjg1N0NBNjNCRDY3MzA0Mk= M2Mzk4QjJCRURFMEZDMjgyMUMwNTQ5MEJGNzA5RkFCMThCQjdGRTlENzE2MUIzREJEN0MzN0F= GNzNBQjQxMjVGRjg4RTNEMERFMzg5REEyRThBMkZGRTBBQjZBIykKICAgKQogICkKIChwdWJs= aWMta2V5IAogIChyc2EgCiAgIChuICMwMEMxRjc2NDA2OUY1NEZGRTkzQTEyNkIwMjMyODkwM= 0U5ODRFNEFFM0FGNkRGNDAyQjVCNkIzOTA3OTExQjg4QzM4NUYxQkE3NkEwMDJFQzlERUExMD= lBNTIyOEVGMEU2MkVFMzFBMDZEMUE1ODYxQ0FCNDc0RjZDODU3QUM2NkVCNjVBMTkwNUYyNUJ= CQTE4Njk1NzlFNzNBM0I3RkVEMTNBRjVBMTY2NzMyNkY4OENERkMyRkYyNEIwM0MxNEZEMTM4= NEFBN0U3M0NBODk1NzI4ODBCNjA2RTNBOTc0RTE1MzQ3OTYzRkM3QjYzNzg1NzQ5MzZBNDc1O= DBEQkNCNDUjKQogICAoZSAjMDEwMDAxIykKICAgKQogICkKICkK\n" actual-value: "StorePath: /home/mcd/guix/test-tmp/store/zyrwqbnww52cg9l22= d8hjn2apqx95jgb-fake-gtk+\nURL: nar/zyrwqbnww52cg9l22d8hjn2apqx95jgb-fake= -gtk%2B\nCompression: none\nNarHash: sha256:1ysbwi8icaw2g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gKQogICkKICkK\n" result: PASS test-name: /nar/* location: /home/mcd/guix/tests/publish.scm:196 source: + (test-equal + "/nar/*" + "bar" + (call-with-temporary-output-file + (lambda (temp port) + (let ((nar (utf8->string + (http-get-body + (publish-uri + (string-append "/nar/" (basename %item))))))) + (call-with-input-string + nar + (cut restore-file <> temp))) + (call-with-input-file temp read-string)))) expected-value: "bar" actual-value: "bar" result: PASS test-name: /nar/gzip/* location: /home/mcd/guix/tests/publish.scm:209 source: + (test-equal + "/nar/gzip/*" + "bar" + (call-with-temporary-output-file + (lambda (temp port) + (let ((nar (http-get-port + (publish-uri + (string-append "/nar/gzip/" (basename %item)))))) + (call-with-gzip-input-port + nar + (cut restore-file <> temp))) + (call-with-input-file temp read-string)))) expected-value: "bar" actual-value: "bar" result: PASS test-name: /nar/gzip/* is really gzip location: /home/mcd/guix/tests/publish.scm:222 source: + (test-equal + "/nar/gzip/* is really gzip" + %gzip-magic-bytes + (let ((nar (http-get-port + (publish-uri + (string-append "/nar/gzip/" (basename %item)))))) + (get-bytevector-n + nar + (bytevector-length %gzip-magic-bytes)))) expected-value: #vu8(31 139) actual-value: #vu8(31 139) result: PASS test-name: /*.narinfo with compression location: /home/mcd/guix/tests/publish.scm:234 source: + (test-equal + "/*.narinfo with compression" + `(("StorePath" unquote %item) + ("URL" + unquote + (string-append "nar/gzip/" (basename %item))) + ("Compression" . "gzip")) + (let ((thread + (with-separate-output-ports + (call-with-new-thread + (lambda () (guix-publish "--port=3D6799" "-C5")))))) + (wait-until-ready 6799) + (let* ((url (string-append + "http://localhost:6799/" + (store-path-hash-part %item) + ".narinfo")) + (body (http-get-port url))) + (filter + (lambda (item) + (match item + (("Compression" . _) #t) + (("StorePath" . _) #t) + (("URL" . _) #t) + (_ #f))) + (recutils->alist body))))) expected-value: (("StorePath" . "/home/mcd/guix/test-tmp/store/9qcfwy1pkz= c6jgl4ql997g2fxd6mkrnp-item") ("URL" . "nar/gzip/9qcfwy1pkzc6jgl4ql997g2f= xd6mkrnp-item") ("Compression" . "gzip")) actual-value: (("StorePath" . "/home/mcd/guix/test-tmp/store/9qcfwy1pkzc6= jgl4ql997g2fxd6mkrnp-item") ("URL" . "nar/gzip/9qcfwy1pkzc6jgl4ql997g2fxd= 6mkrnp-item") ("Compression" . "gzip")) result: PASS test-name: /*.narinfo for a compressed file location: /home/mcd/guix/tests/publish.scm:256 source: + (test-equal + "/*.narinfo for a compressed file" + '("none" "nar") + (let* ((item (add-text-to-store + %store + "fake.tar.gz" + "This is a fake compressed file.")) + (url (string-append + "http://localhost:6799/" + (store-path-hash-part item) + ".narinfo")) + (body (http-get-port url)) + (info (recutils->alist body))) + (list (assoc-ref info "Compression") + (dirname (assoc-ref info "URL"))))) expected-value: ("none" "nar") actual-value: ("none" "nar") result: PASS test-name: custom nar path location: /home/mcd/guix/tests/publish.scm:268 source: + (test-equal + "custom nar path" + (list `(("StorePath" unquote %item) + ("URL" + unquote + (string-append + "foo/bar/chbouib/" + (basename %item))) + ("Compression" . "none")) + 200 + 404) + (let ((thread + (with-separate-output-ports + (call-with-new-thread + (lambda () + (guix-publish + "--port=3D6798" + "-C0" + "--nar-path=3D///foo/bar//chbouib/")))))) + (wait-until-ready 6798) + (let* ((base "http://localhost:6798/") + (part (store-path-hash-part %item)) + (url (string-append base part ".narinfo")) + (nar-url + (string-append + base + "foo/bar/chbouib/" + (basename %item))) + (body (http-get-port url))) + (list (filter + (lambda (item) + (match item + (("Compression" . _) #t) + (("StorePath" . _) #t) + (("URL" . _) #t) + (_ #f))) + (recutils->alist body)) + (response-code (http-get nar-url)) + (response-code + (http-get + (string-append base "nar/" (basename %item)))))))) expected-value: ((("StorePath" . "/home/mcd/guix/test-tmp/store/9qcfwy1pk= zc6jgl4ql997g2fxd6mkrnp-item") ("URL" . "foo/bar/chbouib/9qcfwy1pkzc6jgl4= ql997g2fxd6mkrnp-item") ("Compression" . "none")) 200 404) actual-value: ((("StorePath" . "/home/mcd/guix/test-tmp/store/9qcfwy1pkzc= 6jgl4ql997g2fxd6mkrnp-item") ("URL" . "foo/bar/chbouib/9qcfwy1pkzc6jgl4ql= 997g2fxd6mkrnp-item") ("Compression" . "none")) 200 404) result: PASS test-name: /nar/ with properly encoded '+' sign location: /home/mcd/guix/tests/publish.scm:298 source: + (test-equal + "/nar/ with properly encoded '+' sign" + "Congrats!" + (let ((item (add-text-to-store + %store + "fake-gtk+" + "Congrats!"))) + (call-with-temporary-output-file + (lambda (temp port) + (let ((nar (utf8->string + (http-get-body + (publish-uri + (string-append + "/nar/" + (uri-encode (basename item)))))))) + (call-with-input-string + nar + (cut restore-file <> temp))) + (call-with-input-file temp read-string))))) expected-value: "Congrats!" actual-value: "Congrats!" result: PASS test-name: /nar/invalid location: /home/mcd/guix/tests/publish.scm:310 source: + (test-equal + "/nar/invalid" + 404 + (begin + (call-with-output-file + (string-append (%store-prefix) "/invalid") + (lambda (port) + (display + "This file is not a valid store item." + port))) + (response-code + (http-get + (publish-uri (string-append "/nar/invalid")))))) expected-value: 404 actual-value: 404 result: PASS test-name: /file/NAME/sha256/HASH location: /home/mcd/guix/tests/publish.scm:318 source: + (test-equal + "/file/NAME/sha256/HASH" + "Hello, Guix world!" + (let* ((data "Hello, Guix world!") + (hash (call-with-input-string data port-sha256)) + (drv (run-with-store + %store + (gexp->derivation + "the-file.txt" + (gexp (call-with-output-file + (ungexp output) + (lambda (port) (display (ungexp data) port)))= ) + #:hash-algo + 'sha256 + #:hash + hash))) + (out (build-derivations %store (list drv)))) + (utf8->string + (http-get-body + (publish-uri + (string-append + "/file/the-file.txt/sha256/" + (bytevector->nix-base32-string hash))))))) expected-value: "Hello, Guix world!" actual-value: "Hello, Guix world!" result: PASS test-name: /file/NAME/sha256/INVALID-NIX-BASE32-STRING location: /home/mcd/guix/tests/publish.scm:336 source: + (test-equal + "/file/NAME/sha256/INVALID-NIX-BASE32-STRING" + 404 + (let ((uri (publish-uri + "/file/the-file.txt/sha256/not-a-nix-base32-string"))) + (response-code (http-get uri)))) expected-value: 404 actual-value: 404 result: PASS test-name: /file/NAME/sha256/INVALID-HASH location: /home/mcd/guix/tests/publish.scm:342 source: + (test-equal + "/file/NAME/sha256/INVALID-HASH" + 404 + (let ((uri (publish-uri + (string-append + "/file/the-file.txt/sha256/" + (bytevector->nix-base32-string + (call-with-input-string "" port-sha256)))))) + (response-code (http-get uri)))) expected-value: 404 actual-value: 404 result: PASS test-name: with cache location: /home/mcd/guix/tests/publish.scm:352 source: + (test-equal + "with cache" + (list #t + `(("StorePath" unquote %item) + ("URL" + unquote + (string-append "nar/gzip/" (basename %item))) + ("Compression" . "gzip")) + 200 + #t + #t + 404) + (call-with-temporary-directory + (lambda (cache) + (let ((thread + (with-separate-output-ports + (call-with-new-thread + (lambda () + (guix-publish + "--port=3D6797" + "-C2" + (string-append "--cache=3D" cache))))))) + (wait-until-ready 6797) + (let* ((base "http://localhost:6797/") + (part (store-path-hash-part %item)) + (url (string-append base part ".narinfo")) + (nar-url + (string-append base "nar/gzip/" (basename %item))) + (cached + (string-append + cache + "/gzip/" + (basename %item) + ".narinfo")) + (nar (string-append + cache + "/gzip/" + (basename %item) + ".nar")) + (response (http-get url))) + (and (=3D 404 (response-code response)) + (match (assq-ref + (response-headers response) + 'cache-control) + ((((quote max-age) . ttl)) (< ttl 3600))) + (wait-for-file cached) + (let* ((body (http-get-port url)) + (compressed (http-get nar-url)) + (uncompressed + (http-get + (string-append base "nar/" (basename %item)))= ) + (narinfo (recutils->alist body))) + (list (file-exists? nar) + (filter + (lambda (item) + (match item + (("Compression" . _) #t) + (("StorePath" . _) #t) + (("URL" . _) #t) + (_ #f))) + narinfo) + (response-code compressed) + (=3D (response-content-length compressed) + (stat:size (stat nar))) + (=3D (string->number (assoc-ref narinfo "FileSiz= e")) + (stat:size (stat nar))) + (response-code uncompressed))))))))) ;;; (wait-for-file "/tmp/guix-directory.kSJWSp/gzip/9qcfwy1pkzc6jgl4ql997= g2fxd6mkrnp-item.narinfo") expected-value: (#t (("StorePath" . "/home/mcd/guix/test-tmp/store/9qcfwy= 1pkzc6jgl4ql997g2fxd6mkrnp-item") ("URL" . "nar/gzip/9qcfwy1pkzc6jgl4ql99= 7g2fxd6mkrnp-item") ("Compression" . "gzip")) 200 #t #t 404) actual-value: (#t (("StorePath" . "/home/mcd/guix/test-tmp/store/9qcfwy1p= kzc6jgl4ql997g2fxd6mkrnp-item") ("URL" . "nar/gzip/9qcfwy1pkzc6jgl4ql997g= 2fxd6mkrnp-item") ("Compression" . "gzip")) 200 #t #t 404) result: PASS test-name: with cache, uncompressed location: /home/mcd/guix/tests/publish.scm:412 source: + (test-equal + "with cache, uncompressed" + (list #t + `(("StorePath" unquote item) + ("URL" + unquote + (string-append "nar/" (basename item))) + ("Compression" . "none")) + 200 + (path-info-nar-size + (query-path-info %store item)) + 404) + (call-with-temporary-directory + (lambda (cache) + (let ((thread + (with-separate-output-ports + (call-with-new-thread + (lambda () + (guix-publish + "--port=3D6796" + "-C2" + (string-append "--cache=3D" cache))))))) + (wait-until-ready 6796) + (let* ((base "http://localhost:6796/") + (part (store-path-hash-part item)) + (url (string-append base part ".narinfo")) + (cached + (string-append + cache + "/none/" + (basename item) + ".narinfo")) + (nar (string-append + cache + "/none/" + (basename item) + ".nar")) + (response (http-get url))) + (and (=3D 404 (response-code response)) + (wait-for-file cached) + (let* ((body (http-get-port url)) + (compressed + (http-get + (string-append base "nar/gzip/" (basename ite= m)))) + (uncompressed + (http-get + (string-append base "nar/" (basename item))))= + (narinfo (recutils->alist body))) + (list (file-exists? nar) + (filter + (lambda (item) + (match item + (("Compression" . _) #t) + (("StorePath" . _) #t) + (("URL" . _) #t) + (_ #f))) + narinfo) + (response-code uncompressed) + (string->number (assoc-ref narinfo "FileSize")) + (response-code compressed))))))))) ;;; (wait-for-file "/tmp/guix-directory.0r8OhR/none/knwzp6rysyr1i13jhdn2g= 8v2lg7qrb47-fake-compressed-thing.tar.gz.narinfo") expected-value: (#t (("StorePath" . "/home/mcd/guix/test-tmp/store/knwzp6= rysyr1i13jhdn2g8v2lg7qrb47-fake-compressed-thing.tar.gz") ("URL" . "nar/k= nwzp6rysyr1i13jhdn2g8v2lg7qrb47-fake-compressed-thing.tar.gz") ("Compress= ion" . "none")) 200 176 404) actual-value: (#t (("StorePath" . "/home/mcd/guix/test-tmp/store/knwzp6ry= syr1i13jhdn2g8v2lg7qrb47-fake-compressed-thing.tar.gz") ("URL" . "nar/knw= zp6rysyr1i13jhdn2g8v2lg7qrb47-fake-compressed-thing.tar.gz") ("Compressio= n" . "none")) 200 176 404) result: PASS test-name: /log/NAME location: /home/mcd/guix/tests/publish.scm:459 source: + (test-equal + "/log/NAME" + `(200 #t application/x-bzip2) + (let ((drv (run-with-store + %store + (gexp->derivation + "with-log" + (gexp (call-with-output-file + (ungexp output) + (lambda (port) + (display + "Hello, build log!" + (current-error-port)) + (display "" port)))))))) + (build-derivations %store (list drv)) + (let* ((response + (http-get + (publish-uri + (string-append + "/log/" + (basename (derivation->output-path drv)))) + #:decode-body? + #f)) + (base (basename (derivation-file-name drv))) + (log (string-append + (dirname %state-directory) + "/log/guix/drvs/" + (string-take base 2) + "/" + (string-drop base 2) + ".bz2"))) + (list (response-code response) + (=3D (response-content-length response) + (stat:size (stat log))) + (first (response-content-type response)))))) expected-value: (200 #t application/x-bzip2) actual-value: #f actual-error: + (system-error + "stat" + "~A: ~S" + ("No such file or directory" + "/home/mcd/guix/test-tmp/var/log/guix/drvs/b7/nz0wvppdyr4n5sgs3b89j6= 82sksqcb-with-log.drv.bz2") + (2)) result: FAIL test-name: /log/NAME not found location: /home/mcd/guix/tests/publish.scm:481 source: + (test-equal + "/log/NAME not found" + 404 + (let ((uri (publish-uri "/log/does-not-exist"))) + (response-code (http-get uri)))) expected-value: 404 actual-value: 404 result: PASS publishing /home/mcd/guix/test-tmp/store on 0.0.0.0, port 6799 GET /9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp.narinfo GET /cjmf4m1ss1c2jskxcvr643rgj1ca976l.narinfo publishing /home/mcd/guix/test-tmp/store on 0.0.0.0, port 6789 GET /nix-cache-info GET /9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp.narinfo GET /zyrwqbnww52cg9l22d8hjn2apqx95jgb.narinfo GET /nar/9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp-item GET /nar/gzip/9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp-item GET /nar/gzip/9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp-item GET /nar/zyrwqbnww52cg9l22d8hjn2apqx95jgb-fake-gtk%2B GET /nar/invalid GET /file/the-file.txt/sha256/0halvvmzqz6wvp0g8sa9hda5g04j4hpnc5gd314npga= rmbc2iw5f GET /file/the-file.txt/sha256/not-a-nix-base32-string GET /file/the-file.txt/sha256/0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877= wk11c9c73 GET /log/4l2yqrd74m2xi8n5l4r1zlj8x0nzzxw9-with-log GET /log/does-not-exist publishing /home/mcd/guix/test-tmp/store on 0.0.0.0, port 6796 GET /knwzp6rysyr1i13jhdn2g8v2lg7qrb47.narinfo GET /knwzp6rysyr1i13jhdn2g8v2lg7qrb47.narinfo GET /nar/gzip/knwzp6rysyr1i13jhdn2g8v2lg7qrb47-fake-compressed-thing.tar.= gz GET /nar/knwzp6rysyr1i13jhdn2g8v2lg7qrb47-fake-compressed-thing.tar.gz publishing /home/mcd/guix/test-tmp/store on 0.0.0.0, port 6797 GET /9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp.narinfo GET /9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp.narinfo GET /nar/gzip/9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp-item GET /nar/9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp-item random seed for tests: 1521502894 publishing /home/mcd/guix/test-tmp/store on 0.0.0.0, port 6798 GET /9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp.narinfo GET /foo/bar/chbouib/9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp-item GET /nar/9qcfwy1pkzc6jgl4ql997g2fxd6mkrnp-item --------------4F0E019F1D570A0C1D164C95-- --TTLntnnxh2gG22ocN1KLJ6RyykQGTzTRZ-- --weSHgE2OmMEqH6S545icN4o0VLSpiqRiR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE61CTslYA+K5btSvb61vedmKoYVkFAlqwTF4ACgkQ61vedmKo YVlo7AgAlocXptFlXyZzUHMp9ZVq0nxLG33LI+cRNpI41fBKrjULxmEBXF3syUtv Sx0wA1zuGxcTqjSCkLPabr43SDQgIwmjfl1cEGpJTXHwDBn44x+Jxqg0YFA5ar2g ckt/vb428xD6hmy6LMpTw7rtM2P32e6h/DbTqGY+JvkRcjEyQCJccbi+65l5dKNL kAGqnm1hPyKxRrzdNpPQlIbZ+C5aXRfELNMeZJyymbTRPeGpuiwhL8LWTgXg/XXu uas5QnXLRbf8YxPFpLQz26yOGGeFAL/W6w60SoRkrag1pDSIznscfW/69IQ5xM/s dO5KpOPyM9nvjeIs5DI06JqkN+cgOg== =jTWk -----END PGP SIGNATURE----- --weSHgE2OmMEqH6S545icN4o0VLSpiqRiR--