auto_test.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:certbot 作者: nikoloskii 项目源码 文件源码
def test_openssl_failure(self):
        """Make sure we stop if the openssl signature check fails."""
        with ephemeral_dir() as venv_dir:
            # Serve an unrelated hash signed with the good key (easier than
            # making a bad key, and a mismatch is a mismatch):
            resources = {'': '<a href="certbot/">certbot/</a>',
                         'certbot/json': dumps({'releases': {'99.9.9': None}}),
                         'v99.9.9/letsencrypt-auto': build_le_auto(version='99.9.9'),
                         'v99.9.9/letsencrypt-auto.sig': signed('something else')}
            with serving(resources) as base_url:
                copy(LE_AUTO_PATH, venv_dir)
                try:
                    out, err = run_le_auto(venv_dir, base_url)
                except CalledProcessError as exc:
                    eq_(exc.returncode, 1)
                    self.assertIn("Couldn't verify signature of downloaded "
                                  "certbot-auto.",
                                  exc.output)
                else:
                    self.fail('Signature check on certbot-auto erroneously passed.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号