f5ca0de225
Assume the scp target is a file instead of a directory. Assuming the scp target is a file instead of a directory allows uploading files to a node being provisioned with the ssh communciator using sftp and with the winrm communicator. It is fully compatible with ansible; ansible communicators only allow for files (never directories) to be uploaded (when the copy module is used to upload a directory, ansible walks the directory and uploads files one at a time). Update documentation to explain how to provision a Windows image. Extend tests that use ssh to communicate with the node to include single files, recursive copies, and content-only recursive copies. Add test to verify support for the winrm communicator. Remove the err argument from adapter.scpExec, because it was unused. Fixes #3911 |
||
---|---|---|
.. | ||
fixtures | ||
README.md | ||
builder_googlecompute.bats | ||
cli.bats | ||
provisioner_ansible.bats | ||
provisioner_file.bats | ||
provisioner_shell.bats | ||
test_helper.bash |
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 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
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.