Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround python_sai_thrift path issue #14886

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/test_pretest.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,13 @@ def test_update_saithrift_ptf(request, ptfhost):
if result["failed"] or "OK" not in result["msg"]:
pytest.skip("Download failed/error while installing python saithrift package")
ptfhost.shell("dpkg -i {}".format(os.path.join("/root", pkg_name)))
# In 202405 branch, the switch_sai_thrift package is inside saithrift-0.9-py3.11.egg
# We need to move it out to the correct location
PY_PATH = "/usr/lib/python3/dist-packages/"
SRC_PATH = PY_PATH + "saithrift-0.9-py3.11.egg/switch_sai_thrift"
DST_PATH = PY_PATH + "switch_sai_thrift"
if ptfhost.stat(path=SRC_PATH)['stat']['exists'] and not ptfhost.stat(path=DST_PATH)['stat']['exists']:
ptfhost.copy(src=SRC_PATH, dest=DST_PATH, remote_src=True)
logging.info("Python saithrift package installed successfully")


Expand Down
Loading