File: virtualbox_test.go

package info (click to toggle)
packer 1.3.4%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,324 kB
  • sloc: python: 619; sh: 557; makefile: 111
file content (28 lines) | stat: -rw-r--r-- 652 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package vagrant

import (
	"os"
	"path/filepath"
	"testing"

	"github.com/hashicorp/packer/packer/tmp"
	"github.com/stretchr/testify/assert"
)

func TestVBoxProvider_impl(t *testing.T) {
	var _ Provider = new(VBoxProvider)
}

func TestDecomressOVA(t *testing.T) {
	td, err := tmp.Dir("pp-vagrant-virtualbox")
	assert.NoError(t, err)
	defer os.RemoveAll(td)

	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)
}