fix var naming and docs in acctest package

This commit is contained in:
Megan Marsh 2020-12-11 15:23:12 -08:00
parent 7f1456fc50
commit 2c62c9bff1
2 changed files with 13 additions and 6 deletions

View File

@ -1,9 +1,7 @@
/* /*
The provisioneracc package creates a framework for provisioner acceptance The provisioneracc package creates a framework for provisioner acceptance
testing. testing. For builder acceptance testing, use the top level tooling in the
acctest package.
Variables stored in this file represent implementations of the BuilderFixture
struct inside of provisioners.go
*/ */
package provisioneracc package provisioneracc
@ -12,6 +10,11 @@ import (
"github.com/hashicorp/packer/packer-plugin-sdk/acctest/testutils" "github.com/hashicorp/packer/packer-plugin-sdk/acctest/testutils"
) )
// Variables stored in this file represent implementations of the BuilderFixture
// struct inside of provisioners.go
// AmasonEBSBuilderFixtureLinux points to a build stub of a simple amazon-ebs
// build running on a linux operating system.
var AmasonEBSBuilderFixtureLinux = &BuilderFixture{ var AmasonEBSBuilderFixtureLinux = &BuilderFixture{
Name: "Amazon-ebs Linux builder", Name: "Amazon-ebs Linux builder",
TemplatePath: "amazon-ebs/amazon-ebs.txt", TemplatePath: "amazon-ebs/amazon-ebs.txt",
@ -28,6 +31,8 @@ var AmasonEBSBuilderFixtureLinux = &BuilderFixture{
}, },
} }
// AmasonEBSBuilderFixtureWindows points to a build stub of a simple amazon-ebs
// build running on a Windows operating system.
var AmasonEBSBuilderFixtureWindows = &BuilderFixture{ var AmasonEBSBuilderFixtureWindows = &BuilderFixture{
Name: "Amazon-ebs Windows builder", Name: "Amazon-ebs Windows builder",
TemplatePath: "amazon-ebs/amazon-ebs_windows.txt", TemplatePath: "amazon-ebs/amazon-ebs_windows.txt",
@ -44,7 +49,9 @@ var AmasonEBSBuilderFixtureWindows = &BuilderFixture{
}, },
} }
var VirtualboxBuilderFixtureWindows = &BuilderFixture{ // VirtualboxBuilderFixtureLinux points to a build stub of a simple amazon-ebs
// build running on a linux operating system.
var VirtualboxBuilderFixtureLinux = &BuilderFixture{
Name: "Virtualbox Windows builder", Name: "Virtualbox Windows builder",
TemplatePath: "virtualbox/virtualbox-iso.txt", TemplatePath: "virtualbox/virtualbox-iso.txt",
GuestOS: "linux", GuestOS: "linux",

View File

@ -333,6 +333,6 @@ type BuilderAcceptance interface {
// Mapping of all builder fixtures defined for a given builder type. // Mapping of all builder fixtures defined for a given builder type.
var BuildersAccTest = map[string][]*BuilderFixture{ var BuildersAccTest = map[string][]*BuilderFixture{
"virtualbox-iso": []*BuilderFixture{VirtualboxBuilderFixtureWindows}, "virtualbox-iso": []*BuilderFixture{VirtualboxBuilderFixtureLinux},
"amazon-ebs": []*BuilderFixture{AmasonEBSBuilderFixtureLinux, AmasonEBSBuilderFixtureWindows}, "amazon-ebs": []*BuilderFixture{AmasonEBSBuilderFixtureLinux, AmasonEBSBuilderFixtureWindows},
} }