Updates to scanner with CVE saving and auto update
This commit is contained in:
@@ -20,6 +20,22 @@ class ScannerTests(unittest.TestCase):
|
||||
def test_no_package_mutation(self):
|
||||
for command in ('apt upgrade','apt install','dnf update','yum update','apk upgrade','zypper update'):
|
||||
self.assertNotIn(command,self.script)
|
||||
def test_provenance_guard_is_not_hardcoded_false(self):
|
||||
code=(ROOT/'PHPGuard/VulnerabilityService.swift').read_text()
|
||||
self.assertNotIn('let hasUbuntuOrigin = false',code)
|
||||
self.assertIn('VERIFIED_INSTALLED_ORIGIN|ubuntu|',code)
|
||||
# Scanner does not issue an attestation from apt-cache policy alone.
|
||||
self.assertNotIn('VERIFIED_INSTALLED_ORIGIN|ubuntu|',self.script)
|
||||
def test_no_false_secure_claims(self):
|
||||
code=(ROOT/'PHPGuard/VulnerabilityService.swift').read_text()
|
||||
self.assertIn('Unverified',code)
|
||||
def test_icon_assets_are_assigned(self):
|
||||
import json
|
||||
directory=ROOT/'PHPGuard/Assets.xcassets/AppIcon.appiconset'
|
||||
metadata=json.loads((directory/'Contents.json').read_text())
|
||||
assigned={i.get('filename') for i in metadata['images']}
|
||||
unassigned={p.name for p in directory.glob('*.png')}-assigned
|
||||
self.assertFalse(unassigned,unassigned)
|
||||
def test_unknown_vendor_not_verified(self):
|
||||
store=(ROOT/'PHPGuard/AuditStore.swift').read_text()
|
||||
self.assertIn('No vendor advisory adapter for this distribution',store)
|
||||
|
||||
Reference in New Issue
Block a user