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
f58fac72
Commit
f58fac72
authored
Jul 28, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ping with 4 nodes!
parent
87679336
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
t/test_core.py
t/test_core.py
+33
-2
No files found.
t/test_core.py
View file @
f58fac72
...
@@ -19,7 +19,7 @@ class TestConfigure(unittest.TestCase):
...
@@ -19,7 +19,7 @@ class TestConfigure(unittest.TestCase):
class
TestGlobal
(
unittest
.
TestCase
):
class
TestGlobal
(
unittest
.
TestCase
):
@
test_util
.
skipUnless
(
os
.
getuid
()
==
0
,
"Test requires root privileges"
)
@
test_util
.
skipUnless
(
os
.
getuid
()
==
0
,
"Test requires root privileges"
)
def
test_run_ping
(
self
):
def
test_run_ping
_p2pif
(
self
):
n1
=
netns
.
Node
()
n1
=
netns
.
Node
()
n2
=
netns
.
Node
()
n2
=
netns
.
Node
()
i1
,
i2
=
netns
.
P2PInterface
.
create_pair
(
n1
,
n2
)
i1
,
i2
=
netns
.
P2PInterface
.
create_pair
(
n1
,
n2
)
...
@@ -45,7 +45,7 @@ class TestGlobal(unittest.TestCase):
...
@@ -45,7 +45,7 @@ class TestGlobal(unittest.TestCase):
self
.
assertEquals
(
a2
.
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_
bridging
(
self
):
def
test_run_ping_
node_if
(
self
):
n1
=
netns
.
Node
()
n1
=
netns
.
Node
()
n2
=
netns
.
Node
()
n2
=
netns
.
Node
()
i1
=
n1
.
add_if
()
i1
=
n1
.
add_if
()
...
@@ -64,5 +64,36 @@ class TestGlobal(unittest.TestCase):
...
@@ -64,5 +64,36 @@ 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
(
self
):
n1
=
netns
.
Node
()
n2
=
netns
.
Node
()
n3
=
netns
.
Node
()
i1
=
n1
.
add_if
()
i2a
=
n2
.
add_if
()
i2b
=
n2
.
add_if
()
i3
=
n3
.
add_if
()
i1
.
up
=
i2a
.
up
=
i2b
.
up
=
i3
.
up
=
True
l1
=
netns
.
Link
()
l2
=
netns
.
Link
()
l1
.
connect
(
i1
)
l1
.
connect
(
i2a
)
l2
.
connect
(
i2b
)
l2
.
connect
(
i3
)
l1
.
up
=
l2
.
up
=
True
i1
.
add_v4_address
(
'10.0.0.1'
,
24
)
i2a
.
add_v4_address
(
'10.0.0.2'
,
24
)
i2b
.
add_v4_address
(
'10.0.1.1'
,
24
)
i3
.
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
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
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