zgrab2/cleanup_integration_tests.sh

27 lines
659 B
Bash
Raw Normal View History

2017-12-15 22:02:42 +00:00
#!/bin/bash
# Keep cleaning up, even if something fails
set +e
# Clean up after running the integration tests.
# Drop your cleanup script(s) in integration_tests/<protocol>/cleanup(.*).sh
echo "Cleaning up integration tests..."
pushd integration_tests
for mod in $(ls); do
if [ -d "$mod" ]; then
pushd $mod
for cleanup in $(ls cleanup*.sh); do
echo "Cleaning up $mod (integration_tests/$mod/$cleanup)..."
if ! ./$cleanup; then
echo "Warning: cleanup for $mod/$cleanup failed with exit code $?"
fi
done
popd
fi
done
popd
echo "Integration test cleanup finished."