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
543a1a21
Commit
543a1a21
authored
Oct 02, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provisioner/chef-solo: alphabetize tests and such
/cc @netshade
parent
710db8de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
28 deletions
+28
-28
provisioner/chef-solo/provisioner.go
provisioner/chef-solo/provisioner.go
+1
-1
provisioner/chef-solo/provisioner_test.go
provisioner/chef-solo/provisioner_test.go
+27
-27
No files found.
provisioner/chef-solo/provisioner.go
View file @
543a1a21
...
...
@@ -18,12 +18,12 @@ import (
type
Config
struct
{
common
.
PackerConfig
`mapstructure:",squash"`
ChefEnvironment
string
`mapstructure:"chef_environment"`
ConfigTemplate
string
`mapstructure:"config_template"`
CookbookPaths
[]
string
`mapstructure:"cookbook_paths"`
RolesPath
string
`mapstructure:"roles_path"`
DataBagsPath
string
`mapstructure:"data_bags_path"`
EnvironmentsPath
string
`mapstructure:"environments_path"`
ChefEnvironment
string
`mapstructure:"chef_environment"`
ExecuteCommand
string
`mapstructure:"execute_command"`
InstallCommand
string
`mapstructure:"install_command"`
RemoteCookbookPaths
[]
string
`mapstructure:"remote_cookbook_paths"`
...
...
provisioner/chef-solo/provisioner_test.go
View file @
543a1a21
...
...
@@ -19,6 +19,22 @@ func TestProvisioner_Impl(t *testing.T) {
}
}
func
TestProvisionerPrepare_chefEnvironment
(
t
*
testing
.
T
)
{
var
p
Provisioner
config
:=
testConfig
()
config
[
"chef_environment"
]
=
"some-env"
err
:=
p
.
Prepare
(
config
)
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
if
p
.
config
.
ChefEnvironment
!=
"some-env"
{
t
.
Fatalf
(
"unexpected: %#v"
,
p
.
config
.
ChefEnvironment
)
}
}
func
TestProvisionerPrepare_configTemplate
(
t
*
testing
.
T
)
{
var
err
error
var
p
Provisioner
...
...
@@ -139,28 +155,6 @@ func TestProvisionerPrepare_dataBagsPath(t *testing.T) {
}
}
func
TestProvisionerPrepare_rolesPath
(
t
*
testing
.
T
)
{
var
p
Provisioner
rolesPath
,
err
:=
ioutil
.
TempDir
(
""
,
"roles"
)
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
defer
os
.
Remove
(
rolesPath
)
config
:=
testConfig
()
config
[
"roles_path"
]
=
rolesPath
err
=
p
.
Prepare
(
config
)
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
if
p
.
config
.
RolesPath
!=
rolesPath
{
t
.
Fatalf
(
"unexpected: %#v"
,
p
.
config
.
RolesPath
)
}
}
func
TestProvisionerPrepare_environmentsPath
(
t
*
testing
.
T
)
{
var
p
Provisioner
...
...
@@ -183,19 +177,25 @@ func TestProvisionerPrepare_environmentsPath(t *testing.T) {
}
}
func
TestProvisionerPrepare_
chefEnvironment
(
t
*
testing
.
T
)
{
func
TestProvisionerPrepare_
rolesPath
(
t
*
testing
.
T
)
{
var
p
Provisioner
rolesPath
,
err
:=
ioutil
.
TempDir
(
""
,
"roles"
)
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
defer
os
.
Remove
(
rolesPath
)
config
:=
testConfig
()
config
[
"
chef_environment"
]
=
"some-env"
config
[
"
roles_path"
]
=
rolesPath
err
:
=
p
.
Prepare
(
config
)
err
=
p
.
Prepare
(
config
)
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
if
p
.
config
.
ChefEnvironment
!=
"some-env"
{
t
.
Fatalf
(
"unexpected: %#v"
,
p
.
config
.
ChefEnvironment
)
if
p
.
config
.
RolesPath
!=
rolesPath
{
t
.
Fatalf
(
"unexpected: %#v"
,
p
.
config
.
RolesPath
)
}
}
...
...
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