mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
test:domains: add complex recovery password test
This commit is contained in:
parent
0f109db6ca
commit
ca1e088f29
1 changed files with 26 additions and 0 deletions
|
@ -83,6 +83,32 @@ def test_domain_add_and_remove_dyndns():
|
||||||
domain_remove(TEST_DYNDNS_DOMAIN, dyndns_recovery_password=TEST_DYNDNS_PASSWORD)
|
domain_remove(TEST_DYNDNS_DOMAIN, dyndns_recovery_password=TEST_DYNDNS_PASSWORD)
|
||||||
assert TEST_DYNDNS_DOMAIN not in domain_list()["domains"]
|
assert TEST_DYNDNS_DOMAIN not in domain_list()["domains"]
|
||||||
|
|
||||||
|
|
||||||
|
def test_domain_dyndns_recovery():
|
||||||
|
# time.sleep(35)
|
||||||
|
assert TEST_DYNDNS_DOMAIN not in domain_list()["domains"]
|
||||||
|
# add domain without recovery password
|
||||||
|
domain_add(TEST_DYNDNS_DOMAIN)
|
||||||
|
assert TEST_DYNDNS_DOMAIN in domain_list()["domains"]
|
||||||
|
# set the recovery password with config panel
|
||||||
|
domain_config_set(TEST_DYNDNS_DOMAIN, "dns.registrar.recovery_password", TEST_DYNDNS_PASSWORD)
|
||||||
|
# remove domain without unsubscribing
|
||||||
|
domain_remove(TEST_DYNDNS_DOMAIN, ignore_dyndns=True)
|
||||||
|
assert TEST_DYNDNS_DOMAIN not in domain_list()["domains"]
|
||||||
|
# readding domain with bad password should fail
|
||||||
|
with pytest.raises(YunohostValidationError):
|
||||||
|
domain_add(
|
||||||
|
TEST_DYNDNS_DOMAIN, dyndns_recovery_password="wrong" + TEST_DYNDNS_PASSWORD
|
||||||
|
)
|
||||||
|
assert TEST_DYNDNS_DOMAIN not in domain_list()["domains"]
|
||||||
|
# readding domain with password should work
|
||||||
|
domain_add(TEST_DYNDNS_DOMAIN, dyndns_recovery_password=TEST_DYNDNS_PASSWORD)
|
||||||
|
assert TEST_DYNDNS_DOMAIN in domain_list()["domains"]
|
||||||
|
# remove the dyndns domain
|
||||||
|
domain_remove(TEST_DYNDNS_DOMAIN, dyndns_recovery_password=TEST_DYNDNS_PASSWORD)
|
||||||
|
assert TEST_DYNDNS_DOMAIN not in domain_list()["domains"]
|
||||||
|
|
||||||
|
|
||||||
def test_domain_add_existing_domain():
|
def test_domain_add_existing_domain():
|
||||||
with pytest.raises(MoulinetteError):
|
with pytest.raises(MoulinetteError):
|
||||||
assert TEST_DOMAINS[1] in domain_list()["domains"]
|
assert TEST_DOMAINS[1] in domain_list()["domains"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue