From 6c831c76f26532391107c2c29a130225d3b8435b Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Sat, 7 Nov 2020 05:10:24 +0000 Subject: [PATCH] Add sonic-config-engine to test_requires in setup.py --- src/sonic-bgpcfgd/setup.py | 3 ++- src/sonic-bgpcfgd/tests/test_sonic-cfggen.py | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sonic-bgpcfgd/setup.py b/src/sonic-bgpcfgd/setup.py index 5b18bb2ba256..40c24d2222b3 100755 --- a/src/sonic-bgpcfgd/setup.py +++ b/src/sonic-bgpcfgd/setup.py @@ -28,6 +28,7 @@ ], tests_require = [ 'pytest', - 'pytest-cov' + 'pytest-cov', + 'sonic-config-engine' ] ) diff --git a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py index 0d00e51cccbb..f49f0a0a42d8 100644 --- a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py +++ b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py @@ -12,9 +12,8 @@ def run_test(name, template_path, json_path, match_path): template_path = os.path.join(TEMPLATE_PATH, template_path) json_path = os.path.join(DATA_PATH, json_path) - cfggen = os.path.abspath("../sonic-config-engine/sonic-cfggen") - command = ['/usr/bin/python3', cfggen, "-T", TEMPLATE_PATH, "-t", template_path, "-y", json_path] - p = subprocess.Popen(command, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env={"PYTHONPATH": "."}) + command = ['sonic-cfggen', "-T", TEMPLATE_PATH, "-t", template_path, "-y", json_path] + p = subprocess.Popen(command, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = p.communicate() assert p.returncode == 0, "sonic-cfggen for %s test returned %d code. stderr='%s'" % (name, p.returncode, stderr) raw_generated_result = stdout.decode("ascii")