The functional tests (tox -e func) of the keystone charm fail with the following traceback when the VIP IP address is not configured:
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined Traceback (most recent call last):
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/hooks/ha-relation-joined", line 862, in <module>
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined main()
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/hooks/ha-relation-joined", line 855, in main
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined hooks.execute(sys.argv)
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/charmhelpers/core/hookenv.py", line 914, in execute
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined self._hooks[hook_name]()
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/hooks/ha-relation-joined", line 558, in ha_joined
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined settings = generate_ha_relation_data('ks')
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/charmhelpers/contrib/openstack/ha/utils.py", line 181, in generate_ha_relation_data
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined update_hacluster_vip(service, _relation_data)
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/charmhelpers/contrib/openstack/ha/utils.py", line 280, in update_hacluster_vip
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined cluster_config = get_hacluster_config()
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/charmhelpers/contrib/hahelpers/cluster.py", line 305, in get_hacluster_config
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined if not valid_hacluster_config():
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined File "/var/lib/juju/agents/unit-keystone-1/charm/charmhelpers/contrib/hahelpers/cluster.py", line 329, in valid_hacluster_config
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined raise HAIncorrectConfig(msg)
unit-keystone-1: 15:01:42 DEBUG unit.keystone/1.ha-relation-joined charmhelpers.contrib.hahelpers.cluster.HAIncorrectConfig: HA: Either vip or dns-ha must be set but not both in order to use high availability
unit-keystone-1: 15:01:42 ERROR juju.worker.uniter.operation hook "ha-relation-joined" failed: exit status 1
This can be fixed by configuring the AMULET_OS_VIP00 environment variable before running the functional tests.
There's a PR in the zaza testing framework (https://github.com/openstack-charmers/zaza/pull/222/) to make template variables mandatory. I think the proper fix would be to use the feature from that PR to make AMULET_OS_VIP00 mandatory.
I tested with the https:/ /github. com/openstack- charmers/ zaza/pull/ 222/ PR without setting AMULET_OS_VIP00 and the test fails as expected:
$ tox -e func --workdir /tmp bundles/ trusty- mitaka. yaml' on to 'zaza-946d3f1a24bc' model bin/functest- run-suite --keep-model'
[...]
INFO:root:Deploying bundle './tests/
ERROR:root:Template error. You may be mmissinga mandatory environment variable : 'AMULET_OS_VIP00' is undefined
ERROR: InvocationError: '/tmp/func/
[...]
ERROR: func: commands failed
When I set the AMULET_OS_VIP00 var, the test proceeds normally.
I think we can close this bug once that PR is merged.