Ejemplo n.º 1
0
def test_status(dev_server):
    client = Vault(dev_server.addr, token=dev_server.root_token)

    response = yield from client.status()
    assert response.initialized is True

    response = yield from client.leader()
    assert response.enabled is False
    assert response.is_self is False

    response = yield from client.health()
    assert response.initialized is True
    assert response.sealed is dev_server.sealed
Ejemplo n.º 2
0
def test_init(server):
    client = Vault(server.addr, cert=[server.csr, server.key])
    print(client)

    response = yield from client.status()
    print(response)

    state = yield from client.initialize(secret_shares=5, secret_threshold=3)
    assert hasattr(state, 'root_token')
    assert hasattr(state, 'keys')

    status = yield from client.seal.status()
    assert status.sealed is True
    status = yield from client.seal.unseal(state.keys)
    assert status.sealed is False