mozilla / frost

Unit testing framework for test driven security of AWS, GCP, Heroku and more.
https://mozilla.github.io/frost/
Mozilla Public License 2.0
104 stars 24 forks source link

Running frost from docker image fails #397

Closed sciurus closed 3 years ago

sciurus commented 3 years ago

On master, if I run

$ make build-image
$ docker run localhost/frost:latest test aws/ec2/test_ec2_ebs_volume_not_piops.py 

I get the error

ERROR: usage: frost [options] [file_or_dir] [file_or_dir] [...]
frost: error: unrecognized arguments: --debug-calls
  inifile: None
  rootdir: /app

Based on some experimentation, I think this is because the Dockerfile runs python setup.py install but the frost command currently only works if you run python setup.py develop. Here are the steps to reproduce the problem outside of Docker:

1) Perform a fresh checkout of the frost repo 2) Run . venv/bin/activate && pip install -U pip && pip install -r requirements.txt && python setup.py install && pre-commit install (the standard make install steps, except with install substituted for develop) 3) Run frost test aws/ec2/test_ec2_ebs_volume_not_piops.py 4) Observe the error "unrecognized arguments: --debug-calls"

So we need to either figure out why frost doesn't work when you run install or switch the Dockerfile to run develop.

hwine commented 3 years ago

I think this is a documentation issue, but I'm not sure I understand your use case.

Are you trying to:

sciurus commented 3 years ago

I was testing if the artifacts (python package and docker image) we are producing work as expected. My expectation is that the Docker image, which has frost as the ENTRYPOINT, will run that without error.

hwine commented 3 years ago

Ah - in that case, this could be: