Commit 2cb6d712 authored by Martín Ferrari's avatar Martín Ferrari

go away

parent 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
...@@ -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 TestInterfaces(unittest.TestCase): class TestUtils(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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment