Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
d4ad4314
Unverified
Commit
d4ad4314
authored
Jan 21, 2025
by
Jakob Görgen
Browse files
symphony/orchestration: added Iperf Tcp + Udp client + server
parent
f9943b68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
0 deletions
+86
-0
symphony/orchestration/simbricks/orchestration/system/host/app.py
.../orchestration/simbricks/orchestration/system/host/app.py
+86
-0
No files found.
symphony/orchestration/simbricks/orchestration/system/host/app.py
View file @
d4ad4314
...
@@ -213,3 +213,89 @@ class NetperfClient(BaseLinuxApplication):
...
@@ -213,3 +213,89 @@ class NetperfClient(BaseLinuxApplication):
instance
.
duration_tp
=
int
(
utils_base
.
get_json_attr_top
(
json_obj
,
"duration_tp"
))
instance
.
duration_tp
=
int
(
utils_base
.
get_json_attr_top
(
json_obj
,
"duration_tp"
))
instance
.
duration_lat
=
int
(
utils_base
.
get_json_attr_top
(
json_obj
,
"duration_lat"
))
instance
.
duration_lat
=
int
(
utils_base
.
get_json_attr_top
(
json_obj
,
"duration_lat"
))
return
instance
return
instance
class
IperfTCPServer
(
BaseLinuxApplication
):
def
__init__
(
self
,
h
:
sys_host
.
LinuxHost
)
->
None
:
super
().
__init__
(
h
)
def
run_cmds
(
self
,
inst
:
inst_base
.
Instantiation
)
->
list
[
str
]:
return
[
"iperf -s -l 32M -w 32M"
]
def
toJSON
(
self
)
->
dict
:
json_obj
=
super
().
toJSON
()
return
json_obj
@
classmethod
def
fromJSON
(
cls
,
system
:
sys_base
.
System
,
json_obj
:
dict
)
->
NetperfServer
:
return
super
().
fromJSON
(
system
,
json_obj
)
class
IperfUDPServer
(
BaseLinuxApplication
):
def
__init__
(
self
,
h
:
sys_host
.
LinuxHost
)
->
None
:
super
().
__init__
(
h
)
def
run_cmds
(
self
,
inst
:
inst_base
.
Instantiation
)
->
list
[
str
]:
return
[
"iperf -s -u"
]
def
toJSON
(
self
)
->
dict
:
json_obj
=
super
().
toJSON
()
return
json_obj
@
classmethod
def
fromJSON
(
cls
,
system
:
sys_base
.
System
,
json_obj
:
dict
)
->
NetperfServer
:
return
super
().
fromJSON
(
system
,
json_obj
)
class
IperfTCPClient
(
BaseLinuxApplication
):
def
__init__
(
self
,
h
:
sys_host
.
LinuxHost
,
server_ip
:
str
=
"10.0.0.1"
,
procs
:
int
=
1
)
->
None
:
super
().
__init__
(
h
)
self
.
server_ip
:
str
=
server_ip
self
.
procs
:
int
=
procs
def
run_cmds
(
self
,
inst
:
inst_base
.
Instantiation
)
->
list
[
str
]:
cmds
=
[
f
"iperf -l 32M -w 32M -c
{
self
.
server_ip
}
-i 1 -P
{
self
.
procs
}
"
]
return
cmds
def
toJSON
(
self
)
->
dict
:
json_obj
=
super
().
toJSON
()
json_obj
[
"server_ip"
]
=
self
.
server_ip
json_obj
[
"procs"
]
=
self
.
procs
return
json_obj
@
classmethod
def
fromJSON
(
cls
,
system
:
sys_base
.
System
,
json_obj
:
dict
)
->
NetperfServer
:
instance
=
super
().
fromJSON
(
system
,
json_obj
)
instance
.
server_ip
=
utils_base
.
get_json_attr_top
(
json_obj
,
"server_ip"
)
instance
.
procs
=
utils_base
.
get_json_attr_top
(
json_obj
,
"procs"
)
return
instance
class
IperfUDPClient
(
BaseLinuxApplication
):
def
__init__
(
self
,
h
:
sys_host
.
LinuxHost
,
server_ip
:
str
=
"10.0.0.1"
,
rate
:
str
=
"150m"
)
->
None
:
super
().
__init__
(
h
)
self
.
server_ip
:
str
=
server_ip
self
.
rate
:
str
=
rate
def
run_cmds
(
self
,
inst
:
inst_base
.
Instantiation
)
->
list
[
str
]:
cmds
=
[
f
"iperf -c
{
self
.
server_ip
}
-i 1 -u -b
{
self
.
rate
}
"
]
return
cmds
def
toJSON
(
self
)
->
dict
:
json_obj
=
super
().
toJSON
()
json_obj
[
"server_ip"
]
=
self
.
server_ip
json_obj
[
"rate"
]
=
self
.
rate
return
json_obj
@
classmethod
def
fromJSON
(
cls
,
system
:
sys_base
.
System
,
json_obj
:
dict
)
->
NetperfServer
:
instance
=
super
().
fromJSON
(
system
,
json_obj
)
instance
.
server_ip
=
utils_base
.
get_json_attr_top
(
json_obj
,
"server_ip"
)
instance
.
rate
=
utils_base
.
get_json_attr_top
(
json_obj
,
"rate"
)
return
instance
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