zgrab2/integration_tests/setup.sh
Andrew Sardone f45ab312bb
Move all test scripts into integration_tests/ directory
This is just a very minor directory organization change, but it has the
advantage of keeping a bunch of files out of the root directory and
packaging them together since they are related to each other.

Now, our `integration_tests/` directory has a nice pattern of
setup/cleanup/test.sh scripts at the top global level and at each module
level:

```
❯ tree --dirsfirst integration_tests
integration_tests
├── mysql
│   ├── util
│   │   ├── launch_mysql_container.sh
│   │   └── wait_for_mysqld.sh
│   ├── cleanup.sh
│   ├── setup.sh
│   ├── single_run.sh
│   └── test.sh
├── ssh
│   ├── cleanup.sh
│   ├── setup.sh
│   └── test.sh
├── cleanup.sh
├── setup.sh
└── test.sh

3 directories, 12 files
```

The scripts are runnable via:

```
./integration_tests/setup.sh && ./integration_tests/test.sh && ./integration_tests/cleanup.sh
```
2017-12-18 00:44:06 -05:00

26 lines
557 B
Bash
Executable File

#!/bin/bash -e
# Set up the integration tests for all modules.
# Drop your setup script(s) in integration_tests/<protocol>/setup(.*).sh
# Run from root of project
TEST_DIR=$(dirname "$0")
cd "$TEST_DIR/.."
echo "Setting up integration tests..."
pushd integration_tests
for mod in $(ls); do
if [ -d "$mod" ]; then
pushd $mod
for setup in $(ls setup*.sh); do
echo "Setting up $mod (integration_tests/$mod/$setup)..."
./$setup
done
popd
fi
done
popd
echo "Integration tests setup finished."