Skip to content
Snippets Groups Projects
Commit 35fb7572 authored by Florian Sesser's avatar Florian Sesser
Browse files

Fix system tests

Write Python with Nix (?).
parent 39897183
No related branches found
No related tags found
3 merge requests!180merge develop into production,!177merge develop into staging,!151Upgrade system test software and port system tests from Perl to Python
Pipeline #967 passed
...@@ -82,11 +82,7 @@ let ...@@ -82,11 +82,7 @@ let
let let
command = builtins.concatStringsSep " " argv; command = builtins.concatStringsSep " " argv;
in in
" "${node}.succeed('set -eo pipefail; ${command} | systemd-cat')";
\$${node}->succeed('set -eo pipefail; ${command} | systemd-cat');
# succeed() is not success but 1 is.
1;
";
pspkgs = import ../../../nixpkgs-ps.nix { }; pspkgs = import ../../../nixpkgs-ps.nix { };
...@@ -199,17 +195,17 @@ in { ...@@ -199,17 +195,17 @@ in {
# doesn't prove it is so but if it fails it's a pretty good indication # doesn't prove it is so but if it fails it's a pretty good indication
# it isn't so. # it isn't so.
storage.wait_for_open_port(22) storage.wait_for_open_port(22)
issuer.succeed("ssh probeuser@storage") ${runOnNode "issuer" (ssh "probeuser" "storage")}
issuer.succeed("ssh root@storage") ${runOnNode "issuer" (ssh "root" "storage")}
issuer.wait_for_open_port(22) issuer.wait_for_open_port(22)
storage.succeed("ssh probeuser@issuer") ${runOnNode "storage" (ssh "probeuser" "issuer")}
storage.succeed("ssh root@issuer") ${runOnNode "storage" (ssh "root" "issuer")}
# Set up a Tahoe-LAFS introducer. # Set up a Tahoe-LAFS introducer.
introducer.copy_from_host('${pemFile}', '/tmp/node.pem') introducer.copy_from_host('${pemFile}', '/tmp/node.pem')
try: try:
introducer.succeed('run-introducer /tmp/node.pem ${toString introducerPort} ${introducerFURL}') ${runOnNode "introducer" [ run-introducer "/tmp/node.pem" (toString introducerPort) introducerFURL ]}
except: except:
code, log = introducer.execute('cat /tmp/stdout /tmp/stderr') code, log = introducer.execute('cat /tmp/stdout /tmp/stderr')
introducer.log(log) introducer.log(log)
...@@ -239,7 +235,7 @@ in { ...@@ -239,7 +235,7 @@ in {
# #
# Storage appears to be working so try to get a client to speak with it. # Storage appears to be working so try to get a client to speak with it.
# #
client.succeed('run-client /tmp/client ${introducerFURL} ${issuerURL}') ${runOnNode "client" [ run-client "/tmp/client" introducerFURL issuerURL ]}
client.wait_for_open_port(3456) client.wait_for_open_port(3456)
# Make sure the fake Stripe API server is ready for requests. # Make sure the fake Stripe API server is ready for requests.
...@@ -252,7 +248,13 @@ in { ...@@ -252,7 +248,13 @@ in {
# Get some ZKAPs from the issuer. # Get some ZKAPs from the issuer.
try: try:
client.succeed('get-passes http://127.0.0.1:3456 /tmp/client/private/api_auth_token ${issuerURL} ${voucher}') ${runOnNode "client" [
get-passes
"http://127.0.0.1:3456"
"/tmp/client/private/api_auth_token"
issuerURL
voucher
]}
except: except:
code, log = client.execute('cat /tmp/stdout /tmp/stderr'); code, log = client.execute('cat /tmp/stdout /tmp/stderr');
client.log(log) client.log(log)
...@@ -265,7 +267,7 @@ in { ...@@ -265,7 +267,7 @@ in {
# The client should be prepped now. Make it try to use some storage. # The client should be prepped now. Make it try to use some storage.
try: try:
client.succeed('exercise-storage /tmp/client') ${runOnNode "client" [ exercise-storage "/tmp/client" ]}
except: except:
code, log = client.execute('cat /tmp/stdout /tmp/stderr') code, log = client.execute('cat /tmp/stdout /tmp/stderr')
client.log(log) client.log(log)
...@@ -276,7 +278,7 @@ in { ...@@ -276,7 +278,7 @@ in {
try: try:
furlfile = '/var/db/tahoe-lafs/storage/private/storage-plugin.privatestorageio-zkapauthz-v1.furl' furlfile = '/var/db/tahoe-lafs/storage/private/storage-plugin.privatestorageio-zkapauthz-v1.furl'
before = storage.execute('cat ' + furlfile) before = storage.execute('cat ' + furlfile)
storage.succeed('systemctl restart tahoe.storage') ${runOnNode "storage" [ "systemctl" "restart" "tahoe.storage" ]}
after = storage.execute('cat ' + furlfile) after = storage.execute('cat ' + furlfile)
if (before != after): if (before != after):
raise Exception('fURL changes after storage node restart') raise Exception('fURL changes after storage node restart')
...@@ -287,7 +289,7 @@ in { ...@@ -287,7 +289,7 @@ in {
# The client should actually still work, too. # The client should actually still work, too.
try: try:
client.succeed('exercise-storage /tmp/client') ${runOnNode "client" [ exercise-storage "/tmp/client" ]}
except: except:
code, log = client.execute('cat /tmp/stdout /tmp/stderr') code, log = client.execute('cat /tmp/stdout /tmp/stderr')
client.log(log) client.log(log)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment