From ba86279f8f95b4283dc8e95941f0882e3e05ed50 Mon Sep 17 00:00:00 2001 From: Simon Stone Date: Thu, 18 Jun 2020 12:06:34 +0100 Subject: [PATCH] Separate out timeouts into CI configuration (contributes to #71) Signed-off-by: Simon Stone --- tests/integration/integration_config.yml | 2 ++ .../certificate_authority/tasks/main.yml | 27 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/tests/integration/integration_config.yml b/tests/integration/integration_config.yml index 6e610044..a0ee420d 100644 --- a/tests/integration/integration_config.yml +++ b/tests/integration/integration_config.yml @@ -6,6 +6,8 @@ api_endpoint: https://ibp-console.example.org:32000 api_authtype: basic api_key: xxxxxxxx api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +api_timeout: 60 k8s_namespace: ibp test_run_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx short_test_run_id: xxxxxxxx +wait_timeout: 600 diff --git a/tests/integration/targets/certificate_authority/tasks/main.yml b/tests/integration/targets/certificate_authority/tasks/main.yml index a34545a8..ed917dc1 100644 --- a/tests/integration/targets/certificate_authority/tasks/main.yml +++ b/tests/integration/targets/certificate_authority/tasks/main.yml @@ -9,6 +9,7 @@ api_authtype: "{{ api_authtype | mandatory }}" api_key: "{{ api_key | mandatory }}" api_secret: "{{ api_secret | mandatory }}" + api_timeout: "{{ api_timeout | mandatory }}" ca_name: "Test CA {{ short_test_run_id }}" ca_config_override: ca: @@ -29,7 +30,7 @@ hf.AffiliationMgr: true k8s_namespace: "{{ k8s_namespace | mandatory }}" k8s_name: "testca{{ short_test_run_id }}" - wait_timeout: 600 + wait_timeout: "{{ wait_timeout | mandatory }}" - name: Run tests block: @@ -95,6 +96,30 @@ expected_storage_class: default expected_storage_size: 20Gi + - name: Ensure idempotency + ibm.blockchain_platform.certificate_authority: + state: present + <<: *ibp_connection_info + name: "{{ ca_name }}" + config_override: "{{ ca_config_override }}" + resources: + ca: + requests: + cpu: 200m + memory: 400M + wait_timeout: "{{ wait_timeout }}" + register: result + + - include_tasks: assertions.yml + vars: + expected_change: no + expected_enrollment_id: admin + expected_enrollment_secret: adminpw + expected_cpu: 200m + expected_memory: 400M + expected_storage_class: default + expected_storage_size: 20Gi + always: - name: Delete certificate authority ibm.blockchain_platform.certificate_authority: