packer-cn/test
Josh Soref b68168807a Miscellaneous doc improvements
backticks, spaces, commas

In general, a list of items should have a space after each comma.
While there are editorial styles that suggest commas inside quotations,
they're horrible advice when the backticks are describing specific
character for a user to enter.

one off indent filters section

singular

backticks...

word wrap long lines...

spelling: macOS

contributing: clarify closing case
contributing: link to changelog
contributing: point to git remote...
contributing: split commands from descriptions
contributing: grammar
spelling: github
grammar: comma after etc.
spelling: macOS
grammar: i.e.
alicloud: use relative link
alicloud: use backticks
alicloud: bits
alicloud: such as
grammar: comma after etc.
avoid linking periods
grammar: period
amazon-chroot: IOPS
amazon-chroot: use backticks
amazon-chroot: link to section
amazon-chroot: whether-or-not; period
amazon-ebs: period
amazon-ebs: use relative link
amazon-ebs: use backticks
amazon-ebs: comma
amazon-ebs: bold
amazon-ebssurrogate: comma after etc.
amazon-ebssurrogate: this builder
amazon-instance: this builder
amazon-ebssurrogate: set this
amazon-ebssurrogate: whether-or-not
amazon-ebssurrogate: period
amazon-ebssurrogate: bold section reference
amazon-ebssurrogate: backticks...
amazon-ebssurrogate: commas around e.g.
spelling: precedence
spelling: i.e.
amazon-ebssurrogate: backticks...
2018-10-18 19:09:49 -04:00
..
fixtures Add options to LXC builder for influencing for how containers are built and started 2017-10-30 21:48:43 -04:00
README.md Miscellaneous doc improvements 2018-10-18 19:09:49 -04:00
builder_googlecompute.bats add blackbox tests for ansible provisioner 2016-07-29 23:24:09 -07:00
builder_lxc.bats Add options to LXC builder for influencing for how containers are built and started 2017-10-30 21:48:43 -04:00
cli.bats fixed packer --version 2014-12-13 19:40:39 +01:00
provisioner_ansible.bats add ansible tests for docker builder 2016-12-09 06:31:52 -08:00
provisioner_file.bats Add sftp file transfer support 2015-07-26 23:49:18 +00:00
provisioner_shell.bats test: shell provisioner tests 2013-12-12 11:08:45 -08:00
test_helper.bash test: better output if a test fails 2013-12-16 14:30:58 -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.

Running Tests

Required Software

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

  • Bats

  • AWS cli for AWS tests as well as most of the components.

  • gcutil for Google Compute Engine tests.

Configuring Tests

For tests that require AWS credentials:

Set the following self-explanatory environmental variables:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY

For tests that test Google Compute Engine:

Set the following environmental variables:

  • GC_BUCKET_NAME
  • GC_ACCOUNT_FILE
  • GC_PROJECT_ID

Running

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.

$ bats builder_amazon_ebs.bats

Note: Working directory doesn't matter. You can call the bats test file from any directory.