Пример #1
0
 def test_generate_certificate_if_needed_does_nothing_if_valid(self):
     maas_certificates.generate_certificate_if_needed()
     old_hash = maas_certificates.get_certificate_fingerprint()
     self.assertFalse(maas_certificates.generate_certificate_if_needed())
     new_hash = maas_certificates.get_certificate_fingerprint()
     self.assertEqual(old_hash, new_hash)
Пример #2
0
 def test_generate_certificate_if_needed_regenerates_if_after(self):
     maas_certificates.generate_certificate_if_needed(not_after=-1)
     old_hash = maas_certificates.get_certificate_fingerprint()
     self.assertTrue(maas_certificates.generate_certificate_if_needed())
     new_hash = maas_certificates.get_certificate_fingerprint()
     self.assertNotEquals(old_hash, new_hash)