Unverified Commit cb097d74 authored by Sandro Jäckel's avatar Sandro Jäckel
Browse files

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

parent fc264c25
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ let
  client = { pkgs, ... }: {
    environment.systemPackages = [ pkgs.croc ];
  };
  pass = pkgs.writeText "pass" "PassRelay";
  pass = "PassRelay";
in {
  name = "croc";
  meta = with pkgs.lib.maintainers; {
@@ -38,12 +38,12 @@ in {
    sender.execute("echo Hello World > testfile01.txt")
    sender.execute("echo Hello Earth > testfile02.txt")
    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
    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 Earth" in receiver.succeed("cat testfile02.txt")