aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-04-09 16:11:59 +0200
committerRicardo Wurmus <rekado@elephly.net>2021-04-13 13:41:16 +0200
commit95f25c9b13e22603c35f3acd9048fbd1c8671925 (patch)
treeedf960ce71fa59ae69423b58ddf0d806c0a7725a
parent85788dd64d5c54ff52f19c8bb6c8c522ed581b2c (diff)
downloadguix-95f25c9b13e22603c35f3acd9048fbd1c8671925.tar.gz
guix-95f25c9b13e22603c35f3acd9048fbd1c8671925.zip
gnu: python-terminado: Update to 0.9.4.
* gnu/packages/python-web.scm (python-terminado): Update to 0.9.4. [propagated-inputs]: Replace python-tornado with python-tornado-6. [native-inputs]: Replace python-nose with python-pytest. [home-page]: Follow redirect. [arguments]: Update check phase.
-rw-r--r--gnu/packages/python-web.scm14
1 files changed, 7 insertions, 7 deletions
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 4c5a005629..c78de311ab 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -5,7 +5,7 @@
;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym+a@scratchpost.org>
;;; Copyright © 2013, 2014, 2015, 2016, 2020 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016, 2017, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
;;; Copyright © 2016, 2017, 2020 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
@@ -1749,26 +1749,26 @@ web framework, either via the basic or digest authentication schemes.")
(define-public python-terminado
(package
(name "python-terminado")
- (version "0.8.1")
+ (version "0.9.4")
(source
(origin
(method url-fetch)
(uri (pypi-uri "terminado" version))
(sha256
(base32
- "0yh69k6579g848rmjyllb5h75pkvgcy27r1l3yzgkf33wnnzkasm"))))
+ "1glqyw97rddyzvisz8rihsn3x2nrm5xbyq82nzp3123pqbxvqzcs"))))
(build-system python-build-system)
(propagated-inputs
- `(("python-tornado" ,python-tornado)
+ `(("python-tornado" ,python-tornado-6)
("python-ptyprocess" ,python-ptyprocess)))
(native-inputs
- `(("python-nose" ,python-nose)))
+ `(("python-pytest" ,python-pytest)))
(arguments
`(#:phases
(modify-phases %standard-phases
(replace 'check
- (lambda _ (invoke "nosetests") #t)))))
- (home-page "https://github.com/takluyver/terminado")
+ (lambda _ (invoke "pytest" "-vv"))))))
+ (home-page "https://github.com/jupyter/terminado")
(synopsis "Terminals served to term.js using Tornado websockets")
(description "This package provides a Tornado websocket backend for the
term.js Javascript terminal emulator library.")
%exim-os #:imported-modules '((gnu services herd)))) (port-forwardings '((1025 . 25))))) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (rnrs base) (srfi srfi-64) (ice-9 ftw) (ice-9 rdelim) (ice-9 regex) (gnu build marionette)) (define marionette (make-marionette '(#$vm))) (define (read-reply-code port) "Read a SMTP reply from PORT and return its reply code." (let* ((line (read-line port)) (mo (string-match "([0-9]+)([ -]).*" line)) (code (string->number (match:substring mo 1))) (finished? (string= " " (match:substring mo 2)))) (if finished? code (read-reply-code port)))) (define smtp (socket AF_INET SOCK_STREAM 0)) (define addr (make-socket-address AF_INET INADDR_LOOPBACK 1025)) (test-runner-current (system-test-runner #$output)) (test-begin "exim") (test-assert "service is running" (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'exim)) marionette)) (sleep 1) ;; give the service time to start talking (connect smtp addr) ;; Be greeted. (test-eq "greeting received" 220 (read-reply-code smtp)) ;; Greet the server. (write-line "EHLO somehost" smtp) (test-eq "greeting successful" 250 (read-reply-code smtp)) ;; Set sender email. (write-line "MAIL FROM: test@example.com" smtp) (test-eq "sender set" 250 (read-reply-code smtp)) ;250 ;; Set recipient email. (write-line "RCPT TO: root@komputilo" smtp) (test-eq "recipient set" 250 (read-reply-code smtp)) ;250 ;; Send message. (write-line "DATA" smtp) (test-eq "data begun" 354 (read-reply-code smtp)) ;354 (write-line "Subject: Hello" smtp) (newline smtp) (write-line "Nice to meet you!" smtp) (write-line "." smtp) (test-eq "message sent" 250 (read-reply-code smtp)) ;250 ;; Say goodbye. (write-line "QUIT" smtp) (test-eq "quit successful" 221 (read-reply-code smtp)) ;221 (close smtp) (test-eq "the email is received" 1 (marionette-eval '(begin (use-modules (ice-9 ftw)) (length (scandir "/var/spool/exim/msglog" (lambda (x) (not (string-prefix? "." x)))))) marionette)) (test-end)))) (gexp->derivation "exim-test" test)) (define %test-exim (system-test (name "exim") (description "Send an email to a running an Exim server.") (value (run-exim-test)))) (define %dovecot-os (simple-operating-system (service dhcp-client-service-type) (service dovecot-service-type (dovecot-configuration (disable-plaintext-auth? #f) (ssl? "no") (auth-mechanisms '("anonymous")) (auth-anonymous-username "alice") (mail-location (string-append "maildir:~/Maildir" ":INBOX=~/Maildir/INBOX" ":LAYOUT=fs")))))) (define (run-dovecot-test) "Return a test of an OS running Dovecot service." (define vm (virtual-machine (operating-system (marionette-operating-system %dovecot-os #:imported-modules '((gnu services herd)))) (port-forwardings '((8143 . 143))))) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (gnu build marionette) (ice-9 iconv) (ice-9 rdelim) (rnrs base) (rnrs bytevectors) (srfi srfi-64)) (define marionette (make-marionette '(#$vm))) (define* (message-length message #:key (encoding "iso-8859-1")) (bytevector-length (string->bytevector message encoding))) (define message "From: test@example.com\n\ Subject: Hello Nice to meet you!") (test-runner-current (system-test-runner #$output)) (test-begin "dovecot") ;; Wait for dovecot to be up and running. (test-assert "dovecot running" (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'dovecot)) marionette)) ;; Check Dovecot service's PID. (test-assert "service process id" (let ((pid (number->string (wait-for-file "/var/run/dovecot/master.pid" marionette)))) (marionette-eval `(file-exists? (string-append "/proc/" ,pid)) marionette))) (test-assert "accept an email" (let ((imap (socket AF_INET SOCK_STREAM 0)) (addr (make-socket-address AF_INET INADDR_LOOPBACK 8143))) (connect imap addr) ;; Be greeted. (read-line imap) ;OK ;; Authenticate (write-line "a AUTHENTICATE ANONYMOUS" imap) (read-line imap) ;+ (write-line "c2lyaGM=" imap) (read-line imap) ;OK ;; Create a TESTBOX mailbox (write-line "a CREATE TESTBOX" imap) (read-line imap) ;OK ;; Append a message to a TESTBOX mailbox (write-line (format #f "a APPEND TESTBOX {~a}" (number->string (message-length message))) imap) (read-line imap) ;+ (write-line message imap) (read-line imap) ;OK ;; Logout (write-line "a LOGOUT" imap) (close imap) #t)) (test-equal "mail arrived" message (marionette-eval '(begin (use-modules (ice-9 ftw) (ice-9 match) (rnrs io ports)) (let ((TESTBOX/new "/home/alice/Maildir/TESTBOX/new/")) (match (scandir TESTBOX/new) (("." ".." message-file) (call-with-input-file (string-append TESTBOX/new message-file) get-string-all))))) marionette)) (test-end)))) (gexp->derivation "dovecot-test" test)) (define %test-dovecot (system-test (name "dovecot") (description "Connect to a running Dovecot server.") (value (run-dovecot-test)))) (define %getmail-os (operating-system (inherit (simple-operating-system)) ;; Set a password for the user account; the test needs it. (users (cons (user-account (name "alice") (password (crypt "testpass" "$6$abc")) (comment "Bob's sister") (group "users") (supplementary-groups '("wheel" "audio" "video"))) %base-user-accounts)) (services (cons* (service dhcp-client-service-type) (service dovecot-service-type (dovecot-configuration (disable-plaintext-auth? #f) (ssl? "no") (auth-mechanisms '("anonymous" "plain")) (auth-anonymous-username "alice") (mail-location (string-append "maildir:~/Maildir" ":INBOX=~/Maildir/INBOX" ":LAYOUT=fs")))) (service getmail-service-type (list (getmail-configuration (name 'test) (user "alice") (directory "/var/lib/getmail/alice") (idle '("TESTBOX")) (rcfile (getmail-configuration-file (retriever (getmail-retriever-configuration (type "SimpleIMAPRetriever") (server "localhost") (username "alice") (port 143) (extra-parameters '((password . "testpass") (mailboxes . ("TESTBOX")))))) (destination (getmail-destination-configuration (type "Maildir") (path "/home/alice/TestMaildir/"))) (options (getmail-options-configuration (read-all #f)))))))) %base-services)))) (define (run-getmail-test) "Return a test of an OS running Getmail service." (define vm (virtual-machine (operating-system (marionette-operating-system %getmail-os #:imported-modules '((gnu services herd)))) (port-forwardings '((8143 . 143))))) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (gnu build marionette) (ice-9 iconv) (ice-9 rdelim) (rnrs base) (rnrs bytevectors) (srfi srfi-64)) (define marionette (make-marionette '(#$vm))) (define* (message-length message #:key (encoding "iso-8859-1")) (bytevector-length (string->bytevector message encoding))) (define message "From: test@example.com\n\ Subject: Hello Nice to meet you!") (test-runner-current (system-test-runner #$output)) (test-begin "getmail") ;; Wait for dovecot to be up and running. (test-assert "dovecot running" (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'dovecot)) marionette)) ;; Wait for getmail to be up and running. (test-assert "getmail-test running" (marionette-eval '(let* ((pw (getpw "alice")) (uid (passwd:uid pw)) (gid (passwd:gid pw))) (use-modules (gnu services herd)) (for-each (lambda (dir) (mkdir dir) (chown dir uid gid)) '("/home/alice/TestMaildir" "/home/alice/TestMaildir/cur" "/home/alice/TestMaildir/new" "/home/alice/TestMaildir/tmp" "/home/alice/TestMaildir/TESTBOX" "/home/alice/TestMaildir/TESTBOX/cur" "/home/alice/TestMaildir/TESTBOX/new" "/home/alice/TestMaildir/TESTBOX/tmp")) (start-service 'getmail-test)) marionette)) ;; Check Dovecot service's PID. (test-assert "service process id" (let ((pid (number->string (wait-for-file "/var/run/dovecot/master.pid" marionette)))) (marionette-eval `(file-exists? (string-append "/proc/" ,pid)) marionette))) (test-assert "accept an email" (let ((imap (socket AF_INET SOCK_STREAM 0)) (addr (make-socket-address AF_INET INADDR_LOOPBACK 8143))) (connect imap addr) ;; Be greeted. (read-line imap) ;OK ;; Authenticate (write-line "a AUTHENTICATE ANONYMOUS" imap) (read-line imap) ;+ (write-line "c2lyaGM=" imap) (read-line imap) ;OK ;; Create a TESTBOX mailbox (write-line "a CREATE TESTBOX" imap) (read-line imap) ;OK ;; Append a message to a TESTBOX mailbox (write-line (format #f "a APPEND TESTBOX {~a}" (number->string (message-length message))) imap) (read-line imap) ;+ (write-line message imap) (read-line imap) ;OK ;; Logout (write-line "a LOGOUT" imap) (close imap) #t)) (sleep 1) (test-assert "mail arrived" (string-contains (marionette-eval '(begin (use-modules (ice-9 ftw) (ice-9 match) (rnrs io ports)) (let ((TESTBOX/new "/home/alice/TestMaildir/new/")) (match (scandir TESTBOX/new) (("." ".." message-file) (call-with-input-file (string-append TESTBOX/new message-file) get-string-all))))) marionette) message)) (test-end)))) (gexp->derivation "getmail-test" test)) (define %test-getmail (system-test (name "getmail") (description "Connect to a running Getmail server.") (value (run-getmail-test)))) (define %rspamd-os (simple-operating-system (service rspamd-service-type))) (define (run-rspamd-test) "Return a test of an OS running Rspamd service." (define vm (virtual-machine (marionette-operating-system %rspamd-os #:imported-modules '((gnu services herd))))) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (srfi srfi-64) (gnu build marionette)) (define marionette (make-marionette '(#$vm))) (test-runner-current (system-test-runner #$output)) (test-begin "rspamd") (test-assert "service is running" (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'rspamd)) marionette)) (test-assert "rspamd socket ready" (wait-for-unix-socket "/var/lib/rspamd/rspamd.sock" marionette)) (test-assert "rspamd log file" (wait-for-file "/var/log/rspamd/rspamd.log" marionette)) ;; Check that we can access the web ui (test-equal "http-get" 200 (marionette-eval '(begin (use-modules (web client) (web response)) ;; HEAD returns 500 internal server error, so use GET even though ;; only the headers are relevant (response-code (http-get "http://localhost:11334"))) marionette)) (test-end)))) (gexp->derivation "rspamd-test" test)) (define %test-rspamd (system-test (name "rspamd") (description "Basic rspamd service test.") (value (run-rspamd-test))))