packer-cn/builder/profitbricks/builder_acc_test.go

39 lines
796 B
Go
Raw Normal View History

2016-06-28 22:35:41 -04:00
package profitbricks
import (
"os"
"testing"
builderT "github.com/hashicorp/packer/acctest"
2016-06-28 22:35:41 -04:00
)
func TestBuilderAcc_basic(t *testing.T) {
builderT.Test(t, builderT.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Builder: &Builder{},
Template: testBuilderAccBasic,
})
}
func testAccPreCheck(t *testing.T) {
if v := os.Getenv("PROFITBRICKS_USERNAME"); v == "" {
t.Fatal("PROFITBRICKS_USERNAME must be set for acceptance tests")
}
if v := os.Getenv("PROFITBRICKS_PASSWORD"); v == "" {
t.Fatal("PROFITBRICKS_PASSWORD must be set for acceptance tests")
}
}
const testBuilderAccBasic = `
{
"builders": [{
"image": "Ubuntu-16.04",
2016-09-28 18:04:14 -04:00
"password": "password",
"username": "username",
"snapshot_name": "packer",
2016-06-28 22:35:41 -04:00
"type": "profitbricks"
}]
}
`