Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(173)

Delta Between Two Patch Sets: environs/config/config_test.go

Issue 94410043: Use lxc clone by default (Closed)
Left Patch Set: Created 9 years, 10 months ago
Right Patch Set: Use lxc clone by default Created 9 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « environs/config/config.go ('k') | environs/config_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2012, 2013 Canonical Ltd. 1 // Copyright 2012, 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package config_test 4 package config_test
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 "regexp" 8 "regexp"
9 stdtesting "testing" 9 stdtesting "testing"
10 "time" 10 "time"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 }, 142 },
143 }, { 143 }, {
144 about: "LXC clone values", 144 about: "LXC clone values",
145 useDefaults: config.UseDefaults, 145 useDefaults: config.UseDefaults,
146 attrs: testing.Attrs{ 146 attrs: testing.Attrs{
147 "type": "my-type", 147 "type": "my-type",
148 "name": "my-name", 148 "name": "my-name",
149 "default-series": "precise", 149 "default-series": "precise",
150 "lxc-clone": true, 150 "lxc-clone": true,
151 "lxc-clone-aufs": true, 151 "lxc-clone-aufs": true,
152 },
153 }, {
154 about: "Deprecated lxc-use-clone used",
155 useDefaults: config.UseDefaults,
156 attrs: testing.Attrs{
157 "type": "my-type",
158 "name": "my-name",
159 "lxc-use-clone": true,
160 },
161 }, {
162 about: "Deprecated lxc-use-clone ignored",
163 useDefaults: config.UseDefaults,
164 attrs: testing.Attrs{
165 "type": "my-type",
166 "name": "my-name",
167 "lxc-use-clone": false,
168 "lxc-clone": true,
152 }, 169 },
153 }, { 170 }, {
154 about: "CA cert & key from path", 171 about: "CA cert & key from path",
155 useDefaults: config.UseDefaults, 172 useDefaults: config.UseDefaults,
156 attrs: testing.Attrs{ 173 attrs: testing.Attrs{
157 "type": "my-type", 174 "type": "my-type",
158 "name": "my-name", 175 "name": "my-name",
159 "ca-cert-path": "cacert2.pem", 176 "ca-cert-path": "cacert2.pem",
160 "ca-private-key-path": "cakey2.pem", 177 "ca-private-key-path": "cakey2.pem",
161 }, 178 },
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 c.Assert(toolsURL, gc.Equals, expectedToolsURLValue) 1003 c.Assert(toolsURL, gc.Equals, expectedToolsURLValue)
987 c.Assert(urlPresent, jc.IsTrue) 1004 c.Assert(urlPresent, jc.IsTrue)
988 c.Assert(oldToolsURL, gc.Equals, expectedToolsURLValue) 1005 c.Assert(oldToolsURL, gc.Equals, expectedToolsURLValue)
989 c.Assert(oldURLPresent, jc.IsTrue) 1006 c.Assert(oldURLPresent, jc.IsTrue)
990 } else { 1007 } else {
991 c.Assert(urlPresent, jc.IsFalse) 1008 c.Assert(urlPresent, jc.IsFalse)
992 c.Assert(oldURLAttrPresent, jc.IsFalse) 1009 c.Assert(oldURLAttrPresent, jc.IsFalse)
993 c.Assert(oldToolsURL, gc.Equals, "") 1010 c.Assert(oldToolsURL, gc.Equals, "")
994 } 1011 }
995 1012
996 » useLxcClone, ok := cfg.LXCUseClone() 1013 » useLxcClone, useLxcClonePresent := cfg.LXCUseClone()
1014 » oldUseClone, oldUseClonePresent := cfg.AllAttrs()["lxc-use-clone"]
997 if v, ok := test.attrs["lxc-clone"]; ok { 1015 if v, ok := test.attrs["lxc-clone"]; ok {
998 c.Assert(useLxcClone, gc.Equals, v) 1016 c.Assert(useLxcClone, gc.Equals, v)
1017 c.Assert(useLxcClonePresent, jc.IsTrue)
999 } else { 1018 } else {
1000 » » c.Assert(useLxcClone, gc.Equals, false) 1019 » » if oldUseClonePresent {
1020 » » » c.Assert(useLxcClonePresent, jc.IsTrue)
1021 » » » c.Assert(useLxcClone, gc.Equals, oldUseClone)
1022 » » } else {
1023 » » » c.Assert(useLxcClonePresent, jc.IsFalse)
1024 » » » c.Assert(useLxcClone, gc.Equals, false)
1025 » » }
1001 } 1026 }
1002 useLxcCloneAufs, ok := cfg.LXCUseCloneAUFS() 1027 useLxcCloneAufs, ok := cfg.LXCUseCloneAUFS()
1003 if v, ok := test.attrs["lxc-clone-aufs"]; ok { 1028 if v, ok := test.attrs["lxc-clone-aufs"]; ok {
1004 c.Assert(useLxcCloneAufs, gc.Equals, v) 1029 c.Assert(useLxcCloneAufs, gc.Equals, v)
1005 } else { 1030 } else {
1006 c.Assert(useLxcCloneAufs, gc.Equals, false) 1031 c.Assert(useLxcCloneAufs, gc.Equals, false)
1007 } 1032 }
1008 } 1033 }
1009 1034
1010 func (test configTest) assertDuration(c *gc.C, name string, actual time.Duration , defaultInSeconds int) { 1035 func (test configTest) assertDuration(c *gc.C, name string, actual time.Duration , defaultInSeconds int) {
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 -----BEGIN RSA PRIVATE KEY----- 1497 -----BEGIN RSA PRIVATE KEY-----
1473 MIIBOgIBAAJAZabKgKInuOxj5vDWLwHHQtK3/45KB+32D15w94Nt83BmuGxo90lw 1498 MIIBOgIBAAJAZabKgKInuOxj5vDWLwHHQtK3/45KB+32D15w94Nt83BmuGxo90lw
1474 -----END RSA PRIVATE KEY----- 1499 -----END RSA PRIVATE KEY-----
1475 `[1:] 1500 `[1:]
1476 1501
1477 var invalidCACert = ` 1502 var invalidCACert = `
1478 -----BEGIN CERTIFICATE----- 1503 -----BEGIN CERTIFICATE-----
1479 MIIBOgIBAAJAZabKgKInuOxj5vDWLwHHQtK3/45KB+32D15w94Nt83BmuGxo90lw 1504 MIIBOgIBAAJAZabKgKInuOxj5vDWLwHHQtK3/45KB+32D15w94Nt83BmuGxo90lw
1480 -----END CERTIFICATE----- 1505 -----END CERTIFICATE-----
1481 `[1:] 1506 `[1:]
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b