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
235415cf
Commit
235415cf
authored
15 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Ran unpep8 on test_nets.py.
parent
019bff82
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mininet/test/test_nets.py
+30
-30
30 additions, 30 deletions
mininet/test/test_nets.py
with
30 additions
and
30 deletions
mininet/test/test_nets.py
+
30
−
30
View file @
235415cf
#!/usr/bin/env python
'''
@package mininet
Test creation and all-pairs ping for each included mininet topo type.
'''
"""
Package: mininet
Test creation and all-pairs ping for each included mininet topo type.
"""
import
unittest
...
...
@@ -11,46 +10,47 @@
from
mininet.topo
import
SingleSwitchTopo
,
LinearTopo
# temporary, until user-space side is tested
SWITCHES
=
{
'
kernel
'
:
KernelSwitch
}
SWITCHES
=
{
'
kernel
'
:
KernelSwitch
}
class
testSingleSwitch
(
unittest
.
TestCase
):
'''
For each datapath type, test ping with single switch topologies.
'''
class
testSingleSwitch
(
unittest
.
TestCase
):
"
For each datapath type, test ping with single switch topologies.
"
def
testMinimal
(
self
):
'''
Ping test with both datapaths on minimal topology
'''
def
testMinimal
(
self
):
"
Ping test with both datapaths on minimal topology
"
init
()
for
switch
in
SWITCHES
.
values
():
controller
_p
arams
=
ControllerParams
(
0x0a000000
,
8
)
# 10.0.0.0/8
mn
=
Mininet
(
SingleSwitchTopo
(),
switch
,
Host
,
Controller
,
controller
_p
arams
)
dropped
=
mn
.
run
(
'
ping
'
)
self
.
assertEqual
(
dropped
,
0
)
def
testSingle5
(
self
):
'''
Ping test with both datapaths on 5-host single-switch topology
'''
controller
P
arams
=
ControllerParams
(
0x0a000000
,
8
)
# 10.0.0.0/8
mn
=
Mininet
(
SingleSwitchTopo
(),
switch
,
Host
,
Controller
,
controller
P
arams
)
dropped
=
mn
.
run
(
'
ping
'
)
self
.
assertEqual
(
dropped
,
0
)
def
testSingle5
(
self
):
"
Ping test with both datapaths on 5-host single-switch topology
"
init
()
for
switch
in
SWITCHES
.
values
():
controller
_p
arams
=
ControllerParams
(
0x0a000000
,
8
)
# 10.0.0.0/8
mn
=
Mininet
(
SingleSwitchTopo
(
k
=
5
),
switch
,
Host
,
Controller
,
controller
_p
arams
)
dropped
=
mn
.
run
(
'
ping
'
)
self
.
assertEqual
(
dropped
,
0
)
controller
P
arams
=
ControllerParams
(
0x0a000000
,
8
)
# 10.0.0.0/8
mn
=
Mininet
(
SingleSwitchTopo
(
k
=
5
),
switch
,
Host
,
Controller
,
controller
P
arams
)
dropped
=
mn
.
run
(
'
ping
'
)
self
.
assertEqual
(
dropped
,
0
)
class
testLinear
(
unittest
.
TestCase
):
'''
For each datapath type, test all-pairs ping with LinearNet.
'''
class
testLinear
(
unittest
.
TestCase
):
"
For each datapath type, test all-pairs ping with LinearNet.
"
def
testLinear5
(
self
):
'''
Ping test with both datapaths on a 5-switch topology
'''
def
testLinear5
(
self
):
"
Ping test with both datapaths on a 5-switch topology
"
init
()
for
switch
in
SWITCHES
.
values
():
controller
_p
arams
=
ControllerParams
(
0x0a000000
,
8
)
# 10.0.0.0/8
mn
=
Mininet
(
LinearTopo
(
k
=
5
),
switch
,
Host
,
Controller
,
controller
_p
arams
)
dropped
=
mn
.
run
(
'
ping
'
)
self
.
assertEqual
(
dropped
,
0
)
controller
P
arams
=
ControllerParams
(
0x0a000000
,
8
)
# 10.0.0.0/8
mn
=
Mininet
(
LinearTopo
(
k
=
5
),
switch
,
Host
,
Controller
,
controller
P
arams
)
dropped
=
mn
.
run
(
'
ping
'
)
self
.
assertEqual
(
dropped
,
0
)
if
__name__
==
'
__main__
'
:
unittest
.
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