nixos/tests/croc: fix --pass argument and code passing

This commit is contained in:
Sandro Jäckel 2024-10-09 17:40:39 +02:00
parent fc264c25c2
commit cb097d74cc
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -3,7 +3,7 @@ let
client = { pkgs, ... }: { client = { pkgs, ... }: {
environment.systemPackages = [ pkgs.croc ]; environment.systemPackages = [ pkgs.croc ];
}; };
pass = pkgs.writeText "pass" "PassRelay"; pass = "PassRelay";
in { in {
name = "croc"; name = "croc";
meta = with pkgs.lib.maintainers; { meta = with pkgs.lib.maintainers; {
@ -38,12 +38,12 @@ in {
sender.execute("echo Hello World > testfile01.txt") sender.execute("echo Hello World > testfile01.txt")
sender.execute("echo Hello Earth > testfile02.txt") sender.execute("echo Hello Earth > testfile02.txt")
sender.execute( sender.execute(
"croc --pass ${pass} --relay relay send --code topSecret testfile01.txt testfile02.txt >&2 &" "env CROC_SECRET=topSecret croc --pass ${pass} --relay relay send testfile01.txt testfile02.txt >&2 &"
) )
# receive the testfiles and check them # receive the testfiles and check them
receiver.succeed( receiver.succeed(
"croc --pass ${pass} --yes --relay relay topSecret" "env CROC_SECRET=topSecret croc --pass ${pass} --yes --relay relay"
) )
assert "Hello World" in receiver.succeed("cat testfile01.txt") assert "Hello World" in receiver.succeed("cat testfile01.txt")
assert "Hello Earth" in receiver.succeed("cat testfile02.txt") assert "Hello Earth" in receiver.succeed("cat testfile02.txt")