From e037e72538bc5363509635f22542f9d7b28732c5 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Fri, 27 Sep 2019 14:04:45 -0400 Subject: [PATCH] explain the purpose of each of these --- nixos/modules/tests/exercise-storage.py | 8 ++++++++ nixos/modules/tests/get-passes.py | 6 ++++++ nixos/modules/tests/run-client.py | 5 +++++ nixos/modules/tests/run-introducer.py | 5 +++++ 4 files changed, 24 insertions(+) diff --git a/nixos/modules/tests/exercise-storage.py b/nixos/modules/tests/exercise-storage.py index 00f3a2cf..d56232a4 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 23e4c692..ac5cf790 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 4b667da7..a246a737 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 9f032678..7a69bdb8 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 -- GitLab