actually check for errors in functional tests

This commit is contained in:
Ricard Clau 2016-07-07 20:01:23 +01:00
parent da80c60e84
commit 049fb2d9c1
1 changed files with 12 additions and 3 deletions

View File

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