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
de652f18
Commit
de652f18
authored
Aug 04, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some test cases for Link
parent
e1e4bd7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
t/test_link.py
t/test_link.py
+37
-0
No files found.
t/test_link.py
0 → 100755
View file @
de652f18
#!/usr/bin/env python
# vim:ts=4:sw=4:et:ai:sts=4
import
os
,
unittest
import
netns
,
test_util
class
TestGlobal
(
unittest
.
TestCase
):
@
test_util
.
skipUnless
(
os
.
getuid
()
==
0
,
"Test requires root privileges"
)
def
test_link
(
self
):
n1
=
netns
.
Node
()
n2
=
netns
.
Node
()
i1
=
n1
.
add_if
()
i2
=
n2
.
add_if
()
l
=
netns
.
Link
()
l
.
connect
(
i1
)
l
.
connect
(
i2
)
l
.
mtu
=
3000
ifdata
=
netns
.
iproute
.
get_if_data
()[
0
]
self
.
assertEquals
(
ifdata
[
l
.
index
].
mtu
,
3000
)
self
.
assertEquals
(
ifdata
[
i1
.
control
.
index
].
mtu
,
3000
,
"MTU propagation"
)
self
.
assertEquals
(
ifdata
[
i2
.
control
.
index
].
mtu
,
3000
,
"MTU propagation"
)
i1
.
mtu
=
i2
.
mtu
=
3000
self
.
assertEquals
(
ifdata
[
l
.
index
].
up
,
False
)
self
.
assertEquals
(
ifdata
[
i1
.
control
.
index
].
up
,
False
,
"UP propagation"
)
self
.
assertEquals
(
ifdata
[
i2
.
control
.
index
].
up
,
False
,
"UP propagation"
)
l
.
up
=
True
ifdata
=
netns
.
iproute
.
get_if_data
()[
0
]
self
.
assertEquals
(
ifdata
[
i1
.
control
.
index
].
up
,
True
,
"UP propagation"
)
self
.
assertEquals
(
ifdata
[
i2
.
control
.
index
].
up
,
True
,
"UP propagation"
)
#bandwidth = 100*1024*1024/8, loss=10, loss_correlation=1,delay=0.001,dup_correlation=0.1);
# FIXME: more cases
if
__name__
==
'__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