Skip to content

Commit

Permalink
Build and include tacacs+ for PTF Py3 only image (sonic-net#20701)
Browse files Browse the repository at this point in the history
Why I did it
The "tacacs+" package is not available in the apt repository for Debian Bullseye and beyond. The sonic-mgmt tests require tacacs+ and this PR builds it from source and adds it to the PY3 only image.

Work item tracking
Microsoft ADO (number only): 29946202

How I did it
Clone tacacs+ from https://github.com/robot527/tac_plus build and install it.

How to verify it
By running sonic-mgmt restart-ptf step with newly built image.

Tested branch (Please provide the tested image version)
Not applicable.

Description for the changelog
[docker-ptf]: Build and include tacacs+ for py3only image

The "tacacs+" package is not available in the apt repository for Debian Bullseye and beyond. The sonic-mgmt tests require tacacs+ and this commit builds it from source and adds it to the PY3 only image.
Link to config_db schema for YANG module changes
Not applicable.
  • Loading branch information
opcoder0 authored Dec 10, 2024
1 parent d53d86d commit 11343f9
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions dockers/docker-ptf/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ RUN apt-get update \
libboost-atomic1.71.0 \
{% else %}
libboost-atomic1.74.0 \
flex \
bison \
tcpd \
libwrap0 \
libwrap0-dev \
{% endif %}
less \
git \
Expand All @@ -73,8 +78,6 @@ RUN apt-get update \
python3-scapy \
python3-six \
libpcap-dev \
# TODO check if tacacs+ is required by tests
# tacacs+ has been dropped from bullseye
{% if PTF_ENV_PY_VER == "mixed" %}
tacacs+ \
{% endif %}
Expand Down Expand Up @@ -168,6 +171,16 @@ RUN rm -rf /debs \
&& cd /opt \
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py

{% if PTF_ENV_PY_VER == "py3" %}
RUN git clone https://github.com/facebook/tac_plus \
&& cd tac_plus \
&& cd tacacs-F4.0.4.28 \
&& ./configure \
&& make install \
&& ln -s /usr/local/sbin/tac_plus /usr/sbin/tac_plus \
&& ln -s /usr/local/bin/tac_pwd /usr/sbin/tac_pwd
{% endif %}

{% if PTF_ENV_PY_VER == "mixed" %}
RUN python3 -m venv --system-site-packages env-python3
# Activating a virtualenv. The virtualenv automatically works for RUN, ENV and CMD.
Expand Down

0 comments on commit 11343f9

Please sign in to comment.