add ansible tests for docker builder

This commit is contained in:
Billie Cleek 2016-11-26 19:14:04 -08:00
parent c1591a8efa
commit e55c530cc6
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,26 @@
{
"variables": {},
"provisioners": [
{
"type": "shell",
"inline": [
"apt-get update",
"apt-get -y install python"
]
}, {
"type": "ansible",
"playbook_file": "./playbook.yml",
"extra_arguments": [
],
"sftp_command": "/usr/bin/false",
"use_sftp": false
}
],
"builders": [
{
"type": "docker",
"image": "debian:jessie",
"discard": true
}
]
}

View File

@ -43,6 +43,12 @@ teardown() {
rm -rf $FIXTURE_ROOT/fetched-dir
}
@test "ansible provisioner: build docker.json" {
cd $FIXTURE_ROOT
run packer build ${USER_VARS} $FIXTURE_ROOT/docker.json
[ "$status" -eq 0 ]
diff -r dir fetched-dir/default/tmp/remote-dir > /dev/null
}
@test "ansible provisioner: build minimal.json" {
cd $FIXTURE_ROOT
run packer build ${USER_VARS} $FIXTURE_ROOT/minimal.json