MCPcopy Create free account
hub / github.com/apache/httpd / test_md_920_002

Method test_md_920_002

test/modules/md/test_920_status.py:60–79  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

58
59 # simple MD, drive it, manipulate staged credentials and check status
60 def test_md_920_002(self, env):
61 domain = self.test_domain
62 domains = [domain]
63 conf = MDConf(env)
64 conf.add_md(domains)
65 conf.add_vhost(domain)
66 conf.install()
67 assert env.apache_restart() == 0, f'{env.apachectl_stderr}'
68 assert env.await_completion([domain], restart=False)
69 # copy a real certificate from LE over to staging
70 staged_cert = os.path.join(env.store_dir, 'staging', domain, 'pubcert.pem')
71 real_cert = os.path.join(env.test_dir, '../modules/md/data', 'test_920', '002.pubcert')
72 assert copyfile(real_cert, staged_cert)
73 status = env.get_certificate_status(domain)
74 # status shows the copied cert's properties as staged
75 assert 'renewal' in status
76 assert 'Thu, 29 Aug 2019 16:06:35 GMT' == status['renewal']['cert']['rsa']['valid']['until']
77 assert 'Fri, 31 May 2019 16:06:35 GMT' == status['renewal']['cert']['rsa']['valid']['from']
78 assert '03039C464D454EDE79FCD2CAE859F668F269' == status['renewal']['cert']['rsa']['serial']
79 assert 'sha256-fingerprint' in status['renewal']['cert']['rsa']
80
81 # test if switching status off has effect
82 def test_md_920_003(self, env):

Callers

nothing calls this directly

Calls 8

add_mdMethod · 0.95
MDConfClass · 0.85
add_vhostMethod · 0.80
installMethod · 0.80
apache_restartMethod · 0.80
await_completionMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected