2013-06-27 10:33:32 -04:00
|
|
|
package vagrant
|
|
|
|
|
|
|
|
import (
|
2018-05-25 06:42:40 -04:00
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
2013-06-27 10:33:32 -04:00
|
|
|
"testing"
|
2018-05-25 06:42:40 -04:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2013-06-27 10:33:32 -04:00
|
|
|
)
|
|
|
|
|
2013-12-19 16:22:46 -05:00
|
|
|
func TestVBoxProvider_impl(t *testing.T) {
|
|
|
|
var _ Provider = new(VBoxProvider)
|
2013-06-27 10:33:32 -04:00
|
|
|
}
|
2018-05-25 06:42:40 -04:00
|
|
|
|
|
|
|
func TestDecomressOVA(t *testing.T) {
|
|
|
|
td, err := ioutil.TempDir("", "pp-vagrant-virtualbox")
|
|
|
|
assert.NoError(t, err)
|
|
|
|
fixture := "../../common/test-fixtures/decompress-tar/outside_parent.tar"
|
|
|
|
err = DecompressOva(td, fixture)
|
|
|
|
assert.NoError(t, err)
|
|
|
|
_, err = os.Stat(filepath.Join(filepath.Base(td), "demo.poc"))
|
|
|
|
assert.Error(t, err)
|
|
|
|
_, err = os.Stat(filepath.Join(td, "demo.poc"))
|
|
|
|
assert.NoError(t, err)
|
|
|
|
os.RemoveAll(td)
|
|
|
|
}
|