Build client Docker image
./build.sh -i clientBuild server Docker image for ASIC trident2 target saivs:
./build.sh -i server -a trident2 -t saivsIn case the target Docker image is intended to be built using the private repo that includes some sairedis and/or sai headers extensions the repository credentials should be passed. For example: the sonic-sairedis git-hub URL for the npu/broadcom/BCM56850/saivs/Dockerfile target is changed to: https://${GIT_UNAME}:${GIT_TOKEN}@github.com/private-repo/sonic-sairedis.git
ARG BASE_OS
FROM sc-base:${BASE_OS}
ARG GIT_UNAME
ARG GIT_TOKEN
ENV SC_PLATFORM=broadcom
ENV SC_ASIC=BCM56850
ENV SC_TARGET=saivs
WORKDIR /sai
RUN git clone https://${GIT_UNAME}:${GIT_TOKEN}@github.com/private-repo/sonic-sairedis.git \
&& cd sonic-sairedis \
... # Build the Docker image for ASIC trident2 target saivs from the private repositories: ${GIT_UNAME}:${GIT_TOKEN}
./build.sh -i client -g user_mame user_token
./build.sh -i server -a trident2 -t saivs -g user_mame user_tokenNOTE: The "user_mame" and "user_token" are private repository user name and http token.
Start SAI Challenger client:
./run.sh -i clientStart SAI Challenger server:
./run.sh -i server -a trident2 -t saivsCreate veth links between client and server dockers:
sudo ./veth-create-host.sh sc-server-run sc-client-runWhere: sc-server-run and sc-client-run are docker names of SAI-Challenger server and client respectively. (sc-server-trident2-saivs-run and sc-client-run)
Alternatively, you can run the whole client-server environment on the same host with a single script:
./run_client_server.sh -a trident2 -t saivs start
./run_client_server.sh startAnd then shut it down:
./run_client_server.sh stopRun SAI Challenger testcases:
./exec.sh -i client pytest --testbed=saivs_client_server -v -k "test_l2_basic"NOTE: Ensure that saivs_client_server.json contains the correct IP of the server container. To obtain the container's IP use the following command:
docker inspect -f '{{.NetworkSettings.Networks.bridge.IPAddress}}' sc-server-trident2-saivs-runRun SAI Challenger testcases and generate HTML report:
./exec.sh -i client pytest --testbed=saivs_client_server -v -k "test_l2_basic" --html=report.html --self-contained-htmlNOTE: The option --traffic will be ignored when running on saivs target.
In order to see the syncd log you need to connect to the server:
docker exec -it sc-server-trident2-saivs-run bash
And check /var/log/syslog
To see the input of the redis-server you need to install tcpdump and run it while tests are running:
sudo apt install -y tcpdump
sudo tcpdump port 6379