mirror of
https://github.com/logos-storage/bittorrent-benchmarks.git
synced 2026-01-03 13:33:07 +00:00
misc: minor refactor, add simple network perf test deploy
This commit is contained in:
parent
e5fa036e98
commit
67ca362ee7
@ -16,7 +16,9 @@ async def test_should_upload_file(codex_node_1_url: str):
|
||||
data = BytesIO()
|
||||
random_data(megabytes(1), data)
|
||||
|
||||
cid = client.upload("test.txt", "application/octet-stream", data)
|
||||
cid = client.upload(
|
||||
"test.txt", "application/octet-stream", BytesIO(data.getvalue())
|
||||
)
|
||||
assert cid is not None
|
||||
|
||||
|
||||
@ -25,14 +27,15 @@ async def test_should_upload_file(codex_node_1_url: str):
|
||||
async def test_should_download_file(codex_node_1_url: str):
|
||||
client = AsyncCodexClientImpl(parse_url(codex_node_1_url))
|
||||
|
||||
buff = BytesIO()
|
||||
random_data(megabytes(1), buff)
|
||||
data = buff.getvalue()
|
||||
data = BytesIO()
|
||||
random_data(megabytes(1), data)
|
||||
|
||||
cid = await client.upload("test.txt", "application/octet-stream", BytesIO(data))
|
||||
cid = await client.upload(
|
||||
"test.txt", "application/octet-stream", BytesIO(data.getvalue())
|
||||
)
|
||||
assert cid is not None
|
||||
|
||||
async with client.download(cid) as content:
|
||||
downloaded = await content.readexactly(megabytes(1))
|
||||
|
||||
assert downloaded == data
|
||||
assert downloaded == data.getvalue()
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
# Ad hoc deployment for measuring network performance semi-manually. You'll have to log
|
||||
# into the iperf3-client pod, fire the test, and look at the results.
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: iperf3-server
|
||||
namespace: codex-benchmarks
|
||||
labels:
|
||||
app: iperf-server
|
||||
spec:
|
||||
nodeSelector:
|
||||
workload-type: "benchmarks"
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- labelSelector:
|
||||
matchExpressions:
|
||||
- key: app
|
||||
operator: In
|
||||
values:
|
||||
- iperf-client
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
containers:
|
||||
- name: iperf3
|
||||
image: networkstatic/iperf3
|
||||
command: ["iperf3", "-s"]
|
||||
ports:
|
||||
- containerPort: 5201
|
||||
restartPolicy: Never
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: iperf3-client
|
||||
namespace: codex-benchmarks
|
||||
labels:
|
||||
app: iperf-client
|
||||
spec:
|
||||
nodeSelector:
|
||||
workload-type: "benchmarks"
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- labelSelector:
|
||||
matchExpressions:
|
||||
- key: app
|
||||
operator: In
|
||||
values:
|
||||
- iperf-server
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
containers:
|
||||
- name: iperf3
|
||||
image: networkstatic/iperf3
|
||||
command: ["sleep", "50000"]
|
||||
restartPolicy: Never
|
||||
Loading…
x
Reference in New Issue
Block a user