From a39f401c3ae0473d75d4f2114ff2fe4bcf55bfbd Mon Sep 17 00:00:00 2001 From: Dmitry Valter Date: Fri, 17 Jan 2025 13:16:24 +0000 Subject: [PATCH] test: put scenario test dockerfile inside the source tree Avoid using directories outside of the Gobgp source tree on the docker context. Otherwise docker uses a parent directory for its context, which causes slow builds and permission issues --- test/lib/fabfile.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/test/lib/fabfile.py b/test/lib/fabfile.py index 660b612ff..5ecbd939f 100644 --- a/test/lib/fabfile.py +++ b/test/lib/fabfile.py @@ -16,15 +16,10 @@ def make_gobgp_ctn(ctx, tag='gobgp', c = CmdBuffer() c << 'FROM {0}'.format(from_image) - c << 'COPY gobgp/gobgpd /go/bin/gobgpd' - c << 'COPY gobgp/gobgp /go/bin/gobgp' + c << 'COPY gobgpd /go/bin/gobgpd' + c << 'COPY gobgp /go/bin/gobgp' - rindex = local_gobgp_path.rindex('gobgp') - if rindex < 0: - raise Exception('{0} seems not gobgp dir'.format(local_gobgp_path)) - - workdir = local_gobgp_path[:rindex] - os.chdir(workdir) + os.chdir(local_gobgp_path) local('echo \'{0}\' > Dockerfile'.format(str(c))) local('docker build -t {0} .'.format(tag)) local('rm Dockerfile')