test.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. test_name=${PWD##*/}
  2. echo 'Building dockerfiles for test: ' "$test_name"
  3. touch "$test_name".name
  4. # Docker won't allow the inclusion of files outside of the build directory
  5. cp ../../*.conf .
  6. cp ../../zerotier-one zerotier-one
  7. cp ../../zerotier-cli zerotier-cli
  8. cp ../../zerotier-intercept zerotier-intercept
  9. cp ../../libzerotierintercept.so.1.0 libzerotierintercept.so.1.0
  10. cp ../../liblwip.so liblwip.so
  11. cp ../../netcon_identity.public netcon_identity.public
  12. cp ../../netcon_identity.secret netcon_identity.secret
  13. cp ../../monitor_identity.public monitor_identity.public
  14. cp ../../monitor_identity.secret monitor_identity.secret
  15. docker build --tag="$test_name" -f netcon_dockerfile .
  16. docker build --tag="$test_name"_monitor -f monitor_dockerfile .
  17. rm -f zerotier-one
  18. rm -f zerotier-cli
  19. rm -f zerotier-intercept
  20. rm -f libzerotierintercept.so.1.0
  21. rm -f liblwip.so
  22. rm -f netcon_identity.public
  23. rm -f netcon_identity.secret
  24. rm -f monitor_identity.public
  25. rm -f monitor_identity.secret
  26. rm -f *.conf
  27. rm -f *.name
  28. # Start netcon container to be tested
  29. docker run -d -it -v $PWD/../../_results:/opt/results --device=/dev/net/tun "$test_name":latest
  30. docker run -d -it -v $PWD/../../_results:/opt/results --device=/dev/net/tun "$test_name"_monitor:latest
  31. sleep 45s
  32. docker kill $(docker ps -a -q)
  33. rm -rf ../../_results/*.tmp