Skip to content

Commit

Permalink
Add functional test for openrc
Browse files Browse the repository at this point in the history
  • Loading branch information
fnordahl committed Oct 1, 2020
1 parent e491615 commit 396e958
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 6 deletions.
76 changes: 70 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,73 @@
---
sudo: false
language: python
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
install: pip install tox-travis
script: tox -e lint
matrix:
include:
- python: 3.5
env: ENV=lint
- python: 3.6
env: ENV=lint
- python: 3.7
env: ENV=lint
- python: 3.8
env: ENV=lint
- name: pip-clients-openrc-with-tls
env: ENV=func
sudo: required
dist: focal
addons:
snaps:
- name: juju
confinement: classic
install:
- pip install tox-travis openstackclient
- name: pip-clients-openrc-no-tls
env: ENV=func-smoke
sudo: required
dist: focal
addons:
snaps:
- name: juju
confinement: classic
install:
- pip install tox-travis openstackclient
- name: snap-clients-openrc-with-tls
env: ENV=func
sudo: required
dist: focal
addons:
snaps:
- name: juju
confinement: classic
- name: openstackclients
channel: edge
- name: snap-clients-openrc-no-tls
env: ENV=func-smoke
sudo: required
dist: focal
addons:
snaps:
- name: juju
confinement: classic
- name: openstackclients
channel: edge
comment: |
install dependencies in script phase saving time on simpler test environments
change permissions on lxd socket to allow travis user access
(^^ this is a throw-away CI environment, do not do this at home)
script:
- if [ $ENV = 'func' -o $ENV = 'func-smoke' ]; then
sudo lxd init --auto;
sudo chmod 666 /var/snap/lxd/common/lxd/unix.socket;
travis_wait juju bootstrap --no-gui localhost;
travis_wait tox -c rcs/tox.ini -e $ENV;
juju switch $(juju models --format yaml|grep "^- name:.*zaza"|cut -f2 -d/);
juju status;
source rcs/openrc;
env | grep OS_;
openstack --debug token issue;
openstack catalog list;
else
tox -e $ENV;
fi
3 changes: 3 additions & 0 deletions rcs/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# zaza
git+https://github.com/openstack-charmers/zaza.git#egg=zaza
git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
26 changes: 26 additions & 0 deletions rcs/tests/bundles/bundle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
series: focal
relations:
- - keystone-mysql-router:db-router
- mysql-innodb-cluster:db-router
- - vault-mysql-router:db-router
- mysql-innodb-cluster:db-router
- - keystone:shared-db
- keystone-mysql-router:shared-db
- - vault:shared-db
- vault-mysql-router:shared-db
- - keystone:certificates
- vault:certificates
applications:
mysql-innodb-cluster:
charm: cs:~openstack-charmers-next/mysql-innodb-cluster
num_units: 3
keystone-mysql-router:
charm: cs:~openstack-charmers-next/mysql-router
keystone:
charm: cs:~openstack-charmers-next/keystone
num_units: 1
vault-mysql-router:
charm: cs:~openstack-charmers-next/mysql-router
vault:
charm: cs:~openstack-charmers-next/vault
num_units: 1
13 changes: 13 additions & 0 deletions rcs/tests/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
tests:
- zaza.charm_tests.noop.tests.NoopTest
configure:
- tls:
- zaza.openstack.charm_tests.vault.setup.auto_initialize_no_validation
target_deploy_status:
vault:
workload-status: blocked
workload-status-message: Vault needs to be initialized
gate_bundles:
- tls: bundle
smoke_bundles:
- bundle
25 changes: 25 additions & 0 deletions rcs/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[tox]
envlist = func-smoke
skipsdist = True

[testenv]
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
whitelist_externals = juju
passenv = HOME TERM CS_* OS_*
deps = -r{toxinidir}/test-requirements.txt
install_command =
pip install {opts} {packages}

[testenv:func]
basepython = python3
commands =
functest-run-suite --keep-model

[testenv:func-smoke]
basepython = python3
commands =
functest-run-suite --keep-model --smoke

[testenv:venv]
commands = {posargs}

0 comments on commit 396e958

Please sign in to comment.