From 686ae3f9fc73bb51e5acc38317c36989e4b0c9bc Mon Sep 17 00:00:00 2001 From: Florian Sesser <florian@private.storage> Date: Tue, 8 Feb 2022 22:50:58 +0000 Subject: [PATCH] Fix tests rename sshPrivateKeyFile also in other files --- nixos/tests/private-storage.nix | 2 +- nixos/tests/test_privatestorage.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nixos/tests/private-storage.nix b/nixos/tests/private-storage.nix index 80eb67be..b17b8f32 100644 --- a/nixos/tests/private-storage.nix +++ b/nixos/tests/private-storage.nix @@ -157,7 +157,7 @@ in { testScript = ourpkgs.lib.testing.makeTestScript { testpath = ./test_privatestorage.py; kwargs = { - inherit sshPrivateKey pemFile introducerPort introducerFURL issuerURL ristrettoPublicKey voucher; + inherit sshPrivateKeyFile pemFile introducerPort introducerFURL issuerURL ristrettoPublicKey voucher; # Supply some helper programs to help the tests stay a bit higher level. run_introducer = ./run-introducer.py; diff --git a/nixos/tests/test_privatestorage.py b/nixos/tests/test_privatestorage.py index dc060d51..e1f34fa4 100644 --- a/nixos/tests/test_privatestorage.py +++ b/nixos/tests/test_privatestorage.py @@ -13,20 +13,20 @@ def runOnNode(node, argv): introducer.log(output) raise -def ssh(username, sshPrivateKey, hostname): +def ssh(username, sshPrivateKeyFile, hostname): """ Generate a command which can be used with runOnNode to ssh to the given host. """ return [ - "cp", sshPrivateKey, "/tmp/ssh_key", ";", + "cp", sshPrivateKeyFile, "/tmp/ssh_key", ";", "chmod", "0400", "/tmp/ssh_key", ";", "ssh", "-oStrictHostKeyChecking=no", "-i", "/tmp/ssh_key", "{username}@{hostname}".format(username=username, hostname=hostname), ":", ] def test( - sshPrivateKey, + sshPrivateKeyFile, pemFile, run_introducer, run_client, @@ -60,11 +60,11 @@ def test( # doesn't prove it is so but if it fails it's a pretty good indication # it isn't so. storage.wait_for_open_port(22) - runOnNode(issuer, ssh("probeuser", sshPrivateKey, "storage")) - runOnNode(issuer, ssh("root", sshPrivateKey, "storage")) + runOnNode(issuer, ssh("probeuser", sshPrivateKeyFile, "storage")) + runOnNode(issuer, ssh("root", sshPrivateKeyFile, "storage")) issuer.wait_for_open_port(22) - runOnNode(storage, ssh("probeuser", sshPrivateKey, "issuer")) - runOnNode(storage, ssh("root", sshPrivateKey, "issuer")) + runOnNode(storage, ssh("probeuser", sshPrivateKeyFile, "issuer")) + runOnNode(storage, ssh("root", sshPrivateKeyFile, "issuer")) # Set up a Tahoe-LAFS introducer. introducer.copy_from_host(pemFile, '/tmp/node.pem') -- GitLab