test.sh 747 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env bash
  2. # test.sh/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
  3. # This copyright was auto-generated on Wed Oct 19 15:33:20 UTC 2022
  4. set -e
  5. # Check to see if we need sudo
  6. case "$(uname -sr)" in
  7. Linux*Microsoft*) ;; # WSL does not need sudo
  8. Linux*)
  9. SUDO=sudo
  10. ;;
  11. *) ;;
  12. esac
  13. # Handle variable expansion in Windows MSYS / Git Bash
  14. export MSYS_NO_PATHCONV=1
  15. pushd ..
  16. echo "Building Docker image..."
  17. $SUDO docker build -t ota-test -f ./test/Dockerfile .
  18. # Get the test Zip
  19. $SUDO docker run --rm --mount type=bind,source=$(pwd)/test,target=/workdir ota-test $@
  20. if [[ $1 != "--help" && $1 != "-h" ]]; then
  21. # Now test the script
  22. ./send_ota.sh -d ./test/UPDATE.zip
  23. fi
  24. popd >/dev/null