Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
24ad445e
Commit
24ad445e
authored
Oct 16, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazon,builder/openstack: remove more cgl libs
parent
8c9d2454
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
27 deletions
+22
-27
builder/amazon/common/artifact_test.go
builder/amazon/common/artifact_test.go
+7
-11
builder/amazon/common/block_device_test.go
builder/amazon/common/block_device_test.go
+8
-5
builder/openstack/artifact_test.go
builder/openstack/artifact_test.go
+7
-11
No files found.
builder/amazon/common/artifact_test.go
View file @
24ad445e
package
common
import
(
"cgl.tideland.biz/asserts"
"github.com/mitchellh/packer/packer"
"testing"
)
func
TestArtifact_Impl
(
t
*
testing
.
T
)
{
assert
:=
asserts
.
NewTestingAsserts
(
t
,
true
)
var
actual
packer
.
Artifact
assert
.
Implementor
(
&
Artifact
{},
&
actual
,
"should be an Artifact"
)
var
_
packer
.
Artifact
=
new
(
Artifact
)
}
func
TestArtifactId
(
t
*
testing
.
T
)
{
assert
:=
asserts
.
NewTestingAsserts
(
t
,
true
)
expected
:=
`east:foo,west:bar`
amis
:=
make
(
map
[
string
]
string
)
...
...
@@ -27,12 +21,12 @@ func TestArtifactId(t *testing.T) {
}
result
:=
a
.
Id
()
assert
.
Equal
(
result
,
expected
,
"should match output"
)
if
result
!=
expected
{
t
.
Fatalf
(
"bad: %s"
,
result
)
}
}
func
TestArtifactString
(
t
*
testing
.
T
)
{
assert
:=
asserts
.
NewTestingAsserts
(
t
,
true
)
expected
:=
`AMIs were created:
east: foo
...
...
@@ -44,5 +38,7 @@ west: bar`
a
:=
&
Artifact
{
Amis
:
amis
}
result
:=
a
.
String
()
assert
.
Equal
(
result
,
expected
,
"should match output"
)
if
result
!=
expected
{
t
.
Fatalf
(
"bad: %s"
,
result
)
}
}
builder/amazon/common/block_device_test.go
View file @
24ad445e
package
common
import
(
"cgl.tideland.biz/asserts"
"github.com/mitchellh/goamz/ec2"
"reflect"
"testing"
)
func
TestBlockDevice
(
t
*
testing
.
T
)
{
assert
:=
asserts
.
NewTestingAsserts
(
t
,
true
)
ec2Mapping
:=
[]
ec2
.
BlockDeviceMapping
{
ec2
.
BlockDeviceMapping
{
DeviceName
:
"/dev/sdb"
,
...
...
@@ -36,6 +34,11 @@ func TestBlockDevice(t *testing.T) {
LaunchMappings
:
[]
BlockDevice
{
blockDevice
},
}
assert
.
Equal
(
ec2Mapping
,
blockDevices
.
BuildAMIDevices
(),
"should match output"
)
assert
.
Equal
(
ec2Mapping
,
blockDevices
.
BuildLaunchDevices
(),
"should match output"
)
if
!
reflect
.
DeepEqual
(
ec2Mapping
,
blockDevices
.
BuildAMIDevices
())
{
t
.
Fatalf
(
"bad: %#v"
,
ec2Mapping
)
}
if
!
reflect
.
DeepEqual
(
ec2Mapping
,
blockDevices
.
BuildLaunchDevices
())
{
t
.
Fatalf
(
"bad: %#v"
,
ec2Mapping
)
}
}
builder/openstack/artifact_test.go
View file @
24ad445e
package
openstack
import
(
"cgl.tideland.biz/asserts"
"github.com/mitchellh/packer/packer"
"testing"
)
func
TestArtifact_Impl
(
t
*
testing
.
T
)
{
assert
:=
asserts
.
NewTestingAsserts
(
t
,
true
)
var
actual
packer
.
Artifact
assert
.
Implementor
(
&
Artifact
{},
&
actual
,
"should be an Artifact"
)
var
_
packer
.
Artifact
=
new
(
Artifact
)
}
func
TestArtifactId
(
t
*
testing
.
T
)
{
assert
:=
asserts
.
NewTestingAsserts
(
t
,
true
)
expected
:=
`b8cdf55b-c916-40bd-b190-389ec144c4ed`
a
:=
&
Artifact
{
...
...
@@ -23,17 +17,19 @@ func TestArtifactId(t *testing.T) {
}
result
:=
a
.
Id
()
assert
.
Equal
(
result
,
expected
,
"should match output"
)
if
result
!=
expected
{
t
.
Fatalf
(
"bad: %s"
,
result
)
}
}
func
TestArtifactString
(
t
*
testing
.
T
)
{
assert
:=
asserts
.
NewTestingAsserts
(
t
,
true
)
expected
:=
"An image was created: b8cdf55b-c916-40bd-b190-389ec144c4ed"
a
:=
&
Artifact
{
ImageId
:
"b8cdf55b-c916-40bd-b190-389ec144c4ed"
,
}
result
:=
a
.
String
()
assert
.
Equal
(
result
,
expected
,
"should match output"
)
if
result
!=
expected
{
t
.
Fatalf
(
"bad: %s"
,
result
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment