Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nemu3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
nemu3
Commits
8de4982b
Commit
8de4982b
authored
Aug 24, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show process piping
parent
14dd7ce4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
24 deletions
+8
-24
sample.py
sample.py
+8
-24
No files found.
sample.py
View file @
8de4982b
...
@@ -35,28 +35,12 @@ if1a.add_v4_address(address = '10.0.0.2', prefix_len = 24)
...
@@ -35,28 +35,12 @@ if1a.add_v4_address(address = '10.0.0.2', prefix_len = 24)
if1b
.
add_v4_address
(
address
=
'10.0.1.1'
,
prefix_len
=
24
)
if1b
.
add_v4_address
(
address
=
'10.0.1.1'
,
prefix_len
=
24
)
if2
.
add_v4_address
(
address
=
'10.0.1.2'
,
prefix_len
=
24
)
if2
.
add_v4_address
(
address
=
'10.0.1.2'
,
prefix_len
=
24
)
# RFC-4193 Unique local addresses.
# Pre-generated random block: fde2:4a1d:8870::/48
if0
.
add_v6_address
(
address
=
'fde2:4a1d:8870:0::1'
,
prefix_len
=
32
)
if1a
.
add_v6_address
(
address
=
'fde2:4a1d:8870:0::2'
,
prefix_len
=
32
)
if1b
.
add_v6_address
(
address
=
'fde2:4a1d:8870:1::1'
,
prefix_len
=
32
)
if2
.
add_v6_address
(
address
=
'fde2:4a1d:8870:1::2'
,
prefix_len
=
32
)
# Configure routing
# Configure routing
node0
.
add_route
(
prefix
=
'10.0.1.0'
,
prefix_len
=
24
,
node0
.
add_route
(
prefix
=
'10.0.1.0'
,
prefix_len
=
24
,
nexthop
=
'10.0.0.2'
)
nexthop
=
'10.0.0.2'
)
node2
.
add_route
(
prefix
=
'10.0.0.0'
,
prefix_len
=
24
,
node2
.
add_route
(
prefix
=
'10.0.0.0'
,
prefix_len
=
24
,
nexthop
=
'10.0.1.1'
)
nexthop
=
'10.0.1.1'
)
node0
.
add_route
(
prefix
=
'fde2:4a1d:8870:1::'
,
prefix_len
=
32
,
nexthop
=
'fde2:4a1d:8870:0::1'
)
node2
.
add_route
(
prefix
=
'fde2:4a1d:8870:0::'
,
prefix_len
=
32
,
nexthop
=
'fde2:4a1d:8870:1::0'
)
# Test connectivity first. Run process, hide output and check
# Test connectivity first. Run process, hide output and check
# return code
# return code
null
=
file
(
"/dev/null"
,
"w"
)
null
=
file
(
"/dev/null"
,
"w"
)
...
@@ -71,12 +55,12 @@ ret = app1.wait()
...
@@ -71,12 +55,12 @@ ret = app1.wait()
assert
ret
==
0
assert
ret
==
0
print
"Connectivity IPv4 OK!"
print
"Connectivity IPv4 OK!"
# if arguments speficied as array, no need to invoke the shell
# Now test the network conditions
app2
=
node0
.
Popen
([
"ping6"
,
"-c1"
,
"fde2:4a1d:8870:1::2"
])
#, stdout = null)
# When using a args list, the shell is not needed
ret
=
app2
.
wait
()
app2
=
node2
.
Popen
([
"ping"
,
"-c1000000"
,
"-f"
,
"10.0.1.2"
],
#assert ret == 0
stdout
=
subprocess
.
PIPE
)
out
,
err
=
appt2
.
communicate
()
app3
=
node0
.
Popen
([
"ping6"
,
"-c1"
,
"fde2:4a1d:8870:0::1"
],
stdout
=
null
)
print
"Ping outout:"
ret
=
app3
.
wait
()
print
out
#assert ret == 0
print
"Connectivity IPv6 OK!"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment