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
3df36101
Commit
3df36101
authored
10 years ago
by
cody burkard
Browse files
Options
Downloads
Patches
Plain Diff
adding sanity check for cluster edition
parent
c265deed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/cluster.py
+2
-2
2 additions, 2 deletions
examples/cluster.py
examples/clusterSanity.py
+22
-0
22 additions, 0 deletions
examples/clusterSanity.py
examples/test/test_clusterSanity.py
+27
-0
27 additions, 0 deletions
examples/test/test_clusterSanity.py
with
51 additions
and
2 deletions
examples/cluster.py
+
2
−
2
View file @
3df36101
...
@@ -129,7 +129,7 @@ def __init__( self, name, server=None, user=None, serverIP=None,
...
@@ -129,7 +129,7 @@ def __init__( self, name, server=None, user=None, serverIP=None,
serverIP
=
self
.
findServerIP
(
server
)
serverIP
=
self
.
findServerIP
(
server
)
self
.
serverIP
=
serverIP
self
.
serverIP
=
serverIP
if
not
user
:
if
not
user
:
user
=
quietRun
(
'
w
ho
am i
'
).
split
()[
0
]
user
=
quietRun
(
'
ec
ho
$SUDO_USER
'
)
self
.
user
=
user
self
.
user
=
user
if
self
.
user
and
self
.
server
:
if
self
.
user
and
self
.
server
:
self
.
dest
=
'
%s@%s
'
%
(
self
.
user
,
self
.
serverIP
)
self
.
dest
=
'
%s@%s
'
%
(
self
.
user
,
self
.
serverIP
)
...
@@ -595,7 +595,7 @@ def __init__( self, *args, **kwargs ):
...
@@ -595,7 +595,7 @@ def __init__( self, *args, **kwargs ):
for
server
in
self
.
servers
}
for
server
in
self
.
servers
}
self
.
user
=
params
.
pop
(
'
user
'
,
None
)
self
.
user
=
params
.
pop
(
'
user
'
,
None
)
if
self
.
servers
and
not
self
.
user
:
if
self
.
servers
and
not
self
.
user
:
self
.
user
=
quietRun
(
'
w
ho
am i
'
).
split
()[
0
]
self
.
user
=
quietRun
(
'
ec
ho
$SUDO_USER
'
)
if
params
.
pop
(
'
precheck
'
):
if
params
.
pop
(
'
precheck
'
):
self
.
precheck
()
self
.
precheck
()
self
.
connections
=
{}
self
.
connections
=
{}
...
...
This diff is collapsed.
Click to expand it.
examples/clusterSanity.py
0 → 100755
+
22
−
0
View file @
3df36101
#!/usr/bin/env python
'''
A sanity check for cluster edition
'''
from
mininet.examples.cluster
import
MininetCluster
from
mininet.log
import
info
,
setLogLevel
from
mininet.examples.clustercli
import
DemoCLI
as
CLI
from
mininet.topo
import
SingleSwitchTopo
def
clusterSanity
():
"
Sanity check for cluster mode
"
topo
=
SingleSwitchTopo
()
net
=
MininetCluster
(
topo
=
topo
)
net
.
start
()
CLI
(
net
)
net
.
stop
()
if
__name__
==
'
__main__
'
:
setLogLevel
(
'
info
'
)
clusterSanity
()
This diff is collapsed.
Click to expand it.
examples/test/test_clusterSanity.py
0 → 100755
+
27
−
0
View file @
3df36101
#!/usr/bin/env python
'''
A simple sanity check test for cluster edition
'''
import
unittest
import
pexpect
class
clusterSanityCheck
(
unittest
.
TestCase
):
prompt
=
'
mininet>
'
def
testClusterPingAll
(
self
):
p
=
pexpect
.
spawn
(
'
python -m mininet.examples.clusterSanity
'
)
p
.
expect
(
self
.
prompt
)
p
.
sendline
(
'
pingall
'
)
p
.
expect
(
'
(\d+)% dropped
'
)
percent
=
int
(
p
.
match
.
group
(
1
)
)
if
p
.
match
else
-
1
self
.
assertEqual
(
percent
,
0
)
p
.
expect
(
self
.
prompt
)
p
.
sendline
(
'
exit
'
)
p
.
wait
()
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