Commit 6129df7d authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

tests/cli: check unverified signature

Add a test where the binary is compatible but the signature is unverified
parent 3b53140e
...@@ -135,6 +135,28 @@ class TestCliCache(CliMixin): ...@@ -135,6 +135,28 @@ class TestCliCache(CliMixin):
'https://lab.nexedi.com/nexedi/slapos/raw/1.0.102/software/slaprunner/software.cfg', 'https://lab.nexedi.com/nexedi/slapos/raw/1.0.102/software/slaprunner/software.cfg',
exc_info=True) exc_info=True)
def test_unverified_signature(self):
with mock.patch(
'slapos.grid.networkcache.machine_info_tuple',
return_value=('x86_64-linux-gnu', ('debian', '8.10', ''))):
self.assertEqual(0, cache_do_lookup(
self.logger,
cache_dir="http://dir.shacache.org",
cache_url="http://shacache.org",
software_url=self.test_url,
signature_certificate_list=""))
self.logger.info.assert_any_call('Software URL: %s',
u'https://lab.nexedi.com/nexedi/slapos/raw/1.0.102/software/slaprunner/software.cfg')
self.logger.info.assert_any_call('MD5: %s', 'cccdc51a07e8c575c880f2d70dd4d458')
self.logger.info.assert_any_call(u'---------------------------------------------------------------------')
self.logger.info.assert_any_call(u' multiarch distribution version id compatible? verified? ')
self.logger.info.assert_any_call(u'---------------------------------------------------------------------')
self.logger.info.assert_any_call(u' x86_64-linux-gnu CentOS Linux 7.5.1804 Core no no ')
self.logger.info.assert_any_call(u' x86_64-linux-gnu Ubuntu 18.04 bionic no no ')
self.logger.info.assert_any_call(u' x86_64-linux-gnu debian 8.10 yes no ')
self.logger.info.assert_any_call(u'---------------------------------------------------------------------')
class TestCliCacheSource(CliMixin): class TestCliCacheSource(CliMixin):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment