summaryrefslogtreecommitdiffstats
path: root/ansible/test
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/test
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/test')
-rw-r--r--ansible/test/roles/prepare-application/defaults/main.yml4
-rw-r--r--ansible/test/roles/prepare-application/tasks/main.yml25
2 files changed, 20 insertions, 9 deletions
diff --git a/ansible/test/roles/prepare-application/defaults/main.yml b/ansible/test/roles/prepare-application/defaults/main.yml
index 227bd4f0..c3883c65 100644
--- a/ansible/test/roles/prepare-application/defaults/main.yml
+++ b/ansible/test/roles/prepare-application/defaults/main.yml
@@ -1,4 +1,6 @@
---
simulate_helm: true
app_helm_charts_install_directory: application/helm_charts
-helm_simulation_output_file: /tmp/helm_simu_output \ No newline at end of file
+helm_simulation_output_file: /tmp/helm_simu_output
+application_pre_install_role: application/test-patch-role
+application_post_install_role: application/test-patch-role
diff --git a/ansible/test/roles/prepare-application/tasks/main.yml b/ansible/test/roles/prepare-application/tasks/main.yml
index 2f143a07..75abb802 100644
--- a/ansible/test/roles/prepare-application/tasks/main.yml
+++ b/ansible/test/roles/prepare-application/tasks/main.yml
@@ -1,9 +1,14 @@
---
-- name: Create Application helm charts directory
+- name: Create application role mocked artifacts directories
file:
- path: "{{ app_helm_charts_install_directory }}"
+ path: "{{ item }}"
state: directory
delegate_to: localhost
+ loop:
+ - "{{ app_helm_charts_install_directory }}"
+ - certs
+ - "{{ application_pre_install_role + '/tasks/' }}"
+ - "{{ application_post_install_role + '/tasks/' }}"
- name: Create Makefile to simulate helm charts dir and make building
copy:
@@ -33,15 +38,19 @@
name: make
state: present
-- name: Create local certs dir for dummy certs
- file:
- path: certs
- state: directory
- delegate_to: localhost
-
- name: Create dummy cert file to simulate offline server certificates in helm install with override.yml file
copy:
content: |
this is dummy server certificate value
dest: certs/rootCA.crt
delegate_to: localhost
+
+- name: Create test patch role files
+ copy:
+ content: |
+ ---
+ - name: Mocked up patch role
+ debug:
+ msg: "Noop task to mock up patch role"
+ dest: application/test-patch-role/tasks/main.yml
+ delegate_to: localhost