summaryrefslogtreecommitdiffstats
path: root/ansible/roles/application/molecule
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-06-05 09:32:29 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-06-05 09:44:18 +0200
commit464ac374b9c38d3cb2e1910853b4a890bbacf35c (patch)
tree1a88dbd792b9d6e15080ea039a763cb744f90da5 /ansible/roles/application/molecule
parentdf7d7cc1294c6ea1fcab2ed4ac2ee7c375b29651 (diff)
Add custom patch role scenario to 'application' role
This adds test case for when application_pre_install_role and application_post_install_role are set to custom role; by default they are empty. Code condition coverage is increased. Change-Id: I14e59e15cf3ead0459374b5777f8ee03fe75d7bd Issue-ID: OOM-1910 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible/roles/application/molecule')
l---------ansible/roles/application/molecule/custom_role/Dockerfile.j21
-rw-r--r--ansible/roles/application/molecule/custom_role/molecule.yml54
l---------ansible/roles/application/molecule/custom_role/tests1
-rw-r--r--ansible/roles/application/molecule/default/molecule.yml2
4 files changed, 56 insertions, 2 deletions
diff --git a/ansible/roles/application/molecule/custom_role/Dockerfile.j2 b/ansible/roles/application/molecule/custom_role/Dockerfile.j2
new file mode 120000
index 00000000..867ec5c3
--- /dev/null
+++ b/ansible/roles/application/molecule/custom_role/Dockerfile.j2
@@ -0,0 +1 @@
+../default/Dockerfile.j2 \ No newline at end of file
diff --git a/ansible/roles/application/molecule/custom_role/molecule.yml b/ansible/roles/application/molecule/custom_role/molecule.yml
new file mode 100644
index 00000000..5356b197
--- /dev/null
+++ b/ansible/roles/application/molecule/custom_role/molecule.yml
@@ -0,0 +1,54 @@
+---
+dependency:
+ name: galaxy
+driver:
+ name: docker
+lint:
+ name: yamllint
+platforms:
+ - name: instance
+ image: centos:7
+provisioner:
+ name: ansible
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../test/roles
+ inventory:
+ group_vars:
+ all:
+ app_name: moleculetestapp
+ app_data_path: "/opt/{{ app_name }}"
+ app_helm_release_name: "{{ app_name }}"
+ app_kubernetes_namespace: "{{ app_name }}"
+ app_helm_charts_install_directory: application/helm_charts
+ app_helm_plugins_directory: "{{ app_helm_charts_install_directory}}/helm/plugins/"
+ app_helm_charts_infra_directory: "{{ app_data_path }}/helm_charts"
+ helm_bin_dir: /usr/local/bin
+ app_helm_build_targets:
+ - all
+ - onap
+ app_helm_chart_name: "{{ app_name }}"
+ application_pre_install_role: application/test-patch-role
+ application_post_install_role: application/test-patch-role
+ lint:
+ name: ansible-lint
+ playbooks:
+ prepare: ../default/prepare.yml
+ converge: ../default/playbook.yml
+scenario:
+ name: custom_role
+ test_sequence:
+ - lint
+ - cleanup
+ - destroy
+ - dependency
+ - syntax
+ - create
+ - prepare
+ - converge
+ - verify
+ - cleanup
+ - destroy
+verifier:
+ name: testinfra
+ lint:
+ name: flake8
diff --git a/ansible/roles/application/molecule/custom_role/tests b/ansible/roles/application/molecule/custom_role/tests
new file mode 120000
index 00000000..b8ac4407
--- /dev/null
+++ b/ansible/roles/application/molecule/custom_role/tests
@@ -0,0 +1 @@
+../default/tests/ \ No newline at end of file
diff --git a/ansible/roles/application/molecule/default/molecule.yml b/ansible/roles/application/molecule/default/molecule.yml
index 8f19d7ff..30c752e2 100644
--- a/ansible/roles/application/molecule/default/molecule.yml
+++ b/ansible/roles/application/molecule/default/molecule.yml
@@ -27,8 +27,6 @@ provisioner:
- all
- onap
app_helm_chart_name: "{{ app_name }}"
- application_pre_install_role:
- application_post_install_role:
lint:
name: ansible-lint
scenario: