test-linux-arm.sh 758 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. if [ $# -lt 1 ]; then
  3. echo "Usage: $0 IP"
  4. echo "Test sharp on ARM using Docker, where IP is"
  5. echo "the address of a Raspberry Pi running HypriotOS"
  6. exit 1
  7. fi
  8. IP="$1"
  9. echo "Verifying connectivity to $IP"
  10. if ! ping -c 1 $IP; then
  11. echo "Could not connect to $IP"
  12. exit 1
  13. fi
  14. if ! type sshpass >/dev/null; then
  15. echo "Please install sshpass"
  16. exit 1
  17. fi
  18. export SSHPASS=hypriot
  19. echo "Copying sharp source to device"
  20. sshpass -e scp -o PreferredAuthentications=password -r ../../sharp pirate@${IP}:/home/pirate/sharp
  21. echo "Compile and test within container"
  22. sshpass -e ssh -o PreferredAuthentications=password -t pirate@${IP} "docker run --rm -v \${PWD}/sharp:/s hypriot/rpi-node:6 sh -c 'cd /s && npm install --unsafe-perm && npm test'"