X-Git-Url: https://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/5432734b00ae14c3a93af358fc7bbf80e3db5ee8..f072e9adf58bf751528fc7122bdc71ba8c81e0e7:/tests/lint.scm diff --git a/tests/lint.scm b/tests/lint.scm index 50316ade9a..54be50d1c1 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -1,8 +1,8 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013 Cyril Roelandt ;;; Copyright © 2014, 2015 Eric Bavier -;;; Copyright © 2014, 2015 Ludovic Courtès -;;; Copyright © 2015 Mathieu Lirzin +;;; Copyright © 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2015, 2016 Mathieu Lirzin ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,6 +19,9 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . +;; Avoid interference. +(unsetenv "http_proxy") + (define-module (test-lint) #:use-module (guix tests) #:use-module (guix download) @@ -305,10 +308,7 @@ requests." (with-warnings (let ((pkg (dummy-package "x" (source - (origin - (method url-fetch) - (uri "someurl") - (sha256 "somesha") + (dummy-origin (patches (list "/path/to/y.patch"))))))) (check-patch-file-names pkg))) "file names of patches should start with the package name"))) @@ -319,10 +319,7 @@ requests." (with-warnings (let ((pkg (dummy-package "x" (source - (origin - (method url-fetch) - (uri "someurl") - (sha256 "somesha") + (dummy-origin (patches (list (search-patch "this-patch-does-not-exist!")))))))) (check-patch-file-names pkg))) @@ -529,6 +526,23 @@ requests." (check-vulnerabilities (dummy-package "pi" (version "3.14")))) "vulnerable to CVE-2015-1234"))) +(test-assert "cve: one patched vulnerability" + (mock ((guix scripts lint) package-vulnerabilities + (lambda (package) + (list (make-struct (@@ (guix cve) ) 0 + "CVE-2015-1234" + (list (cons (package-name package) + (package-version package))))))) + (string-null? + (with-warnings + (check-vulnerabilities + (dummy-package "pi" + (version "3.14") + (source + (dummy-origin + (patches + (list "/a/b/pi-CVE-2015-1234.patch")))))))))) + (test-assert "formatting: lonely parentheses" (string-contains (with-warnings