1
0
Fork 0

print curl command in tests

This commit is contained in:
ibizaman 2024-08-13 16:11:45 +02:00 committed by Pierre Penninckx
parent b466ca4346
commit 4c4b0c2e61

View file

@ -47,8 +47,7 @@
def curl(target, format, endpoint, data="", extra=""): def curl(target, format, endpoint, data="", extra=""):
data = ' '.join(data.replace("\n", "").split()) data = ' '.join(data.replace("\n", "").split())
extra = ' '.join(extra.replace("\n", "").split()) extra = ' '.join(extra.replace("\n", "").split())
c = target.succeed( cmd = ("curl --show-error --location"
"curl --show-error --location"
+ " --cookie-jar cookie.txt" + " --cookie-jar cookie.txt"
+ " --cookie cookie.txt" + " --cookie cookie.txt"
+ " --connect-to ${fqdn}:443:server:443" + " --connect-to ${fqdn}:443:server:443"
@ -58,10 +57,11 @@
+ (f" --data '{data}'" if data != "" else "") + (f" --data '{data}'" if data != "" else "")
+ (f" --silent --output /dev/null --write-out '{format}'" if format != "" else "") + (f" --silent --output /dev/null --write-out '{format}'" if format != "" else "")
+ (f" {extra}" if extra != "" else "") + (f" {extra}" if extra != "" else "")
+ f" {endpoint}" + f" {endpoint}")
) print(cmd)
# print(c) _, r = target.execute(cmd)
return json.loads(c) # print(r)
return json.loads(r)
'' ''
+ (if (! redirectSSO) then '' + (if (! redirectSSO) then ''