87: add tests for custom vhosts
Signed-off-by: n4chung <n4chung@csclub.uwaterloo.ca>
This commit is contained in:
parent
3331e1e3ef
commit
1505b07600
|
@ -124,6 +124,24 @@ def test_cloud_vhosts(cfg, client, new_user, ldap_conn):
|
|||
principal=uid)
|
||||
assert status == 400
|
||||
|
||||
# invalid custom domain name (with TXT record)
|
||||
custom_domain = "uwaterloo.ca"
|
||||
ip2 = ip1
|
||||
status, _ = client.put(
|
||||
f'/api/cloud/vhosts/{custom_domain}', json={'ip_address': ip2},
|
||||
principal=uid)
|
||||
assert status == 400
|
||||
|
||||
# invalid custom domain name (without TXT record)
|
||||
custom_domain2 = "google.com"
|
||||
ip2 = ip1
|
||||
status, _ = client.put(
|
||||
f'/api/cloud/vhosts/{custom_domain2}', json={'ip_address': ip2},
|
||||
principal=uid)
|
||||
assert status == 400
|
||||
|
||||
# TODO: valid custom domain name
|
||||
|
||||
# invalid IP address
|
||||
domain3 = domain1
|
||||
ip3 = '129.97.134.10'
|
||||
|
|
Loading…
Reference in New Issue