Merge pull request #3690 from ricardclau/better_ansible_tests

Actually check for errors in Ansible functional tests
This commit is contained in:
Chris Bednarski 2016-07-07 12:42:25 -07:00 committed by GitHub
commit 76676bf4ba
1 changed files with 12 additions and 3 deletions

View File

@ -252,7 +252,10 @@ func TestAnsibleGetVersion(t *testing.T) {
var p Provisioner
p.config.Command = "ansible-playbook"
p.getVersion()
err := p.getVersion()
if err != nil {
t.Fatalf("err: %s", err)
}
}
func TestAnsibleLongMessages(t *testing.T) {
@ -263,7 +266,10 @@ func TestAnsibleLongMessages(t *testing.T) {
var p Provisioner
p.config.Command = "ansible-playbook"
p.config.PlaybookFile = "./test-fixtures/long-debug-message.yml"
p.Prepare()
err := p.Prepare()
if err != nil {
t.Fatalf("err: %s", err)
}
comm := &packer.MockCommunicator{}
ui := &packer.BasicUi{
@ -271,5 +277,8 @@ func TestAnsibleLongMessages(t *testing.T) {
Writer: new(bytes.Buffer),
}
p.Provision(ui, comm)
err = p.Provision(ui, comm)
if err != nil {
t.Fatalf("err: %s", err)
}
}