Skip to content

Commit

Permalink
Fix permission of /tmp to unblock copp test (sonic-net#9756)
Browse files Browse the repository at this point in the history
  • Loading branch information
bingwang-ms authored and mssonicbld committed Sep 15, 2023
1 parent ad96f37 commit a40d7d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/copp/copp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,11 @@ def _install_nano(dut, creds, syncd_docker_name):
http_proxy = creds.get('proxy_env', {}).get('http_proxy', '')
https_proxy = creds.get('proxy_env', {}).get('https_proxy', '')
check_cmd = "docker exec -i {} bash -c 'cat /etc/os-release'".format(syncd_docker_name)

# Change the permission of /tmp to 777 to workaround issue #16034
if "bullseye" in dut.shell(check_cmd)['stdout'].lower():
cmd = '''docker exec -e http_proxy={} -e https_proxy={} {} bash -c " \
rm -rf /var/lib/apt/lists/* \
chmod 777 /tmp \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get update \
&& apt-get install -y python3-pip build-essential libssl-dev libffi-dev \
python3-dev python-setuptools wget cmake python-is-python3 \
Expand All @@ -239,7 +240,8 @@ def _install_nano(dut, creds, syncd_docker_name):
" '''.format(http_proxy, https_proxy, syncd_docker_name)
else:
cmd = '''docker exec -e http_proxy={} -e https_proxy={} {} bash -c " \
rm -rf /var/lib/apt/lists/* \
chmod 777 /tmp \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get update \
&& apt-get install -y python-pip build-essential libssl-dev libffi-dev \
python-dev python-setuptools wget cmake \
Expand Down

0 comments on commit a40d7d0

Please sign in to comment.