コード例 #1
0
ファイル: config_test.go プロジェクト: bac/juju
		about:       "set-numa-control-policy off",
		useDefaults: config.UseDefaults,
		attrs: minimalConfigAttrs.Merge(testing.Attrs{
			"set-numa-control-policy": false,
		}),
	}, {
		about:       "Invalid agent version",
		useDefaults: config.UseDefaults,
		attrs: minimalConfigAttrs.Merge(testing.Attrs{
			"agent-version": "2",
		}),
		err: `invalid agent version in model configuration: "2"`,
	}, {
		about:       "Missing type",
		useDefaults: config.UseDefaults,
		attrs:       minimalConfigAttrs.Delete("type"),
		err:         "type: expected string, got nothing",
	}, {
		about:       "Empty type",
		useDefaults: config.UseDefaults,
		attrs: minimalConfigAttrs.Merge(testing.Attrs{
			"type": "",
		}),
		err: "empty type in model configuration",
	}, {
		about:       "Missing name",
		useDefaults: config.UseDefaults,
		attrs:       minimalConfigAttrs.Delete("name"),
		err:         "name: expected string, got nothing",
	}, {
		about:       "Bad name, no slash",
コード例 #2
0
ファイル: config_test.go プロジェクト: klyachin/juju
		attrs:       sampleConfig.Merge(testing.Attrs{"ca-cert-path": "arble"}),
		err:         `attribute "ca-cert-path" is not allowed in configuration`,
	}, {
		about:       "No defaults: with ca-private-key-path",
		useDefaults: config.NoDefaults,
		attrs:       sampleConfig.Merge(testing.Attrs{"ca-private-key-path": "arble"}),
		err:         `attribute "ca-private-key-path" is not allowed in configuration`,
	}, {
		about:       "No defaults: with authorized-keys-path",
		useDefaults: config.NoDefaults,
		attrs:       sampleConfig.Merge(testing.Attrs{"authorized-keys-path": "arble"}),
		err:         `attribute "authorized-keys-path" is not allowed in configuration`,
	}, {
		about:       "No defaults: missing authorized-keys",
		useDefaults: config.NoDefaults,
		attrs:       sampleConfig.Delete("authorized-keys"),
		err:         `authorized-keys missing from environment configuration`,
	}, {
		about:       "Config settings from juju 1.13.3 actual installation",
		useDefaults: config.NoDefaults,
		attrs: map[string]interface{}{
			"name":                      "sample",
			"development":               false,
			"admin-secret":              "",
			"ssl-hostname-verification": true,
			"authorized-keys":           "ssh-rsa mykeys rog@rog-x220\n",
			"control-bucket":            "rog-some-control-bucket",
			"region":                    "us-east-1",
			"image-metadata-url":        "",
			"ca-private-key":            "",
			"default-series":            "precise",
コード例 #3
0
ファイル: config_test.go プロジェクト: AlexisBruemmer/juju
	}, {
		summary: "changing region",
		config:  requiredConfig,
		change: testing.Attrs{
			"region": "otherregion",
		},
		err: `cannot change region from "configtest" to "otherregion"`,
	}, {
		summary: "invalid region",
		config: requiredConfig.Merge(testing.Attrs{
			"region": 666,
		}),
		err: `.*expected string, got int\(666\)`,
	}, {
		summary: "missing region in model",
		config:  requiredConfig.Delete("region"),
		err:     "missing region not valid",
	}, {
		summary: "invalid username",
		config: requiredConfig.Merge(testing.Attrs{
			"username": 666,
		}),
		err: `.*expected string, got int\(666\)`,
	}, {
		summary: "missing username in model",
		config:  requiredConfig.Delete("username"),
		err:     "missing username not valid",
	}, {
		summary: "invalid password",
		config: requiredConfig.Merge(testing.Attrs{
			"password": 666,