aboutsummaryrefslogtreecommitdiff
path: root/libvirt
diff options
context:
space:
mode:
authorDuncan Mac-Vicar P <dmacvicar@suse.de>2017-11-23 14:37:52 +0100
committerDuncan Mac-Vicar P <dmacvicar@suse.de>2017-11-24 17:56:44 +0100
commit1cbfe466f0fb8c2320c54cec9e54fbdb1d5bd4ac (patch)
treeb78457e70284d923516099846f94b67b984c14ba /libvirt
parenta1145d25f878d0fc70229428c8076c27423d5a07 (diff)
downloadterraform-provider-libvirt-1cbfe466f0fb8c2320c54cec9e54fbdb1d5bd4ac.tar
terraform-provider-libvirt-1cbfe466f0fb8c2320c54cec9e54fbdb1d5bd4ac.tar.gz
Split kernel cmdline test
Diffstat (limited to 'libvirt')
-rw-r--r--libvirt/utils_domain_def_test.go34
1 files changed, 16 insertions, 18 deletions
diff --git a/libvirt/utils_domain_def_test.go b/libvirt/utils_domain_def_test.go
index b497c02c..4880804e 100644
--- a/libvirt/utils_domain_def_test.go
+++ b/libvirt/utils_domain_def_test.go
@@ -12,25 +12,23 @@ func init() {
}
func TestSplitKernelCmdLine(t *testing.T) {
- {
- e := []map[string]string{{"foo": "bar"}, {"foo": "bar", "key": "val"}}
- r, err := splitKernelCmdLine("foo=bar foo=bar key=val")
- if !reflect.DeepEqual(r, e) {
- t.Fatalf("got='%s' expected='%s'", spew.Sdump(r), spew.Sdump(e))
- }
- if err != nil {
- t.Error(err)
- }
+ e := []map[string]string{{"foo": "bar"}, {"foo": "bar", "key": "val"}}
+ r, err := splitKernelCmdLine("foo=bar foo=bar key=val")
+ if !reflect.DeepEqual(r, e) {
+ t.Fatalf("got='%s' expected='%s'", spew.Sdump(r), spew.Sdump(e))
}
+ if err != nil {
+ t.Error(err)
+ }
+}
- {
- v := "foo=barfoo=bar"
- r, err := splitKernelCmdLine(v)
- if r != nil {
- t.Fatalf("got='%s' expected='%s'", spew.Sdump(r), err)
- }
- if err == nil {
- t.Errorf("Expected error for parsing '%s'", v)
- }
+func TestSplitKernelInvalidCmdLine(t *testing.T) {
+ v := "foo=barfoo=bar"
+ r, err := splitKernelCmdLine(v)
+ if r != nil {
+ t.Fatalf("got='%s' expected='%s'", spew.Sdump(r), err)
+ }
+ if err == nil {
+ t.Errorf("Expected error for parsing '%s'", v)
}
}