github.com/raghuse92/packer@v1.3.2/post-processor/vagrant/virtualbox_test.go (about)

     1  package vagrant
     2  
     3  import (
     4  	"io/ioutil"
     5  	"os"
     6  	"path/filepath"
     7  	"testing"
     8  
     9  	"github.com/stretchr/testify/assert"
    10  )
    11  
    12  func TestVBoxProvider_impl(t *testing.T) {
    13  	var _ Provider = new(VBoxProvider)
    14  }
    15  
    16  func TestDecomressOVA(t *testing.T) {
    17  	td, err := ioutil.TempDir("", "pp-vagrant-virtualbox")
    18  	assert.NoError(t, err)
    19  	fixture := "../../common/test-fixtures/decompress-tar/outside_parent.tar"
    20  	err = DecompressOva(td, fixture)
    21  	assert.NoError(t, err)
    22  	_, err = os.Stat(filepath.Join(filepath.Base(td), "demo.poc"))
    23  	assert.Error(t, err)
    24  	_, err = os.Stat(filepath.Join(td, "demo.poc"))
    25  	assert.NoError(t, err)
    26  	os.RemoveAll(td)
    27  }