summaryrefslogtreecommitdiffhomepage
path: root/test/lib/gobgp.py
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-03-30 15:18:43 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-04-17 23:05:59 +0900
commit47ab84e34caeb7c89b26271bf84959011bc8ed19 (patch)
tree593380c833af9adbb14e2abf0a27337faf7b77f4 /test/lib/gobgp.py
parent616ae9f2cd960e9e7b49bbceee4a0424806b8ef2 (diff)
test/lib/gobgp: Use local GoBGP executables in contaier
Currently, to reflect the modification of the local source code or to switch the base image for GoBGP container, it is required to re-build the GoBGP container image, and this take a long time to test or debug with the scenario tests. This patch fixes to use the local GoBGP executables (gobgp and gobgpd) in container, and enables to reflect the changes without rebuidling container image. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'test/lib/gobgp.py')
-rw-r--r--test/lib/gobgp.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/lib/gobgp.py b/test/lib/gobgp.py
index 14fbfe1f..0251a807 100644
--- a/test/lib/gobgp.py
+++ b/test/lib/gobgp.py
@@ -47,7 +47,8 @@ def extract_path_attribute(path, typ):
class GoBGPContainer(BGPContainer):
-
+ LOCAL_GOPATH = os.environ['GOPATH']
+ CONTAINER_GOPATH = '/go'
SHARED_VOLUME = '/root/shared_volume'
QUAGGA_VOLUME = '/etc/quagga'
@@ -56,6 +57,11 @@ class GoBGPContainer(BGPContainer):
zapi_version=2, ospfd_config=None):
super(GoBGPContainer, self).__init__(name, asn, router_id,
ctn_image_name)
+ # Add volume to export local GoBGP executables into container.
+ self.shared_volumes.append(
+ (self.LOCAL_GOPATH + '/bin/', self.CONTAINER_GOPATH + '/bin/'))
+
+ # Add volume to export config files into container.
self.shared_volumes.append((self.config_dir, self.SHARED_VOLUME))
self.log_level = log_level