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
318ced95
Commit
318ced95
authored
Dec 12, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: shell provisioner tests
parent
a7537ff3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
0 deletions
+97
-0
test/fixtures/provisioner-shell/inline.json
test/fixtures/provisioner-shell/inline.json
+21
-0
test/fixtures/provisioner-shell/script.json
test/fixtures/provisioner-shell/script.json
+18
-0
test/fixtures/provisioner-shell/script.sh
test/fixtures/provisioner-shell/script.sh
+3
-0
test/fixtures/provisioner-shell/scripts.json
test/fixtures/provisioner-shell/scripts.json
+20
-0
test/provisioner_shell.bats
test/provisioner_shell.bats
+35
-0
No files found.
test/fixtures/provisioner-shell/inline.json
0 → 100644
View file @
318ced95
{
"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"
:
"shell"
,
"inline"
:
[
"bash -c 'echo HELLO I AM `whoami`'"
,
"echo AND ANOTHER"
]
}]
}
test/fixtures/provisioner-shell/script.json
0 → 100644
View file @
318ced95
{
"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"
:
"shell"
,
"script"
:
"script.sh"
}]
}
test/fixtures/provisioner-shell/script.sh
0 → 100755
View file @
318ced95
#!/usr/bin/env bash
echo
HELLO I AM DOG
test/fixtures/provisioner-shell/scripts.json
0 → 100644
View file @
318ced95
{
"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"
:
"shell"
,
"scripts"
:
[
"script.sh"
]
}]
}
test/provisioner_shell.bats
0 → 100755
View file @
318ced95
#!/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-shell
setup() {
cd $FIXTURE_ROOT
}
teardown() {
aws_ami_cleanup
}
@test "shell provisioner: inline scripts" {
run packer build $FIXTURE_ROOT/inline.json
[ "$status" -eq 0 ]
[[ "$output" == *"HELLO I AM ubuntu"* ]]
[[ "$output" == *"AND ANOTHER"* ]]
}
@test "shell provisioner: script" {
run packer build $FIXTURE_ROOT/script.json
[ "$status" -eq 0 ]
[[ "$output" == *"HELLO I AM DOG"* ]]
}
@test "shell provisioner: scripts" {
run packer build $FIXTURE_ROOT/scripts.json
[ "$status" -eq 0 ]
[[ "$output" == *"HELLO I AM DOG"* ]]
}
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