summary refs log tree commit diff
path: root/tests/lint.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lint.scm')
-rw-r--r--tests/lint.scm31
1 files changed, 24 insertions, 7 deletions
diff --git a/tests/lint.scm b/tests/lint.scm
index 59be061a99..8a9023a7a3 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com>
 ;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
@@ -619,6 +619,23 @@
          (lint-warning-message second-warning))))))
 
 (test-skip (if (http-server-can-listen?) 0 1))
+(test-equal "source: 404 and 200"
+  '()
+  (with-http-server 404 %long-string
+    (let ((bad-url (%local-url)))
+      (parameterize ((%http-server-port (+ 1 (%http-server-port))))
+        (with-http-server 200 %long-string
+          (let ((pkg (package
+                       (inherit (dummy-package "x"))
+                       (source (origin
+                                 (method url-fetch)
+                                 (uri (list bad-url (%local-url)))
+                                 (sha256 %null-sha256))))))
+            ;; Since one of the two URLs is good, this should return the empty
+            ;; list.
+            (check-source pkg)))))))
+
+(test-skip (if (http-server-can-listen?) 0 1))
 (test-equal "source: 301 -> 200"
   "permanent redirect from http://localhost:10000/foo/bar to http://localhost:9999/foo/bar"
   (with-http-server 200 %long-string
@@ -710,12 +727,12 @@
 
 (test-equal "cve"
   '()
-  (mock ((guix scripts lint) package-vulnerabilities (const '()))
+  (mock ((guix lint) package-vulnerabilities (const '()))
         (check-vulnerabilities (dummy-package "x"))))
 
 (test-equal "cve: one vulnerability"
   "probably vulnerable to CVE-2015-1234"
-  (mock ((guix scripts lint) package-vulnerabilities
+  (mock ((guix lint) package-vulnerabilities
          (lambda (package)
            (list (make-struct (@@ (guix cve) <vulnerability>) 0
                               "CVE-2015-1234"
@@ -726,7 +743,7 @@
 
 (test-equal "cve: one patched vulnerability"
   '()
-  (mock ((guix scripts lint) package-vulnerabilities
+  (mock ((guix lint) package-vulnerabilities
          (lambda (package)
            (list (make-struct (@@ (guix cve) <vulnerability>) 0
                               "CVE-2015-1234"
@@ -742,7 +759,7 @@
 
 (test-equal "cve: known safe from vulnerability"
   '()
-  (mock ((guix scripts lint) package-vulnerabilities
+  (mock ((guix lint) package-vulnerabilities
          (lambda (package)
            (list (make-struct (@@ (guix cve) <vulnerability>) 0
                               "CVE-2015-1234"
@@ -755,7 +772,7 @@
 
 (test-equal "cve: vulnerability fixed in replacement version"
   '()
-  (mock ((guix scripts lint) package-vulnerabilities
+  (mock ((guix lint) package-vulnerabilities
          (lambda (package)
            (match (package-version package)
              ("0"
@@ -772,7 +789,7 @@
 
 (test-equal "cve: patched vulnerability in replacement"
   '()
-  (mock ((guix scripts lint) package-vulnerabilities
+  (mock ((guix lint) package-vulnerabilities
          (lambda (package)
            (list (make-struct (@@ (guix cve) <vulnerability>) 0
                               "CVE-2015-1234"