fix test fixture path

This commit is contained in:
Megan Marsh 2020-12-17 14:41:36 -08:00
parent 88b7b0e14a
commit ce99640fe2
13 changed files with 12 additions and 10 deletions

View File

@ -214,7 +214,7 @@ func TestBuilderPrepare_FloppyFiles(t *testing.T) {
t.Fatalf("bad: %#v", b.config.FloppyFiles)
}
floppiesPath := "../../../packer-plugin-sdk/test-fixtures/floppies"
floppiesPath := "../../test-fixtures/floppies"
config["floppy_files"] = []string{fmt.Sprintf("%s/bar.bat", floppiesPath), fmt.Sprintf("%s/foo.ps1", floppiesPath)}
b = Builder{}
_, warns, err = b.Prepare(config)

View File

@ -354,7 +354,7 @@ func TestBuilderPrepare_FloppyFiles(t *testing.T) {
t.Fatalf("bad: %#v", b.config.FloppyFiles)
}
floppies_path := "../../../packer-plugin-sdk/test-fixtures/floppies"
floppies_path := "../../test-fixtures/floppies"
config["floppy_files"] = []string{fmt.Sprintf("%s/bar.bat", floppies_path), fmt.Sprintf("%s/foo.ps1", floppies_path)}
b = Builder{}
_, warns, err = b.Prepare(config)

View File

@ -66,7 +66,7 @@ func TestBuilderPrepare_FloppyFiles(t *testing.T) {
t.Fatalf("bad: %#v", b.config.FloppyFiles)
}
floppies_path := "../../../packer-plugin-sdk/test-fixtures/floppies"
floppies_path := "../../test-fixtures/floppies"
config["floppy_files"] = []string{fmt.Sprintf("%s/bar.bat", floppies_path), fmt.Sprintf("%s/foo.ps1", floppies_path)}
b = Builder{}
_, warns, err = b.Prepare(config)

View File

@ -74,7 +74,7 @@ func TestNewConfig_sourcePath(t *testing.T) {
func TestNewConfig_FloppyFiles(t *testing.T) {
c := testConfig(t)
floppies_path := "../../../packer-plugin-sdk/test-fixtures/floppies"
floppies_path := "../../test-fixtures/floppies"
c["floppy_files"] = []string{fmt.Sprintf("%s/bar.bat", floppies_path), fmt.Sprintf("%s/foo.ps1", floppies_path)}
_, err := (&Config{}).Prepare(c)
if err != nil {

View File

@ -328,7 +328,7 @@ func TestBuilderPrepare_FloppyFiles(t *testing.T) {
t.Fatalf("bad: %#v", c.FloppyFiles)
}
floppies_path := "../../packer-plugin-sdk/test-fixtures/floppies"
floppies_path := "../test-fixtures/floppies"
config["floppy_files"] = []string{fmt.Sprintf("%s/bar.bat", floppies_path), fmt.Sprintf("%s/foo.ps1", floppies_path)}
c = Config{}
warns, err = c.Prepare(config)

View File

@ -0,0 +1 @@
Echo I am a floppy with a batch file

View File

@ -0,0 +1 @@
Write-Host "I am a floppy with some Powershell"

View File

@ -106,7 +106,7 @@ func TestBuilderPrepare_FloppyFiles(t *testing.T) {
t.Fatalf("bad: %#v", b.config.FloppyFiles)
}
floppies_path := "../../../packer-plugin-sdk/test-fixtures/floppies"
floppies_path := "../../test-fixtures/floppies"
config["floppy_files"] = []string{fmt.Sprintf("%s/bar.bat", floppies_path), fmt.Sprintf("%s/foo.ps1", floppies_path)}
b = Builder{}
_, warns, err = b.Prepare(config)

View File

@ -32,7 +32,7 @@ func getTempFile(t *testing.T) *os.File {
func TestNewConfig_FloppyFiles(t *testing.T) {
cfg := testConfig(t)
floppies_path := "../../../packer-plugin-sdk/test-fixtures/floppies"
floppies_path := "../../test-fixtures/floppies"
cfg["floppy_files"] = []string{fmt.Sprintf("%s/bar.bat", floppies_path), fmt.Sprintf("%s/foo.ps1", floppies_path)}
var c Config
_, err := c.Prepare(cfg)

View File

@ -107,7 +107,7 @@ func TestBuilderPrepare_FloppyFiles(t *testing.T) {
t.Fatalf("bad: %#v", b.config.FloppyFiles)
}
floppies_path := "../../../packer-plugin-sdk/test-fixtures/floppies"
floppies_path := "../../test-fixtures/floppies"
config["floppy_files"] = []string{fmt.Sprintf("%s/bar.bat", floppies_path), fmt.Sprintf("%s/foo.ps1", floppies_path)}
b = Builder{}
_, warns, err = b.Prepare(config)

View File

@ -36,7 +36,7 @@ func TestBuilderPrepare_FloppyFiles(t *testing.T) {
t.Fatalf("bad: %#v", b.config.FloppyFiles)
}
floppies_path := "../../../packer-plugin-sdk/test-fixtures/floppies"
floppies_path := "../../test-fixtures/floppies"
config["floppy_files"] = []string{fmt.Sprintf("%s/bar.bat", floppies_path), fmt.Sprintf("%s/foo.ps1", floppies_path)}
b = Builder{}
_, warns, err = b.Prepare(config)

View File

@ -18,7 +18,7 @@ func TestDecomressOVA(t *testing.T) {
assert.NoError(t, err)
defer os.RemoveAll(td)
fixture := "../../packer-plugin-sdk/test-fixtures/decompress-tar/outside_parent.tar"
fixture := "./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"))