-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2271 from afbjorklund/cloud-config
Generate cloud-config outside of cidata.iso too
- Loading branch information
Showing
11 changed files
with
140 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cidata.TEMPLATE.d/user-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,45 @@ import ( | |
|
||
var defaultRemoveDefaults = false | ||
|
||
func TestConfig(t *testing.T) { | ||
args := &TemplateArgs{ | ||
Name: "default", | ||
User: "foo", | ||
UID: 501, | ||
Home: "/home/foo.linux", | ||
SSHPubKeys: []string{ | ||
"ssh-rsa dummy [email protected]", | ||
}, | ||
MountType: "reverse-sshfs", | ||
} | ||
config, err := ExecuteTemplateCloudConfig(args) | ||
assert.NilError(t, err) | ||
t.Log(string(config)) | ||
assert.Assert(t, !strings.Contains(string(config), "ca_certs:")) | ||
} | ||
|
||
func TestConfigCACerts(t *testing.T) { | ||
args := &TemplateArgs{ | ||
Name: "default", | ||
User: "foo", | ||
UID: 501, | ||
Home: "/home/foo.linux", | ||
SSHPubKeys: []string{ | ||
"ssh-rsa dummy [email protected]", | ||
}, | ||
MountType: "reverse-sshfs", | ||
CACerts: CACerts{ | ||
RemoveDefaults: &defaultRemoveDefaults, | ||
}, | ||
} | ||
config, err := ExecuteTemplateCloudConfig(args) | ||
assert.NilError(t, err) | ||
t.Log(string(config)) | ||
assert.Assert(t, strings.Contains(string(config), "ca_certs:")) | ||
} | ||
|
||
func TestTemplate(t *testing.T) { | ||
args := TemplateArgs{ | ||
args := &TemplateArgs{ | ||
Name: "default", | ||
User: "foo", | ||
UID: 501, | ||
|
@@ -29,7 +66,7 @@ func TestTemplate(t *testing.T) { | |
Trusted: []Cert{}, | ||
}, | ||
} | ||
layout, err := ExecuteTemplate(args) | ||
layout, err := ExecuteTemplateCIDataISO(args) | ||
assert.NilError(t, err) | ||
for _, f := range layout { | ||
t.Logf("=== %q ===", f.Path) | ||
|
@@ -46,7 +83,7 @@ func TestTemplate(t *testing.T) { | |
} | ||
|
||
func TestTemplate9p(t *testing.T) { | ||
args := TemplateArgs{ | ||
args := &TemplateArgs{ | ||
Name: "default", | ||
User: "foo", | ||
UID: 501, | ||
|
@@ -63,7 +100,7 @@ func TestTemplate9p(t *testing.T) { | |
RemoveDefaults: &defaultRemoveDefaults, | ||
}, | ||
} | ||
layout, err := ExecuteTemplate(args) | ||
layout, err := ExecuteTemplateCIDataISO(args) | ||
assert.NilError(t, err) | ||
for _, f := range layout { | ||
t.Logf("=== %q ===", f.Path) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.