Skip to content

Latest commit

 

History

History
101 lines (78 loc) · 2.86 KB

File metadata and controls

101 lines (78 loc) · 2.86 KB

Running SAI Challenger in client-server mode

Prepare docker images

Build client Docker image

./build.sh -i client

Build server Docker image for ASIC trident2 target saivs:

./build.sh -i server -a trident2 -t saivs

In 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_token

NOTE: The "user_mame" and "user_token" are private repository user name and http token.

Start docker environment

Start SAI Challenger client:

./run.sh -i client

Start SAI Challenger server:

./run.sh -i server -a trident2 -t saivs

Create veth links between client and server dockers:

sudo ./veth-create-host.sh sc-server-run sc-client-run

Where: 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 start

And then shut it down:

./run_client_server.sh stop

Execute test cases

Run 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-run

Run 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-html

NOTE: 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