nixos/tests/syncthing: Use curl --fail
This commit is contained in:
parent
07913f838b
commit
3313487997
|
@ -19,7 +19,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||||
machine.wait_for_open_port(12346)
|
machine.wait_for_open_port(12346)
|
||||||
|
|
||||||
out = machine.succeed(
|
out = machine.succeed(
|
||||||
"curl -sS http://localhost:12346/status | jq -r '.options.\"provided-by\"'"
|
"curl -sSf http://localhost:12346/status | jq -r '.options.\"provided-by\"'"
|
||||||
)
|
)
|
||||||
assert "nixos-test" in out
|
assert "nixos-test" in out
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -25,7 +25,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||||
"xmllint --xpath 'string(configuration/gui/apikey)' %s/config.xml" % confdir
|
"xmllint --xpath 'string(configuration/gui/apikey)' %s/config.xml" % confdir
|
||||||
).strip()
|
).strip()
|
||||||
oldConf = host.succeed(
|
oldConf = host.succeed(
|
||||||
"curl -Ss -H 'X-API-Key: %s' 127.0.0.1:8384/rest/system/config" % APIKey
|
"curl -Ssf -H 'X-API-Key: %s' 127.0.0.1:8384/rest/system/config" % APIKey
|
||||||
)
|
)
|
||||||
conf = json.loads(oldConf)
|
conf = json.loads(oldConf)
|
||||||
conf["devices"].append({"deviceID": deviceID, "id": name})
|
conf["devices"].append({"deviceID": deviceID, "id": name})
|
||||||
|
@ -39,7 +39,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||||
)
|
)
|
||||||
newConf = json.dumps(conf)
|
newConf = json.dumps(conf)
|
||||||
host.succeed(
|
host.succeed(
|
||||||
"curl -Ss -H 'X-API-Key: %s' 127.0.0.1:8384/rest/system/config -d %s"
|
"curl -Ssf -H 'X-API-Key: %s' 127.0.0.1:8384/rest/system/config -d %s"
|
||||||
% (APIKey, shlex.quote(newConf))
|
% (APIKey, shlex.quote(newConf))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue