2016-11-13 17:34:36 -05:00
|
|
|
package oneandone
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
2017-04-04 16:39:01 -04:00
|
|
|
builderT "github.com/hashicorp/packer/helper/builder/testing"
|
2016-11-13 17:34:36 -05: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("ONEANDONE_TOKEN"); v == "" {
|
|
|
|
t.Fatal("ONEANDONE_TOKEN must be set for acceptance tests")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const testBuilderAccBasic = `
|
|
|
|
{
|
|
|
|
"builders": [{
|
|
|
|
"type": "oneandone",
|
|
|
|
"disk_size": "50",
|
|
|
|
"snapshot_name": "test5",
|
|
|
|
"image" : "ubuntu1604-64min"
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
`
|