Add test.

This commit is contained in:
Adrienne Cohea 2020-05-17 23:27:06 -07:00
parent 6aea8ead6a
commit 6c6039798c
No known key found for this signature in database
GPG Key ID: F83E59DFC2463856
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,8 @@
build {
name = "somebuild"
sources = [
"source.amazon-ebs.ubuntu-1604",
"source.virtualbox-iso.ubuntu-1204",
]
}

View File

@ -100,6 +100,28 @@ func TestParse_build(t *testing.T) {
[]packer.Build{},
false,
},
{"named build",
defaultParser,
parseTestArgs{"testdata/build/named.pkr.hcl", nil, nil},
&PackerConfig{
Basedir: filepath.Join("testdata", "build"),
Builds: Builds{
&BuildBlock{
Name: "somebuild",
Sources: []SourceRef{
{
Type: "amazon-ebs",
Name: "ubuntu-1604",
},
refVBIsoUbuntu1204,
},
},
},
},
false, false,
[]packer.Build{},
true,
},
}
testParse(t, tests)
}