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
237a3c54
Commit
237a3c54
authored
12 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Begin test/example for popen().
parent
5ca91f9c
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/popen.py
+30
-0
30 additions, 0 deletions
examples/popen.py
with
30 additions
and
0 deletions
examples/popen.py
0 → 100755
+
30
−
0
View file @
237a3c54
#!/usr/bin/python
"""
This example tests the Host.popen()/pexec() interface
"""
from
mininet.net
import
Mininet
from
mininet.node
import
CPULimitedHost
from
mininet.topo
import
SingleSwitchTopo
from
mininet.log
import
setLogLevel
# from mininet.cli import CLI
from
mininet.util
import
custom
def
testpopen
(
sched
=
'
cfs
'
):
"
Test popen() interface
"
host
=
custom
(
CPULimitedHost
,
cpu
=
.
2
,
sched
=
sched
)
net
=
Mininet
(
SingleSwitchTopo
(
2
),
host
=
host
)
net
.
start
()
h1
=
net
.
get
(
'
h1
'
)
# CLI(net)
out
,
err
,
code
=
h1
.
pexec
(
'
ifconfig
'
)
print
'
stdout:
'
,
out
.
strip
()
print
'
stderr:
'
,
err
.
strip
()
print
'
exit code:
'
,
code
net
.
stop
()
if
__name__
==
'
__main__
'
:
setLogLevel
(
'
info
'
)
testpopen
(
'
rt
'
)
testpopen
(
'
cfs
'
)
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