mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-07 10:56:49 +00:00
add a --helper command-line option, and a helper-using test
This commit is contained in:
parent
d873a041bf
commit
4feba8d7f9
@ -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(
|
||||
|
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user