From 1afb8b14c415c80611cea5d02acb7bc2af772bb2 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Tue, 13 Aug 2024 16:11:45 +0200 Subject: [PATCH] print curl command in tests --- test/common.nix | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/test/common.nix b/test/common.nix index adccefb..96d9a1d 100644 --- a/test/common.nix +++ b/test/common.nix @@ -47,21 +47,21 @@ def curl(target, format, endpoint, data="", extra=""): data = ' '.join(data.replace("\n", "").split()) extra = ' '.join(extra.replace("\n", "").split()) - c = target.succeed( - "curl --show-error --location" - + " --cookie-jar cookie.txt" - + " --cookie cookie.txt" - + " --connect-to ${fqdn}:443:server:443" - + " --connect-to ${fqdn}:80:server:80" - # Client must be able to resolve talking to auth server - + " --connect-to auth.${domain}:443:server:443" - + (f" --data '{data}'" if data != "" else "") - + (f" --silent --output /dev/null --write-out '{format}'" if format != "" else "") - + (f" {extra}" if extra != "" else "") - + f" {endpoint}" - ) - # print(c) - return json.loads(c) + cmd = ("curl --show-error --location" + + " --cookie-jar cookie.txt" + + " --cookie cookie.txt" + + " --connect-to ${fqdn}:443:server:443" + + " --connect-to ${fqdn}:80:server:80" + # Client must be able to resolve talking to auth server + + " --connect-to auth.${domain}:443:server:443" + + (f" --data '{data}'" if data != "" else "") + + (f" --silent --output /dev/null --write-out '{format}'" if format != "" else "") + + (f" {extra}" if extra != "" else "") + + f" {endpoint}") + print(cmd) + _, r = target.execute(cmd) + # print(r) + return json.loads(r) '' + (if (! redirectSSO) then ''