예제 #1
0
def test_manual_http_auth(context):
    """Test the HTTP-01 challenge using manual plugin."""
    with misc.create_http_server(context.http_01_port) as webroot,\
            misc.manual_http_hooks(webroot, context.http_01_port) as scripts:

        certname = context.get_domain()
        context.certbot([
            'certonly',
            '-a',
            'manual',
            '-d',
            certname,
            '--cert-name',
            certname,
            '--manual-auth-hook',
            scripts[0],
            '--manual-cleanup-hook',
            scripts[1],
            '--pre-hook',
            misc.echo('wtf_pre', context.hook_probe),
            '--post-hook',
            misc.echo('wtf_post', context.hook_probe),
            '--renew-hook',
            misc.echo('renew', context.hook_probe),
        ])

    with pytest.raises(AssertionError):
        assert_hook_execution(context.hook_probe, 'renew')
    assert_saved_renew_hook(context.config_dir, certname)
예제 #2
0
def test_manual_http_auth(context):
    """Test the HTTP-01 challenge using manual plugin."""
    with misc.create_http_server(context.http_01_port) as webroot,\
            misc.manual_http_hooks(webroot, context.http_01_port) as scripts:

        certname = context.get_domain()
        context.certbot([
            'certonly', '-a', 'manual', '-d', certname, '--cert-name',
            certname, '--manual-auth-hook', scripts[0],
            '--manual-cleanup-hook', scripts[1], '--pre-hook',
            'echo wtf.pre >> "{0}"'.format(context.hook_probe), '--post-hook',
            'echo wtf.post >> "{0}"'.format(context.hook_probe),
            '--deploy-hook', 'echo deploy >> "{0}"'.format(context.hook_probe)
        ])

    assert_hook_execution(context.hook_probe, 'deploy')
    assert_save_renew_hook(context.config_dir, certname)