The model-defaults command is not well tested

Bug #1634515 reported by Curtis Hovey
4
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_model_defaults.py written to test the expected behaviour. We have a long outline of an example of manual test that can be scripted.

Tags: eda gap
Revision history for this message
Curtis Hovey (sinzui) wrote :
Download full text (7.9 KiB)

# 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
    # output elided except some bits to show expected values
    Attribute From Value
    ...
    default-series controller xenial
    development default false
    enable-os-upgrade controller false
    ...
    no-proxy model https://local
    ...

Let's add a model in us-east-1 to make sure it correctly inherits.

    $ juju add-model east1 us-east-1
    $ juju model-config
    Attribute From Value
    ...
    default-series controller xenial
    development default false
    enable-os-upgrade controller false
    ...
    no-proxy region https://foo-east
    ...

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
    $ juju model-config
    Attribute From Value
    ...
    default-series model trusty
    development model true
    enable-os-upgrade controller false
    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
    $ juju model-config
    Attribute From Value
    ...
    default-series controller xenial
    development default false
    ...
    no-proxy region https://foo-west
    ...

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
    $ juju model-config --reset development,default-series,no-proxy \
        apt-ftp-proxy=some-proxy
    $ juju model-config
    Attribute From Value
    ...
    apt-ftp-proxy model some-proxy
    ...
    default-series controller xenial
    development default false
    no-proxy region https://foo-east
    ...

## 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 ...

Read more...

tags: added: eda
Curtis Hovey (sinzui)
Changed in juju-ci-tools:
assignee: nobody → viswesuwara nathan (viswesn)
description: updated
Revision history for this message
viswesuwara nathan (viswesn) wrote :

I will start working on this bug. Thanks

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.