diff options
Diffstat (limited to 'gnu/tests/web.scm')
| -rw-r--r-- | gnu/tests/web.scm | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 08151951fac..4d7a8c59d66 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm | |||
| @@ -54,7 +54,6 @@ | |||
| 54 | %test-varnish | 54 | %test-varnish |
| 55 | %test-php-fpm | 55 | %test-php-fpm |
| 56 | %test-hpcguix-web | 56 | %test-hpcguix-web |
| 57 | %test-tailon | ||
| 58 | %test-anonip | 57 | %test-anonip |
| 59 | %test-patchwork | 58 | %test-patchwork |
| 60 | %test-agate)) | 59 | %test-agate)) |
| @@ -480,76 +479,6 @@ HTTP-PORT, along with php-fpm." | |||
| 480 | (value (run-hpcguix-web-server-test name %hpcguix-web-os)))) | 479 | (value (run-hpcguix-web-server-test name %hpcguix-web-os)))) |
| 481 | 480 | ||
| 482 | 481 | ||
| 483 | (define %tailon-os | ||
| 484 | ;; Operating system under test. | ||
| 485 | (simple-operating-system | ||
| 486 | (service dhcpcd-service-type) | ||
| 487 | (service tailon-service-type | ||
| 488 | (tailon-configuration | ||
| 489 | (config-file | ||
| 490 | (tailon-configuration-file | ||
| 491 | (bind "0.0.0.0:8080"))))))) | ||
| 492 | |||
| 493 | (define* (run-tailon-test #:optional (http-port 8081)) | ||
| 494 | "Run tests in %TAILON-OS, which has tailon running and listening on | ||
| 495 | HTTP-PORT." | ||
| 496 | (define os | ||
| 497 | (marionette-operating-system | ||
| 498 | %tailon-os | ||
| 499 | #:imported-modules '((gnu services herd) | ||
| 500 | (guix combinators)))) | ||
| 501 | |||
| 502 | (define vm | ||
| 503 | (virtual-machine | ||
| 504 | (operating-system os) | ||
| 505 | (port-forwardings `((,http-port . 8080))))) | ||
| 506 | |||
| 507 | (define test | ||
| 508 | (with-imported-modules '((gnu build marionette)) | ||
| 509 | #~(begin | ||
| 510 | (use-modules (srfi srfi-11) (srfi srfi-64) | ||
| 511 | (ice-9 match) | ||
| 512 | (gnu build marionette) | ||
| 513 | (web uri) | ||
| 514 | (web client) | ||
| 515 | (web response)) | ||
| 516 | |||
| 517 | (define marionette | ||
| 518 | ;; Forward the guest's HTTP-PORT, where tailon is listening, to | ||
| 519 | ;; port 8080 in the host. | ||
| 520 | (make-marionette (list #$vm))) | ||
| 521 | |||
| 522 | (test-runner-current (system-test-runner #$output)) | ||
| 523 | (test-begin "tailon") | ||
| 524 | |||
| 525 | (test-assert "service running" | ||
| 526 | (wait-for-tcp-port 8080 marionette)) | ||
| 527 | |||
| 528 | (test-equal "http-get" | ||
| 529 | 200 | ||
| 530 | (#$retry-on-error | ||
| 531 | (lambda () | ||
| 532 | (let-values (((response text) | ||
| 533 | (http-get #$(format | ||
| 534 | #f | ||
| 535 | "http://localhost:~A/" | ||
| 536 | http-port) | ||
| 537 | #:decode-body? #t))) | ||
| 538 | (response-code response))) | ||
| 539 | #:times 10 | ||
| 540 | #:delay 5)) | ||
| 541 | |||
| 542 | (test-end)))) | ||
| 543 | |||
| 544 | (gexp->derivation "tailon-test" test)) | ||
| 545 | |||
| 546 | (define %test-tailon | ||
| 547 | (system-test | ||
| 548 | (name "tailon") | ||
| 549 | (description "Connect to a running Tailon server.") | ||
| 550 | (value (run-tailon-test)))) | ||
| 551 | |||
| 552 | |||
| 553 | ;;; | 482 | ;;; |
| 554 | ;;; Anonip | 483 | ;;; Anonip |
| 555 | ;;; | 484 | ;;; |
