packer-cn/test
Mitchell Hashimoto 1d1c72b804 test: file provisioner tests pass 2013-12-12 11:25:33 -08:00
..
fixtures test: file provisioner tests pass 2013-12-12 11:25:33 -08:00
README.md test: minimal amazon-ebs test 2013-12-12 10:30:41 -08:00
builder_amazon_ebs.bats test: cleaner helper file 2013-12-12 10:30:41 -08:00
provisioner_file.bats test: file provisioner tests pass 2013-12-12 11:25:33 -08:00
provisioner_shell.bats test: shell provisioner tests 2013-12-12 11:08:45 -08:00
test_helper.bash test: cleaner helper file 2013-12-12 10:30:41 -08:00

README.md

Packer Black-Box Tests

This folder contains tests that test Packer using a black-box approach: packer is executed directly (with whatever is on the PATH) and certain results are expected.

Tests are run using Bats, and therefore Bash is required to run any tests.

Warning: Many of these tests run using AWS, and therefore have a real-world cost associated with running the tests. Be aware of that prior to running the tests. Additionally, many tests will leave left-over artifacts (AMIs) that you'll have to manually clean up.

Required Software

Before running the tests, you'll need the following installed. If you're running on Mac OS X, most of these are available with brew:

Configuring Tests

For tests that require AWS credentials:

Set the following self-explanatory environmental variables:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY

Running Tests

These tests are meant to be run one file at a time. There are some test files (such as the amazon-chroot builder test) that simply won't run except in special environments, so running all test files will probably never work.

If you're working on Packer and want to test that your change didn't adversely affect something, try running only the test that is related to your change.