add a --helper command-line option, and a helper-using test

This commit is contained in:
meejah 2019-08-06 18:17:58 -06:00
parent d873a041bf
commit 4feba8d7f9
2 changed files with 32 additions and 0 deletions

View File

@ -312,6 +312,7 @@ def storage_nodes(reactor, temp_dir, introducer, introducer_furl, flog_gatherer,
# start all 5 nodes in parallel
for x in range(5):
name = 'node{}'.format(x)
web_port= 9990 + x
# tub_port = 9900 + x
nodes_d.append(
_create_node(

View File

@ -52,3 +52,34 @@ def test_upload_download(alice):
}
)
assert data == FILE_CONTENTS
def test_put(alice):
"""
use PUT to create a file
"""
import time; time.sleep(10) # XXX wat
FILE_CONTENTS = "added via PUT"
import requests
resp = requests.put(
util.node_url(alice._node_dir, "uri"),
files={
"file": FILE_CONTENTS,
},
)
assert resp.text.strip().startswith("URI:CHK:")
assert resp.text.strip().endswith(":2:4:153")
def test_helper_status(storage_nodes):
"""
successfully GET the /helper_status page
"""
import requests
url = util.node_url(storage_nodes[0]._node_dir, "helper_status")
print("GET {}".format(url))
resp = requests.get(url)
print(resp.text.strip())