remove unused tools, add some docs

pull/10373/head
Megan Marsh 6 years ago
parent 575f8ab8e8
commit 2805a59dbd

@ -1,3 +1,11 @@
/*
The provisioneracc package creates a framework for provisioner acceptance
testing.
Variables stored in this file represent implementations of the BuilderFixture
struct inside of provisioners.go
*/
package provisioneracc
import (

@ -1,43 +0,0 @@
package provisioneracc
import (
"bytes"
"testing"
amazonebsbuilder "github.com/hashicorp/packer/builder/amazon/ebs"
"github.com/hashicorp/packer/command"
"github.com/hashicorp/packer/packer"
packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer"
fileprovisioner "github.com/hashicorp/packer/provisioner/file"
"github.com/hashicorp/packer/provisioner/shell"
)
// testCoreConfigBuilder creates a packer CoreConfig that has a file builder
// available. This allows us to test a builder that writes files to disk.
func testCoreConfigBuilder(t *testing.T) *packer.CoreConfig {
components := packer.ComponentFinder{
BuilderStore: packersdk.MapOfBuilder{
"amazon-ebs": func() (packersdk.Builder, error) { return &amazonebsbuilder.Builder{}, nil },
},
ProvisionerStore: packersdk.MapOfProvisioner{
"shell": func() (packersdk.Provisioner, error) { return &shell.Provisioner{}, nil },
"file": func() (packersdk.Provisioner, error) { return &fileprovisioner.Provisioner{}, nil },
},
PostProcessorStore: packersdk.MapOfPostProcessor{},
}
return &packer.CoreConfig{
Components: components,
}
}
// TestMetaFile creates a Meta object that includes a file builder
func TestMetaFile(t *testing.T) command.Meta {
var out, err bytes.Buffer
return command.Meta{
CoreConfig: testCoreConfigBuilder(t),
Ui: &packersdk.BasicUi{
Writer: &out,
ErrorWriter: &err,
},
}
}

@ -287,7 +287,7 @@ func writeJsonTemplate(out *bytes.Buffer, filePath string, t *testing.T) {
outputFile.Sync()
}
// BuilderAcceptance is specialized tooling implemented by individual builders
// BuilderAcceptance is specialized tooling implemented by individual builders.
// To add your builder to the provisioner testing framework, create a struct
// that implements this interface, add it to the BuildersAccTest map below.
// TODO add this interface to the plugin server so that Packer can request it

@ -2,7 +2,7 @@ package testutils
import "os"
// CleanupFiles removes all files in the given strings.
// CleanupFiles removes all the provided filenames.
func CleanupFiles(moreFiles ...string) {
for _, file := range moreFiles {
os.RemoveAll(file)

@ -1,8 +1,14 @@
/*
Package adapter helps command line tools connect to the guest via a Packer
communicator. A typical use is for custom provisioners that wrap command line
communicator.
A typical use is for custom provisioners that wrap command line
tools. For example, the Ansible provisioner and the Inspec provisioner both
use this package to proxy communicator calls.
You may want to use this adapter if you are writing a provisioner that wraps a
tool which under normal usage would be run locally and form a connection to the
remote instance itself.
*/
package adapter

Loading…
Cancel
Save