mirror of
				https://github.com/Telecominfraproject/ols-nos.git
				synced 2025-11-04 03:57:57 +00:00 
			
		
		
		
	The PDE silicon test harness and platform test harness can be found in src/sonic-platform-pdk-pde
		
			
				
	
	
		
			38 lines
		
	
	
		
			866 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			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 "-----------------------------------------------------------------------"
 |