summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-05-13 18:46:13 +0200
committerLudovic Courtès <ludo@gnu.org>2018-06-09 12:02:28 +0200
commitc423ae89185abab9ca6381a12285b85079367072 (patch)
tree559589723c634ba077fd8424e015ef890b7a0a56 /tests
parentefcb4441f1c2dd6729938ca68f2fdfd6243e24e4 (diff)
downloadpatches-c423ae89185abab9ca6381a12285b85079367072.tar
patches-c423ae89185abab9ca6381a12285b85079367072.tar.gz
packages: Add 'package-patched-vulnerabilities'.
* guix/packages.scm (patch-file-name): New procedure. (%vulnerability-regexp): New variable. (package-patched-vulnerabilities): New procedure. * guix/scripts/lint.scm (patch-file-name): Remove. (check-vulnerabilities): Adjust to use 'package-patched-vulnerabilities'. * tests/packages.scm ("package-patched-vulnerabilities"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/packages.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index f1e7d3119b..65ccb14889 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -959,6 +959,21 @@
((("x" dep))
(eq? dep findutils)))))))))
+(test-equal "package-patched-vulnerabilities"
+ '(("CVE-2015-1234")
+ ("CVE-2016-1234" "CVE-2018-4567")
+ ())
+ (let ((p1 (dummy-package "pi"
+ (source (dummy-origin
+ (patches (list "/a/b/pi-CVE-2015-1234.patch"))))))
+ (p2 (dummy-package "pi"
+ (source (dummy-origin
+ (patches (list
+ "/a/b/pi-CVE-2016-1234-CVE-2018-4567.patch"))))))
+ (p3 (dummy-package "pi" (source (dummy-origin)))))
+ (map package-patched-vulnerabilities
+ (list p1 p2 p3))))
+
(test-eq "fold-packages" hello
(fold-packages (lambda (p r)
(if (string=? (package-name p) "hello")