Skip to content

Latest commit

 

History

History
102 lines (60 loc) · 4.56 KB

docker.md

File metadata and controls

102 lines (60 loc) · 4.56 KB

Running EvoMaster in Docker

EvoMaster is also released via Docker, under webfuzzing/evomaster.

It can be run with:

docker run webfuzzing/evomaster <options>

Where <options> would be the command-line options, like for example --blackBox true

IMPORTANT

For white-box testing, running from Docker is currently not supported. As such, it is discouraged. You can try it, but likely you will get major issues with hostname and ephemeral port resolutions, as well as issues with external dependency mocks.

Accessing the generated test files

By default, EvoMaster generates tests under the /generated_tests folder. To access the generated tests after Docker run is completed, you need to mount a folder or a volume pointing to that folder. An example is mounting the local ./generated_tests, using for example:

docker run -v "/$(pwd)/generated_tests":/generated_tests webfuzzing/evomaster <options>

There can be other ways to access the /generated_tests folder inside the Docker image (e.g., using volumes), but, for that, you will need to check the Docker documentation.

WARNING: note the / before $(pwd). This is needed only if running in a MSYS shell on Windows like Git Bash, as it automatically converts paths on the command line. Unfortunately, this will also mess up any input parameter to EvoMaster that is recognized as a path (e.g., if starting with a /). You can read more here.

Issues with "localhost"

An important fact to keep in mind is that references to localhost will point to the Docker virtual network, and not your host machine. This latter can be accessed at host.docker.internal.

For example, in black-box testing for REST APIs, if the tested API is running on your machine, an option like

--bbSwaggerUrl http://localhost:8080/v3/api-docs

would need to be replaced with

--bbSwaggerUrl http://host.docker.internal:8080/v3/api-docs

Note that here the port 8080 and the the path /v3/api-docs are just examples.

Handling "em.yaml" configuration file

If you want to use a configuration file (e.g., em.yaml) to specify command-line options, this needs to be mounted into Docker. For example by using:

-v "$(pwd)/em.yaml":/em.yaml

By default, EvoMaster in Docker searches for a configuration file under /em.yaml. You can mount your configuration file (based on its absolute path) into that.

WARNING: in Git Bash, you will need a / before $(pwd), i.e., Linux-like paths should start with a // and not a / (as otherwise get converted, and you might end up seeing weird things like prepended paths such as C:/Program Files/Git). Also, options like --configPath will not work there.

By default, if there is no em.yaml file, EvoMaster will create one in the current working directory, with comments on how it should be configured. However, if you run through Docker, you will not be able to directly access such file, unless you mount the whole / root folder (which is not recommended). But you can still create it manually. See documentation.