From 11343f95d66dd82d304bc239b563e91ae61d8d4d Mon Sep 17 00:00:00 2001 From: Sai Kiran <110003254+opcoder0@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:29:26 +1100 Subject: [PATCH] Build and include tacacs+ for PTF Py3 only image (#20701) 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. --- dockers/docker-ptf/Dockerfile.j2 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index 5148dd1125f1..8dbc1a2ce89e 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -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 \ @@ -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 %} @@ -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.