-
Notifications
You must be signed in to change notification settings - Fork 45
/
builders.go
66 lines (60 loc) · 1.87 KB
/
builders.go
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
/*
Package provisioneracc creates a framework for provisioner acceptance
testing. For builder acceptance testing, use the top level tooling in the
acctest package.
*/
package provisioneracc
import (
"github.com/hashicorp/packer-plugin-sdk/acctest/testutils"
)
// Variables stored in this file represent implementations of the BuilderFixture
// struct inside of provisioners.go
// AmasonEBSBuilderFixtureLinux points to a build stub of a simple amazon-ebs
// build running on a linux operating system.
var AmasonEBSBuilderFixtureLinux = &BuilderFixture{
Name: "Amazon-ebs Linux builder",
TemplatePath: "amazon-ebs/amazon-ebs.txt",
GuestOS: "linux",
HostOS: "any",
Teardown: func() error {
// TODO
// helper := AWSHelper{
// Region: "us-east-1",
// AMIName: "packer-acc-test",
// }
// return helper.CleanUpAmi()
return nil
},
}
// AmasonEBSBuilderFixtureWindows points to a build stub of a simple amazon-ebs
// build running on a Windows operating system.
var AmasonEBSBuilderFixtureWindows = &BuilderFixture{
Name: "Amazon-ebs Windows builder",
TemplatePath: "amazon-ebs/amazon-ebs_windows.txt",
GuestOS: "windows",
HostOS: "any",
Teardown: func() error {
// TODO
// helper := AWSHelper{
// Region: "us-east-1",
// AMIName: "packer-acc-test",
// }
// return helper.CleanUpAmi()
return nil
},
}
// VirtualboxBuilderFixtureLinux points to a build stub of a simple amazon-ebs
// build running on a linux operating system.
var VirtualboxBuilderFixtureLinux = &BuilderFixture{
Name: "Virtualbox Windows builder",
TemplatePath: "virtualbox/virtualbox-iso.txt",
GuestOS: "linux",
HostOS: "any",
Teardown: func() error {
testutils.CleanupFiles("virtualbox-iso-packer-acc-test")
testutils.CleanupFiles("packer_cache")
return nil
},
}