terratest
terratest copied to clipboard
Add integration with Vagrant
Add new integration with Vagrant via modules folder. Some systems programming workflows cannot rely on Docker for local iteration. Having Vagrant supported as a first class package in terratest would help streamline these kinds of workflows.
Examples such as:
-
vagrant up
-
vagrant halt
-
vagrant ssh
-
vagrant down
- Works with
packer
module in similar fashion todocker
module
Example workflow:
package test
import (
"testing"
"github.com/gruntwork-io/terratest/modules/vagrant"
"github.com/gruntwork-io/terratest/modules/packer"
"github.com/stretchr/testify/assert"
)
func TestPackerHelloWorldExample(t *testing.T) {
packerOptions := &packer.Options{
Template: "../examples/packer-hello-world-example/build.pkr.hcl",
}
packer.BuildArtifact(t, packerOptions) // Build the Packer template which will create a Vagrant box
output := vagrant.up(t, "gruntwork/packer-hello-world-example", opts) // Run Vagrant box
}
Might also need modules for VirtualBox or KVM depending on the Vagrant box.