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
3577a698
Commit
3577a698
authored
11 years ago
by
Brian O'Connor
Browse files
Options
Downloads
Patches
Plain Diff
cleaned up and commented test_tree1024.py and test_treeping64.py
parent
48c49c54
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/test/test_tree1024.py
+4
-14
4 additions, 14 deletions
examples/test/test_tree1024.py
examples/test/test_treeping64.py
+4
-10
4 additions, 10 deletions
examples/test/test_treeping64.py
with
8 additions
and
24 deletions
examples/test/test_tree1024.py
+
4
−
14
View file @
3577a698
#!/usr/bin/env python
"""
TEST
"""
"""
Test for tree1024.py
"""
import
unittest
import
pexpect
#from time import sleep
from
mininet.log
import
setLogLevel
#from mininet.net import Mininet
#from mininet.node import CPULimitedHost
#from mininet.link import TCLink
#from mininet.examples.simpleperf import SingleSwitchTopo
class
testTree1024
(
unittest
.
TestCase
):
"
Test ping with single switch topology (common code).
"
prompt
=
'
mininet>
'
def
testTree1024
(
self
):
"
Run the example and do a simple ping test from h1 to h1024
"
p
=
pexpect
.
spawn
(
'
python -m mininet.examples.tree1024
'
)
p
.
expect
(
self
.
prompt
,
timeout
=
6000
)
# it takes awhile to set up
p
.
sendline
(
'
h1 ping -c 1 h1024
'
)
p
.
expect
(
'
(\d+)% packet loss
'
)
percent
=
int
(
p
.
match
.
group
(
1
)
)
if
p
.
match
else
-
1
#self.assertEqual( percent, 0 )
#p.expect( self.prompt )
#p.sendline( 'iperf' )
#p.expect( "Results: \['\d+ .bits/sec', '\d+ .bits/sec'\]" )
p
.
expect
(
self
.
prompt
)
p
.
sendline
(
'
exit
'
)
p
.
wait
()
self
.
assertEqual
(
percent
,
0
)
if
__name__
==
'
__main__
'
:
setLogLevel
(
'
warning
'
)
unittest
.
main
()
This diff is collapsed.
Click to expand it.
examples/test/test_treeping64.py
+
4
−
10
View file @
3577a698
#!/usr/bin/env python
"""
TEST
"""
"""
Test for treeping64.py
"""
import
unittest
import
pexpect
#from time import sleep
from
mininet.log
import
setLogLevel
#from mininet.net import Mininet
#from mininet.node import CPULimitedHost
#from mininet.link import TCLink
#from mininet.examples.simpleperf import SingleSwitchTopo
class
testTreePing64
(
unittest
.
TestCase
):
"
Test ping with single switch topology (common code).
"
prompt
=
'
mininet>
'
def
testTreePing64
(
self
):
"
Run the example and verify ping results
"
p
=
pexpect
.
spawn
(
'
python -m mininet.examples.treeping64
'
)
p
.
expect
(
'
Tree network ping results:
'
,
timeout
=
6000
)
count
=
0
...
...
@@ -32,5 +27,4 @@ def testTreePing64( self ):
self
.
assertTrue
(
count
>
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