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.

35 lines
919 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. # package source contianing test.sh script
  11. PKG_SOURCE=$(sed -ne 's#^Source: .*/\(.*\)$#\1#p' ./control)
  12. echo "Testing package $PKG_NAME in version $PKG_VERSION from $PKG_SOURCE"
  13. opkg install "$PKG"
  14. TEST_SCRIPT=$(find /ci/ -name "$PKG_SOURCE" -type d)/test.sh
  15. if [ -f "$TEST_SCRIPT" ]; then
  16. echo "Use package specific test.sh"
  17. if sh "$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then
  18. echo "Test successfull"
  19. else
  20. echo "Test failed"
  21. exit 1
  22. fi
  23. else
  24. echo "No test.sh script available"
  25. fi
  26. opkg remove "$PKG_NAME" --force-removal-of-dependent-packages --force-remove
  27. done