diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gnu-maintenance.scm | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/gnu-maintenance.scm b/tests/gnu-maintenance.scm index 89b0684c253..abe74d799cf 100644 --- a/tests/gnu-maintenance.scm +++ b/tests/gnu-maintenance.scm | |||
| @@ -84,4 +84,66 @@ | |||
| 84 | (equal? (upstream-source-version update) "2") | 84 | (equal? (upstream-source-version update) "2") |
| 85 | (equal? (list expected-new-url) (upstream-source-urls update)))))) | 85 | (equal? (list expected-new-url) (upstream-source-urls update)))))) |
| 86 | 86 | ||
| 87 | (test-assert "latest-html-release, no signature" | ||
| 88 | (with-http-server | ||
| 89 | `((200 "<html xmlns=\"http://www.w3.org/1999/xhtml\"> | ||
| 90 | <head> | ||
| 91 | <title>Releases!</title> | ||
| 92 | </head> | ||
| 93 | <body> | ||
| 94 | <a href=\"bar/foo-1.tar.gz\">version 1</a> | ||
| 95 | <a href=\"bar/foo-2.tar.gz\">version 2</a> | ||
| 96 | </body> | ||
| 97 | </html>")) | ||
| 98 | (let () | ||
| 99 | (define package | ||
| 100 | (dummy-package "foo" | ||
| 101 | (source | ||
| 102 | (dummy-origin | ||
| 103 | (uri (string-append (%local-url) "/foo-1.tar.gz")))) | ||
| 104 | (properties | ||
| 105 | `((release-monitoring-url . ,(%local-url)))))) | ||
| 106 | (define update ((upstream-updater-latest %generic-html-updater) package)) | ||
| 107 | (define expected-new-url | ||
| 108 | (string-append (%local-url) "/foo-2.tar.gz")) | ||
| 109 | (and (pk 'u update) | ||
| 110 | (equal? (upstream-source-version update) "2") | ||
| 111 | (equal? (list expected-new-url) | ||
| 112 | (upstream-source-urls update)) | ||
| 113 | (null? ;; both #false and the empty list are acceptable | ||
| 114 | (or (upstream-source-signature-urls update) '())))))) | ||
| 115 | |||
| 116 | (test-assert "latest-html-release, signature" | ||
| 117 | (with-http-server | ||
| 118 | `((200 "<html xmlns=\"http://www.w3.org/1999/xhtml\"> | ||
| 119 | <head> | ||
| 120 | <title>Signed releases!</title> | ||
| 121 | </head> | ||
| 122 | <body> | ||
| 123 | <a href=\"bar/foo-1.tar.gz\">version 1</a> | ||
| 124 | <a href=\"bar/foo-2.tar.gz\">version 2</a> | ||
| 125 | <a href=\"bar/foo-1.tar.gz.sig\">version 1 signature</a> | ||
| 126 | <a href=\"bar/foo-2.tar.gz.sig\">version 2 signature</a> | ||
| 127 | </body> | ||
| 128 | </html>")) | ||
| 129 | (let () | ||
| 130 | (define package | ||
| 131 | (dummy-package "foo" | ||
| 132 | (source | ||
| 133 | (dummy-origin | ||
| 134 | (uri (string-append (%local-url) "/foo-1.tar.gz")))) | ||
| 135 | (properties | ||
| 136 | `((release-monitoring-url . ,(%local-url)))))) | ||
| 137 | (define update ((upstream-updater-latest %generic-html-updater) package)) | ||
| 138 | (define expected-new-url | ||
| 139 | (string-append (%local-url) "/foo-2.tar.gz")) | ||
| 140 | (define expected-signature-url | ||
| 141 | (string-append (%local-url) "/foo-2.tar.gz.sig")) | ||
| 142 | (and (pk 'u update) | ||
| 143 | (equal? (upstream-source-version update) "2") | ||
| 144 | (equal? (list expected-new-url) | ||
| 145 | (upstream-source-urls update)) | ||
| 146 | (equal? (list expected-signature-url) | ||
| 147 | (upstream-source-signature-urls update)))))) | ||
| 148 | |||
| 87 | (test-end) | 149 | (test-end) |
