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
e6e1260b
Commit
e6e1260b
authored
11 years ago
by
Brian O'Connor
Browse files
Options
Downloads
Patches
Plain Diff
cleaned up and commented test_multiping.py
parent
1d555e72
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
examples/test/test_multiping.py
+9
-9
9 additions, 9 deletions
examples/test/test_multiping.py
with
9 additions
and
9 deletions
examples/test/test_multiping.py
+
9
−
9
View file @
e6e1260b
#!/usr/bin/env python
"""
TEST
"""
"""
Test for multiping.py
"""
import
unittest
import
pexpect
from
collections
import
defaultdict
from
mininet.log
import
setLogLevel
class
testMultiPing
(
unittest
.
TestCase
):
"
Test ping with single switch topology (common code).
"
def
testMultiPing
(
self
):
"""
Verify that each target is pinged at least once, and
that pings to
'
real
'
targets are successful and unknown targets fail
"""
p
=
pexpect
.
spawn
(
'
python -m mininet.examples.multiping
'
)
opts
=
[]
opts
.
append
(
"
Host (h\d+) \(([\d.]+)\) will be pinging ips: ([\d. ]+)
"
)
opts
.
append
(
"
(h\d+): ([\d.]+) -> ([\d.]+) \d packets transmitted, (\d) received
"
)
opts
.
append
(
pexpect
.
EOF
)
opts
=
[
"
Host (h\d+) \(([\d.]+)\) will be pinging ips: ([\d\. ]+)
"
,
"
(h\d+): ([\d.]+) -> ([\d.]+) \d packets transmitted, (\d) received
"
,
pexpect
.
EOF
]
pings
=
defaultdict
(
list
)
while
True
:
index
=
p
.
expect
(
opts
)
...
...
@@ -39,10 +40,9 @@ def testMultiPing( self ):
pass
else
:
break
self
.
assertTrue
(
len
(
pings
)
>
0
)
self
.
assertTrue
(
len
(
pings
)
>
0
)
for
t
in
pings
.
values
():
self
.
assertEqual
(
len
(
t
),
0
)
if
__name__
==
'
__main__
'
:
setLogLevel
(
'
warning
'
)
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