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
042b2515
Commit
042b2515
authored
Nov 21, 2011
by
alina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added routing test with interfaces p2p in test_core.py
parent
4ffeb568
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
test/test_core.py
test/test_core.py
+24
-0
No files found.
test/test_core.py
View file @
042b2515
...
@@ -64,6 +64,30 @@ class TestGlobal(unittest.TestCase):
...
@@ -64,6 +64,30 @@ class TestGlobal(unittest.TestCase):
self
.
assertEquals
(
a1
.
wait
(),
0
)
self
.
assertEquals
(
a1
.
wait
(),
0
)
self
.
assertEquals
(
a2
.
wait
(),
0
)
self
.
assertEquals
(
a2
.
wait
(),
0
)
@
test_util
.
skipUnless
(
os
.
getuid
()
==
0
,
"Test requires root privileges"
)
def
test_run_ping_routing_p2p
(
self
):
n1
=
netns
.
Node
()
n2
=
netns
.
Node
()
n3
=
netns
.
Node
()
i12
,
i21
=
netns
.
P2PInterface
.
create_pair
(
n1
,
n2
)
i23
,
i32
=
netns
.
P2PInterface
.
create_pair
(
n2
,
n3
)
i12
.
up
=
i21
.
up
=
i23
.
up
=
i32
.
up
=
True
i12
.
add_v4_address
(
'10.0.0.1'
,
24
)
i21
.
add_v4_address
(
'10.0.0.2'
,
24
)
i23
.
add_v4_address
(
'10.0.1.1'
,
24
)
i32
.
add_v4_address
(
'10.0.1.2'
,
24
)
n1
.
add_route
(
prefix
=
'10.0.1.0'
,
prefix_len
=
24
,
nexthop
=
'10.0.0.2'
)
n3
.
add_route
(
prefix
=
'10.0.0.0'
,
prefix_len
=
24
,
nexthop
=
'10.0.1.1'
)
null
=
file
(
'/dev/null'
,
'wb'
)
a1
=
n1
.
Popen
([
'ping'
,
'-qc1'
,
'10.0.1.2'
],
stdout
=
null
)
a2
=
n3
.
Popen
([
'ping'
,
'-qc1'
,
'10.0.0.1'
],
stdout
=
null
)
self
.
assertEquals
(
a1
.
wait
(),
0
)
self
.
assertEquals
(
a2
.
wait
(),
0
)
@
test_util
.
skipUnless
(
os
.
getuid
()
==
0
,
"Test requires root privileges"
)
@
test_util
.
skipUnless
(
os
.
getuid
()
==
0
,
"Test requires root privileges"
)
def
test_run_ping_routing
(
self
):
def
test_run_ping_routing
(
self
):
n1
=
netns
.
Node
()
n1
=
netns
.
Node
()
...
...
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