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
2cb6d712
Commit
2cb6d712
authored
Jul 12, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go away
parent
6af18e45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
34 deletions
+2
-34
src/netns/commands.py
src/netns/commands.py
+0
-33
t/test_interfaces.py
t/test_interfaces.py
+2
-1
No files found.
src/netns/commands.py
deleted
100644 → 0
View file @
6af18e45
#!/usr/bin/env python
# vim:ts=4:sw=4:et:ai:sts=4
"""Utility functions to interact with system commands, such as `ip' and
`tc'."""
def
get_interfaces
(
iface
=
None
):
"""Returns a dictionary, indexed by interface number, with link and address
information about each interface contained in another dict.
ret = {
1: {
'name' : 'lo',
'flags' : ['UP', 'LOOPBACK'],
'mtu' : 16436,
'qdisc' : 'noqueue',
'lladdr' : '00:00:00:00:00:00',
'addr' : [ {
'addr' : '127.0.0.1',
'plen' : 8,
'bcast' : None,
'family': 'inet'
}, {
'addr' : '::1',
'plen' : 128,
'family': 'inet6'
} ]
},
}"""
pass
def
get_routes
():
pass
t/test_interfaces.py
View file @
2cb6d712
...
@@ -6,7 +6,7 @@ import netns, test_util
...
@@ -6,7 +6,7 @@ import netns, test_util
import
os
import
os
import
unittest
import
unittest
class
Test
Interface
s
(
unittest
.
TestCase
):
class
Test
Util
s
(
unittest
.
TestCase
):
def
test_utils
(
self
):
def
test_utils
(
self
):
devs
=
get_devs
()
devs
=
get_devs
()
# There should be at least loopback!
# There should be at least loopback!
...
@@ -19,6 +19,7 @@ class TestInterfaces(unittest.TestCase):
...
@@ -19,6 +19,7 @@ class TestInterfaces(unittest.TestCase):
'bcast'
:
None
,
'family'
:
'inet'
'bcast'
:
None
,
'family'
:
'inet'
}
in
devs
[
'lo'
][
'addr'
])
}
in
devs
[
'lo'
][
'addr'
])
class
TestInterfaces
(
unittest
.
TestCase
):
@
test_util
.
skipUnless
(
os
.
getuid
()
==
0
,
"Test requires root privileges"
)
@
test_util
.
skipUnless
(
os
.
getuid
()
==
0
,
"Test requires root privileges"
)
def
test_interface_creation
(
self
):
def
test_interface_creation
(
self
):
node0
=
netns
.
Node
()
node0
=
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