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
ca24c664
Commit
ca24c664
authored
Dec 12, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: file provisioner tests pass
parent
318ced95
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
102 additions
and
0 deletions
+102
-0
test/fixtures/provisioner-file/dir/file.txt
test/fixtures/provisioner-file/dir/file.txt
+1
-0
test/fixtures/provisioner-file/dir_no_trailing.json
test/fixtures/provisioner-file/dir_no_trailing.json
+22
-0
test/fixtures/provisioner-file/dir_with_trailing.json
test/fixtures/provisioner-file/dir_with_trailing.json
+22
-0
test/fixtures/provisioner-file/file.json
test/fixtures/provisioner-file/file.json
+22
-0
test/fixtures/provisioner-file/file.txt
test/fixtures/provisioner-file/file.txt
+1
-0
test/provisioner_file.bats
test/provisioner_file.bats
+34
-0
No files found.
test/fixtures/provisioner-file/dir/file.txt
0 → 100644
View file @
ca24c664
337 miles
test/fixtures/provisioner-file/dir_no_trailing.json
0 → 100644
View file @
ca24c664
{
"builders"
:
[{
"type"
:
"amazon-ebs"
,
"ami_name"
:
"packer-test {{timestamp}}"
,
"instance_type"
:
"m1.small"
,
"region"
:
"us-east-1"
,
"ssh_username"
:
"ubuntu"
,
"source_ami"
:
"ami-0568456c"
,
"tags"
:
{
"packer-test"
:
"true"
}
}],
"provisioners"
:
[{
"type"
:
"file"
,
"source"
:
"dir"
,
"destination"
:
"/tmp"
},
{
"type"
:
"shell"
,
"inline"
:
[
"cat /tmp/dir/file.txt"
]
}]
}
test/fixtures/provisioner-file/dir_with_trailing.json
0 → 100644
View file @
ca24c664
{
"builders"
:
[{
"type"
:
"amazon-ebs"
,
"ami_name"
:
"packer-test {{timestamp}}"
,
"instance_type"
:
"m1.small"
,
"region"
:
"us-east-1"
,
"ssh_username"
:
"ubuntu"
,
"source_ami"
:
"ami-0568456c"
,
"tags"
:
{
"packer-test"
:
"true"
}
}],
"provisioners"
:
[{
"type"
:
"file"
,
"source"
:
"dir/"
,
"destination"
:
"/tmp"
},
{
"type"
:
"shell"
,
"inline"
:
[
"cat /tmp/file.txt"
]
}]
}
test/fixtures/provisioner-file/file.json
0 → 100644
View file @
ca24c664
{
"builders"
:
[{
"type"
:
"amazon-ebs"
,
"ami_name"
:
"packer-test {{timestamp}}"
,
"instance_type"
:
"m1.small"
,
"region"
:
"us-east-1"
,
"ssh_username"
:
"ubuntu"
,
"source_ami"
:
"ami-0568456c"
,
"tags"
:
{
"packer-test"
:
"true"
}
}],
"provisioners"
:
[{
"type"
:
"file"
,
"source"
:
"file.txt"
,
"destination"
:
"/tmp/file.txt"
},
{
"type"
:
"shell"
,
"inline"
:
[
"cat /tmp/file.txt"
]
}]
}
test/fixtures/provisioner-file/file.txt
0 → 100644
View file @
ca24c664
24901 miles
test/provisioner_file.bats
0 → 100755
View file @
ca24c664
#!/usr/bin/env bats
#
# This tests the amazon-ebs builder. The teardown function will automatically
# delete any AMIs with a tag of `packer-test` being equal to "true" so
# be sure any test cases set this.
load test_helper
fixtures provisioner-file
setup() {
cd $FIXTURE_ROOT
}
teardown() {
aws_ami_cleanup
}
@test "file provisioner: single file" {
run packer build $FIXTURE_ROOT/file.json
[ "$status" -eq 0 ]
[[ "$output" == *"24901 miles"* ]]
}
@test "file provisioner: directory (no trailing slash)" {
run packer build $FIXTURE_ROOT/dir_no_trailing.json
[ "$status" -eq 0 ]
[[ "$output" == *"337 miles"* ]]
}
@test "file provisioner: directory (with trailing slash)" {
run packer build $FIXTURE_ROOT/dir_with_trailing.json
[ "$status" -eq 0 ]
[[ "$output" == *"337 miles"* ]]
}
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