sonic-buildimage/dockers/docker-pde/base_image_files/pde-bench
賓少鈺 aa59bfeab7
[PDE]: introduce the SONiC Platform Development Env (#7510)
The PDE silicon test harness and platform test harness can be found in
src/sonic-platform-pdk-pde
2021-07-24 16:24:43 -07:00

38 lines
866 B
Bash

#!/bin/bash
CSV=/tmp/bench.csv
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Start PDE if it's deactivated
if [ $(docker ps | grep -c pde) -eq 0 ]; then
pde.sh start
fi
# Allow 5 seconds for PDE to be coming up
for t in $(seq 1 5)
do
if [ $(docker ps | grep -c pde) -gt 0 ]; then
break
fi
sleep 1
done
if [ $(docker ps | grep -c pde) -eq 0 ]; then
echo "docker-pde is not alive, existing ..."
exit 1
fi
# Launch the benchmark test suite
docker exec -it pde /usr/bin/bench.sh
echo "$(docker exec -it pde cat ${CSV})" > ${CSV}
echo ""
echo "CSV Report: ${CSV}"
echo "-----------------------------------------------------------------------"
echo "$(cat ${CSV})"
echo "-----------------------------------------------------------------------"