This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-libzt/tests/unit/docker/start.sh

21 lines
793 B
Bash
Raw Normal View History

#!/bin/bash
2016-11-03 17:18:03 -07:00
# Before running this script, run: make unit_tests [COMPILE_FLAGS] to build the necessary docker images
# Runs test sdk and monitor containers based on the images built by the makefile
test_name="docker_demo"
echo 'Starting containers for: ' "$test_name"
touch "$test_name".name
2016-11-03 17:18:03 -07:00
test_container=$(docker run -d -it -v $PWD/tests/results:/opt/results --privileged --device=/dev/net/tun "$test_name":latest)
monitor_container=$(docker run -d -it -v $PWD/tests/results:/opt/results --privileged --device=/dev/net/tun "$test_name"_monitor:latest)
sleep 90
2016-11-03 17:18:03 -07:00
# By this stage, enough time should have passed for all of the unit tests to conclude
RESULTS_DIR=tests/results
./check.sh $RESULTS_DIR/OK.docker_demo.txt
echo $(cat $RESULTS_DIR/OK.docker_demo.txt)
rm -rf *.tmp
rm -rf *.txt