Skip to content

Commit

Permalink
Add sonic-config-engine to test_requires in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jleveque committed Nov 7, 2020
1 parent 9ff7105 commit 6c831c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/sonic-bgpcfgd/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
],
tests_require = [
'pytest',
'pytest-cov'
'pytest-cov',
'sonic-config-engine'
]
)
5 changes: 2 additions & 3 deletions src/sonic-bgpcfgd/tests/test_sonic-cfggen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 6c831c7

Please sign in to comment.