diff options
Diffstat (limited to 'gnu/tests/web.scm')
| -rw-r--r-- | gnu/tests/web.scm | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 5c8905f62b8..b06cbcec115 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | %test-anonip | 60 | %test-anonip |
| 61 | %test-go-webdav | 61 | %test-go-webdav |
| 62 | %test-patchwork | 62 | %test-patchwork |
| 63 | %test-sogogi | ||
| 63 | %test-agate | 64 | %test-agate |
| 64 | %test-miniflux-admin-string | 65 | %test-miniflux-admin-string |
| 65 | %test-miniflux-admin-file | 66 | %test-miniflux-admin-file |
| @@ -782,6 +783,55 @@ HTTP-PORT." | |||
| 782 | 783 | ||
| 783 | 784 | ||
| 784 | ;;; | 785 | ;;; |
| 786 | ;;; sogogi | ||
| 787 | ;;; | ||
| 788 | |||
| 789 | (define %sogogi-os | ||
| 790 | (simple-operating-system | ||
| 791 | (service dhcpcd-service-type) | ||
| 792 | (simple-service 'make-http-root activation-service-type | ||
| 793 | %make-http-root) | ||
| 794 | (service sogogi-service-type | ||
| 795 | (sogogi-configuration | ||
| 796 | (listen ":8080") | ||
| 797 | (user | ||
| 798 | (list | ||
| 799 | (sogogi-user | ||
| 800 | (name "testuser") | ||
| 801 | (password "testpass")))) | ||
| 802 | (location | ||
| 803 | (list | ||
| 804 | (sogogi-location | ||
| 805 | (path "/") | ||
| 806 | (dir "/srv/http/") | ||
| 807 | (grant '("all ro" "user:testuser rw"))))))))) | ||
| 808 | |||
| 809 | (define %test-sogogi | ||
| 810 | (system-test | ||
| 811 | (name "sogogi") | ||
| 812 | (description "Test that the sogogi can handle HTTP requests.") | ||
| 813 | (value | ||
| 814 | (let ((http-port 8080)) | ||
| 815 | (run-webserver-test name %sogogi-os | ||
| 816 | #:http-port http-port | ||
| 817 | #:extra-tests | ||
| 818 | #~(begin | ||
| 819 | (use-modules (srfi srfi-11) (srfi srfi-64) | ||
| 820 | (gnu build marionette) | ||
| 821 | (web uri) | ||
| 822 | (web client) | ||
| 823 | (web response)) | ||
| 824 | |||
| 825 | (test-equal "unauthenticated delete" | ||
| 826 | 401 | ||
| 827 | (let-values | ||
| 828 | (((response _) | ||
| 829 | (http-delete #$(simple-format | ||
| 830 | #f "http://localhost:~A/index.html" http-port)))) | ||
| 831 | (response-code response))))))))) | ||
| 832 | |||
| 833 | |||
| 834 | ;;; | ||
| 785 | ;;; Agate | 835 | ;;; Agate |
| 786 | ;;; | 836 | ;;; |
| 787 | 837 | ||
