Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olaf Bergmann
mininet
Commits
461751e5
Commit
461751e5
authored
10 years ago
by
Bob Lantz
Browse files
Options
Downloads
Plain Diff
Merge branch 'cdburkard-patches/linear_bw'
parents
c8607467
762479c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/linearbandwidth.py
+10
-1
10 additions, 1 deletion
examples/linearbandwidth.py
examples/test/test_linearbandwidth.py
+5
-3
5 additions, 3 deletions
examples/test/test_linearbandwidth.py
with
15 additions
and
4 deletions
examples/linearbandwidth.py
+
10
−
1
View file @
461751e5
...
...
@@ -28,6 +28,8 @@
from
mininet.topo
import
Topo
from
mininet.log
import
lg
from
mininet.util
import
irange
from
mininet.link
import
TCLink
from
functools
import
partial
import
sys
flush
=
sys
.
stdout
.
flush
...
...
@@ -70,13 +72,20 @@ def linearBandwidthTest( lengths ):
switches
=
{
'
reference user
'
:
UserSwitch
,
'
Open vSwitch kernel
'
:
OVSKernelSwitch
}
# UserSwitch is horribly slow with recent kernels.
# We can reinstate it once its performance is fixed
del
switches
[
'
reference user
'
]
topo
=
LinearTestTopo
(
hostCount
)
for
datapath
in
switches
.
keys
():
print
"
*** testing
"
,
datapath
,
"
datapath
"
Switch
=
switches
[
datapath
]
results
[
datapath
]
=
[]
net
=
Mininet
(
topo
=
topo
,
switch
=
Switch
,
controller
=
Controller
,
waitConnected
=
True
)
link
=
partial
(
TCLink
,
delay
=
'
1ms
'
)
net
=
Mininet
(
topo
=
topo
,
switch
=
Switch
,
controller
=
Controller
,
waitConnected
=
True
,
link
=
link
)
net
.
start
()
print
"
*** testing basic connectivity
"
for
n
in
lengths
:
...
...
This diff is collapsed.
Click to expand it.
examples/test/test_linearbandwidth.py
+
5
−
3
View file @
461751e5
...
...
@@ -21,7 +21,6 @@ def testLinearBandwidth( self ):
while
True
:
index
=
p
.
expect
(
opts
,
timeout
=
600
)
if
index
==
0
:
previous_bw
=
10
**
10
# 10 Gbits
count
+=
1
elif
index
==
1
:
n
=
int
(
p
.
match
.
group
(
1
)
)
...
...
@@ -32,12 +31,15 @@ def testLinearBandwidth( self ):
elif
unit
[
0
]
==
'
M
'
:
bw
*=
10
**
6
elif
unit
[
0
]
==
'
G
'
:
bw
*=
10
**
9
self
.
assertTrue
(
bw
<
previous_bw
)
bw
*=
10
**
9
a
# check that we have a previous result to compare to
if
n
!=
1
:
self
.
assertTrue
(
bw
<
previous_bw
)
previous_bw
=
bw
else
:
break
# verify that we received results from at least one switch
self
.
assertTrue
(
count
>
0
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment