summaryrefslogtreecommitdiffhomepage
path: root/test/lib/base.py
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-03-08 14:46:16 +0900
committerIWASE Yusuke <iwase.yusuke0@gmail.com>2017-03-17 11:23:35 +0900
commite7a2c8e4a47405b53b81d602dd862fc455ae1abf (patch)
treec41b1bdadf3b2dcc48cbe0f12b4804959fd35aa4 /test/lib/base.py
parentd9d1eb3eea53906e209f8e9b0163cd4408d0c81c (diff)
scenario_test: Support OSPFd in Quagga container
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'test/lib/base.py')
-rw-r--r--test/lib/base.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/lib/base.py b/test/lib/base.py
index b6e77118..18fa487c 100644
--- a/test/lib/base.py
+++ b/test/lib/base.py
@@ -465,3 +465,31 @@ class BGPContainer(Container):
def reload_config(self):
raise Exception('implement reload_config() method')
+
+
+class OSPFContainer(Container):
+ WAIT_FOR_BOOT = 1
+
+ def __init__(self, name, ctn_image_name):
+ self.config_dir = '/'.join((TEST_BASE_DIR, TEST_PREFIX, name))
+ local('if [ -e {0} ]; then rm -rf {0}; fi'.format(self.config_dir))
+ local('mkdir -p {0}'.format(self.config_dir))
+ local('chmod 777 {0}'.format(self.config_dir))
+
+ # Example:
+ # networks = {
+ # '192.168.1.0/24': '0.0.0.0', # <network>: <area>
+ # }
+ self.networks = {}
+ super(OSPFContainer, self).__init__(name, ctn_image_name)
+
+ def __repr__(self):
+ return str({'name': self.name, 'networks': self.networks})
+
+ def run(self):
+ self.create_config()
+ super(OSPFContainer, self).run()
+ return self.WAIT_FOR_BOOT
+
+ def create_config(self):
+ raise NotImplementedError