fix jackett test
This commit is contained in:
parent
181a8c1b2d
commit
3ca2f930a9
1 changed files with 7 additions and 2 deletions
|
|
@ -7,6 +7,8 @@ let
|
||||||
shbapp = nodes.server.shb.arr.${appname};
|
shbapp = nodes.server.shb.arr.${appname};
|
||||||
hasSSL = !(isNull shbapp.ssl);
|
hasSSL = !(isNull shbapp.ssl);
|
||||||
fqdn = if hasSSL then "https://${appname}.example.com" else "http://${appname}.example.com";
|
fqdn = if hasSSL then "https://${appname}.example.com" else "http://${appname}.example.com";
|
||||||
|
healthUrl = "/health";
|
||||||
|
loginUrl = "/UI/Login";
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
import json
|
import json
|
||||||
|
|
@ -28,18 +30,21 @@ let
|
||||||
"curl -X GET --fail-with-body --silent --show-error --output /dev/null --location"
|
"curl -X GET --fail-with-body --silent --show-error --output /dev/null --location"
|
||||||
+ " --connect-to ${appname}.example.com:443:server:443"
|
+ " --connect-to ${appname}.example.com:443:server:443"
|
||||||
+ " --connect-to ${appname}.example.com:80:server:80"
|
+ " --connect-to ${appname}.example.com:80:server:80"
|
||||||
|
+ " --cookie-jar /tmp/cookies"
|
||||||
|
# Uncomment for debugging:
|
||||||
|
# + " -v"
|
||||||
+ f" --write-out '{format}'"
|
+ f" --write-out '{format}'"
|
||||||
+ " " + endpoint
|
+ " " + endpoint
|
||||||
))
|
))
|
||||||
|
|
||||||
with subtest("health"):
|
with subtest("health"):
|
||||||
response = curl(client, """{"code":%{response_code}}""", "${fqdn}/health")
|
response = curl(client, """{"code":%{response_code}}""", "${fqdn}${healthUrl}")
|
||||||
|
|
||||||
if response['code'] != 200:
|
if response['code'] != 200:
|
||||||
raise Exception(f"Code is {response['code']}")
|
raise Exception(f"Code is {response['code']}")
|
||||||
|
|
||||||
with subtest("login"):
|
with subtest("login"):
|
||||||
response = curl(client, """{"code":%{response_code}}""", "${fqdn}/UI/Login")
|
response = curl(client, """{"code":%{response_code}}""", "${fqdn}${loginUrl}")
|
||||||
|
|
||||||
if response['code'] != 200:
|
if response['code'] != 200:
|
||||||
raise Exception(f"Code is {response['code']}")
|
raise Exception(f"Code is {response['code']}")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue