Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.toolbox
Commits
42b51f4b
Commit
42b51f4b
authored
Feb 13, 2023
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos/networkbench: Expose networkbench-ping cli
It's useful to test out packet loss situation.
parent
c68f8faf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
setup.py
setup.py
+1
-0
slapos/networkbench/ping.py
slapos/networkbench/ping.py
+0
-1
slapos/networkbench/pingcli.py
slapos/networkbench/pingcli.py
+18
-0
No files found.
setup.py
View file @
42b51f4b
...
...
@@ -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'
,
]
...
...
slapos/networkbench/ping.py
View file @
42b51f4b
...
...
@@ -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
)
slapos/networkbench/pingcli.py
0 → 100644
View file @
42b51f4b
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment