mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-03-17 23:04:22 +01:00
@@ -10,12 +10,6 @@ class VulnerabilitySpec extends Specification {
|
|||||||
VulnerableSoftware(allPreviousVersion = false, "cpe:/a:asd:asd:1.0")
|
VulnerableSoftware(allPreviousVersion = false, "cpe:/a:asd:asd:1.0")
|
||||||
), Seq())
|
), Seq())
|
||||||
|
|
||||||
val nonCpeVuln = Vulnerability("some-vuln", None, CvssRating(None, None, None, None, None, None, None), "descr", Seq(
|
|
||||||
VulnerableSoftware(allPreviousVersion = false, "cpex:/a:ftp:ftp"),
|
|
||||||
VulnerableSoftware(allPreviousVersion = false, "cpex:/a:ssh:ssh:1.0"),
|
|
||||||
VulnerableSoftware(allPreviousVersion = false, "cpex:/a:asd:asd:1.0")
|
|
||||||
), Seq())
|
|
||||||
|
|
||||||
|
|
||||||
def id(name: String) = Identifier(name = name, confidence = Confidence.Highest, url = "", identifierType = "cpe")
|
def id(name: String) = Identifier(name = name, confidence = Confidence.Highest, url = "", identifierType = "cpe")
|
||||||
|
|
||||||
@@ -38,9 +32,6 @@ class VulnerabilitySpec extends Specification {
|
|||||||
"when it matches without version, but it also matches with version and everything matches" >> {
|
"when it matches without version, but it also matches with version and everything matches" >> {
|
||||||
vuln.likelyMatchesOnlyWithoutVersion(Set(id("cpe:/a:ftp:ftp:1.0"), id("cpe:/a:ssh:ssh:1.0"), id("cpe:/a:asd:asd:1.0"))) should beFalse
|
vuln.likelyMatchesOnlyWithoutVersion(Set(id("cpe:/a:ftp:ftp:1.0"), id("cpe:/a:ssh:ssh:1.0"), id("cpe:/a:asd:asd:1.0"))) should beFalse
|
||||||
}
|
}
|
||||||
"for non-CPE identifiers, as they are not supported" >> {
|
|
||||||
nonCpeVuln.likelyMatchesOnlyWithoutVersion(Set(id("cpe:/a:ftp:ftp:1.0"))) should beFalse
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// TODO: Add tests for version matching; They would not pass now, though.
|
// TODO: Add tests for version matching; They would not pass now, though.
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user