From e7a2c8e4a47405b53b81d602dd862fc455ae1abf Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Wed, 8 Mar 2017 14:46:16 +0900 Subject: scenario_test: Support OSPFd in Quagga container Signed-off-by: IWASE Yusuke --- test/lib/base.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test/lib/base.py') 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', # : + # } + 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 -- cgit v1.2.3