Skip to content

Commit

Permalink
Workaround python_sai_thrift path issue (#14886)
Browse files Browse the repository at this point in the history
  • Loading branch information
bingwang-ms authored and mssonicbld committed Oct 10, 2024
1 parent 91b45ba commit b07ddc6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_pretest.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,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

0 comments on commit b07ddc6

Please sign in to comment.