You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
784 B

  1. #!/bin/sh
  2. mkdir -p /var/lock/
  3. opkg update
  4. for PKG in /ci/*.ipk; do
  5. tar -xzOf "$PKG" ./control.tar.gz | tar xzf - ./control
  6. # package name including variant
  7. PKG_NAME=$(sed -ne 's#^Package: \(.*\)$#\1#p' ./control)
  8. # package version without release
  9. PKG_VERSION=$(sed -ne 's#^Version: \(.*\)-[0-9]*$#\1#p' ./control)
  10. echo "Testing package $PKG_NAME ($PKG_VERSION)"
  11. opkg install "$PKG"
  12. TEST_SCRIPT=$(find /ci/ -name "$PKG_NAME" -type d)/test.sh
  13. if [ -f "$TEST_SCRIPT" ]; then
  14. echo "Use package specific test.sh"
  15. if sh "$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then
  16. echo "Test successfull"
  17. else
  18. echo "Test failed"
  19. exit 1
  20. fi
  21. else
  22. echo "No test.sh script available"
  23. fi
  24. opkg remove "$PKG_NAME" --force-removal-of-dependent-packages --force-remove
  25. done