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
e3ab3fc2
Commit
e3ab3fc2
authored
10 years ago
by
cody burkard
Browse files
Options
Downloads
Patches
Plain Diff
fix a few small issues with walkthrough tests
parent
098bede0
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_walkthrough.py
+15
-5
15 additions, 5 deletions
mininet/test/test_walkthrough.py
with
15 additions
and
5 deletions
mininet/test/test_walkthrough.py
+
15
−
5
View file @
e3ab3fc2
...
...
@@ -9,6 +9,7 @@
import
unittest
import
pexpect
import
os
import
re
from
mininet.util
import
quietRun
class
testWalkthrough
(
unittest
.
TestCase
):
...
...
@@ -25,7 +26,10 @@ def testHelp( self ):
def
testWireshark
(
self
):
"
Use tshark to test the of dissector
"
tshark
=
pexpect
.
spawn
(
'
tshark -i lo -R of
'
)
tshark
.
expect
(
'
Capturing on lo
'
)
if
ubuntuVersion
()
==
'
12.04
'
:
tshark
.
expect
(
'
Capturing on lo
'
)
else
:
tshark
.
expect
(
"
Capturing on
'
Loopback
'"
)
mn
=
pexpect
.
spawn
(
'
mn --test pingall
'
)
mn
.
expect
(
'
0% dropped
'
)
tshark
.
expect
(
'
OFP 74 Hello
'
)
...
...
@@ -101,11 +105,11 @@ def testHostCommands( self ):
break
self
.
assertEqual
(
ifcount
,
3
,
'
Missing interfaces on s1
'
)
# h1 ps
p
.
sendline
(
'
h1 ps -a
'
)
p
.
sendline
(
"
h1 ps -a
| egrep -v
'
ps|grep
'"
)
p
.
expect
(
self
.
prompt
)
h1Output
=
p
.
before
# s1 ps
p
.
sendline
(
'
s1 ps -a
'
)
p
.
sendline
(
"
s1 ps -a
| egrep -v
'
ps|grep
'"
)
p
.
expect
(
self
.
prompt
)
s1Output
=
p
.
before
# strip command from ps output
...
...
@@ -208,7 +212,7 @@ def testVerbosity( self ):
p
=
pexpect
.
spawn
(
'
mn -v debug --test none
'
)
p
.
expect
(
pexpect
.
EOF
)
lines
=
p
.
before
.
split
(
'
\n
'
)
self
.
assertTrue
(
len
(
lines
)
>
10
0
,
"
Debug output is too short
"
)
self
.
assertTrue
(
len
(
lines
)
>
7
0
,
"
Debug output is too short
"
)
def
testCustomTopo
(
self
):
"
Start Mininet using a custom topo, then run pingall
"
...
...
@@ -327,5 +331,11 @@ def testRemoteController( self ):
pox
.
sendintr
()
pox
.
wait
()
def
ubuntuVersion
():
releaseStr
=
quietRun
(
'
cat /etc/lsb-release
'
)
versionStr
=
re
.
findall
(
'
DISTRIB_RELEASE=\d+.\d+
'
,
releaseStr
)[
0
]
version
=
versionStr
.
split
(
'
=
'
)[
1
]
return
version
if
__name__
==
'
__main__
'
:
unittest
.
main
()
\ No newline at end of file
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