2019-04-15 17:22:25 -04:00
|
|
|
package linode
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
2020-12-03 14:46:58 -05:00
|
|
|
builderT "github.com/hashicorp/packer/packer-plugin-sdk/acctest"
|
2019-04-15 17:22:25 -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("LINODE_TOKEN"); v == "" {
|
|
|
|
t.Fatal("LINODE_TOKEN must be set for acceptance tests")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const testBuilderAccBasic = `
|
|
|
|
{
|
|
|
|
"builders": [{
|
|
|
|
"type": "test",
|
|
|
|
"region": "us-east",
|
|
|
|
"instance_type": "g6-nanode-1",
|
|
|
|
"image": "linode/alpine3.9",
|
|
|
|
"ssh_username": "root"
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
`
|