Commit 42b51f4b authored by Łukasz Nowak's avatar Łukasz Nowak

slapos/networkbench: Expose networkbench-ping cli

It's useful to test out packet loss situation.
parent c68f8faf
......@@ -105,6 +105,7 @@ setup(name=name,
'slapos-kill = slapos.systool:kill',
'zodbpack = slapos.zodbpack:run [zodbpack]',
'networkbench = slapos.networkbench:main',
'networkbench-ping = slapos.networkbench.pingcli:main',
'cachechecker = slapos.cachechecker:web_checker_utility',
'dnsresolver = slapos.dnsresolver:cli',
]
......
......@@ -49,4 +49,3 @@ def ping(host, timeout=10, protocol="4", count=10):
def ping6(host, timeout=10, count=10):
return ping(host, timeout=10, protocol='6', count=count)
import argparse
import sys
from . import ping
def main():
parser = argparse.ArgumentParser(
description="Run network benchmarch.",
)
_ = parser.add_argument
_('-p', '--protocol', default="4", type=str)
_('-t', '--timeout', default=10, type=int)
_('-c', '--count', default=10, type=int)
_('host', type=str)
config = parser.parse_args()
result = ping(config.host, config.timeout, config.protocol, config.count)
print(result)
if result[3] == "failed":
sys.exit(1)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment