diff --git a/.travis.yml b/.travis.yml index f8546ac..a5ec759 100644 --- a/.travis.yml +++ b/.travis.yml @@ -126,6 +126,8 @@ jobs: # - env: INSTANCE=default-arch-base-latest-3000-3-py2 # - env: INSTANCE=upstart-centos-6-2019-2-py2 # - env: INSTANCE=upstart-amazonlinux-1-2019-2-py2 + - env: INSTANCE=mysql-debian-10-master-py3 + - env: INSTANCE=mysql-ubuntu-2004-master-py3 ## Define the release stage that runs `semantic-release` - stage: 'release' diff --git a/kitchen.yml b/kitchen.yml index 2929a05..9f0f385 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -214,3 +214,30 @@ suites: inspec_tests: - path: test/integration/_mapdata - path: test/integration/default + - name: mysql + includes: + - debian-10-master-py3 + - ubuntu-2004-master-py3 + provisioner: + state_top: + base: + '*': + - diaspora + - mysql + pillars: + top.sls: + base: + '*': + - diaspora + - tests + - mysql + pillars_from_files: + diaspora.sls: pillar.example + tests.sls: test/salt/pillar/tests.sls + mysql.sls: test/salt/pillar/mysql.sls + dependencies: + - name: mysql + path: test/salt/states + verifier: + inspec_tests: + - path: test/integration/default diff --git a/test/salt/pillar/mysql.sls b/test/salt/pillar/mysql.sls new file mode 100644 index 0000000..b8ace57 --- /dev/null +++ b/test/salt/pillar/mysql.sls @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +diaspora: + database: + type: mysql diff --git a/test/salt/states/mysql/init.sls b/test/salt/states/mysql/init.sls new file mode 100644 index 0000000..4f453ba --- /dev/null +++ b/test/salt/states/mysql/init.sls @@ -0,0 +1,26 @@ +mysql_package: + pkg.installed: + - pkgs: + - mariadb-server + - python3-mysqldb + +mysql_service: + service.running: + - name: mariadb + - require: + - pkg: mysql_package + +mysql_user: + mysql_user.present: + - name: {{ salt['pillar.get']('diaspora:database:username') }} + - password: {{ salt['pillar.get']('diaspora:database:password') }} + - require: + - service: mysql_service + mysql_grants.present: + - grant: all privileges + - database: {{ salt['pillar.get']('diaspora:database:database') }}.* + - user: {{ salt['pillar.get']('diaspora:database:username') }} + - require: + - mysql_user: mysql_user + - require_in: + - cmd: diaspora_create_database