The model-defaults command is not well tested
Bug #1634515 reported by
Curtis Hovey
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-ci-tools |
Triaged
|
High
|
viswesuwara nathan |
Bug Description
The model-defaults command was introduced to provide common defaults for all models manages by a controller. The feature is not directly tested.
We want a new assess named assess_
tags: | added: eda |
Changed in juju-ci-tools: | |
assignee: | nobody → viswesuwara nathan (viswesn) |
description: | updated |
To post a comment you must log in.
# Shared Model Config QA #
## Common steps ##
$ juju add-cloud awstest ~/Sync/ juju/2. 0/dev-clouds. yaml
$ juju bootstrap awstest reed/aws/us-west-1
## Testing modelconfig ##
Test that we get defaults from our configuration. Here we get the controller
level setting at the model level for no-proxy since this is our default model.
We get xenial as our default series as set in the controller config and
development is set to false which comes from the provider default config.
$ juju model-config os-upgrade controller false /local
# output elided except some bits to show expected values
Attribute From Value
...
default-series controller xenial
development default false
enable-
...
no-proxy model https:/
...
Let's add a model in us-east-1 to make sure it correctly inherits.
$ juju add-model east1 us-east-1 os-upgrade controller false /foo-east
$ juju model-config
Attribute From Value
...
default-series controller xenial
development default false
enable-
...
no-proxy region https:/
...
Then we set some values and verify they are set and that the source of the
settings are correctly updated.
$ juju model-config no-proxy=not-east development=true default- series= trusty os-upgrade controller false
$ juju model-config
Attribute From Value
...
default-series model trusty
development model true
enable-
firewall-mode default instance
...
no-proxy model not-east
...
Now if we create a model in us-west-1 and ensure it has it's own settings.
$ juju add-model west1 us-west-1 /foo-west
$ juju model-config
Attribute From Value
...
default-series controller xenial
development default false
...
no-proxy region https:/
...
Switching back to the east we can reset settings, and then verify we get our
original defaults back. Fo good measure we also set another setting here to
ensure that we can set and reset at the same time...
$ juju switch east1 default- series, no-proxy \
apt-ftp- proxy=some- proxy /foo-east
$ juju model-config --reset development,
$ juju model-config
Attribute From Value
...
apt-ftp-proxy model some-proxy
...
default-series controller xenial
development default false
no-proxy region https:/
...
## Model Defaults Testing ##
Let's kill the models and start over for model-defaults
$ juju destroy-model east1 -y
$ juju destroy-model west1 -y
Let's make sure the defaults have loaded correctly when we created our
controller.
$ juju model-defaults
Attribute ...