diff --git a/nixos/modules/tests/exercise-storage.py b/nixos/modules/tests/exercise-storage.py index 00f3a2cf0a7bb8ceeb21d010a9c022e9e79af5dc..d56232a4919e415c3331b7c8fc105016ca260b46 100755 --- a/nixos/modules/tests/exercise-storage.py +++ b/nixos/modules/tests/exercise-storage.py @@ -1,5 +1,11 @@ #!/usr/bin/env python3 +# +# Create a new file via the web interface of a Tahoe-LAFS client node and then +# retrieve the contents of that file. Exit with success if the retrieved +# contents match what was uploaded originally. +# + from sys import argv from os import urandom from subprocess import check_output @@ -23,11 +29,13 @@ def get_api_root(path): with open(path + u"/node.url") as f: return f.read().strip() + def put(api_root, data): response = requests.put(api_root + u"uri", BytesIO(data)) response.raise_for_status() return response.text + def get(api_root, cap): response = requests.get(api_root + u"uri/" + cap, stream=True) response.raise_for_status() diff --git a/nixos/modules/tests/get-passes.py b/nixos/modules/tests/get-passes.py index 23e4c69283485170967b6c3bdb0c3f4d33d8721b..ac5cf790fd95d8ce5295879a04d4c19026bf2dba 100755 --- a/nixos/modules/tests/get-passes.py +++ b/nixos/modules/tests/get-passes.py @@ -1,5 +1,11 @@ #!/usr/bin/env python3 +# +# Get a paid voucher and tell the Tahoe-LAFS client node to redeem it for some +# ZKAPs from an issuer. Exit with success when the Tahoe-LAFS client node +# reports that the voucher has been redeemed. +# + from sys import argv from requests import post, get, put from json import dumps diff --git a/nixos/modules/tests/run-client.py b/nixos/modules/tests/run-client.py index 4b667da71a1cfefbfd59fc14e0547039db9dd893..a246a737232007c95cd364ce5f6566843050a882 100755 --- a/nixos/modules/tests/run-client.py +++ b/nixos/modules/tests/run-client.py @@ -1,5 +1,10 @@ #!/usr/bin/env python3 +# +# Create a PrivateStorage.io-enabled Tahoe-LAFS client node and run it as a +# daemon. Exit with success when we think we've started it. +# + from os import environ from sys import argv from shutil import which diff --git a/nixos/modules/tests/run-introducer.py b/nixos/modules/tests/run-introducer.py index 9f032678aecbad939b4c280a272ab20c0c7c41d9..7a69bdb8240b5dc6b347b960762dd4e2ef0cdde1 100755 --- a/nixos/modules/tests/run-introducer.py +++ b/nixos/modules/tests/run-introducer.py @@ -1,5 +1,10 @@ #!/usr/bin/env python3 +# +# Create a Tahoe-LAFS introducer node and run it as a daemon. Exit with +# success when it is accepting introducer client connections. +# + from sys import argv from os import environ, makedirs, rename from shutil import which