diff --git a/tests/integration/targets/horizon_centralized_enroll/tasks/main.yml b/tests/integration/targets/horizon_centralized_enroll/tasks/main.yml index 4e8dd5c..c2359f2 100644 --- a/tests/integration/targets/horizon_centralized_enroll/tasks/main.yml +++ b/tests/integration/targets/horizon_centralized_enroll/tasks/main.yml @@ -48,6 +48,14 @@ label-2: "ansible" ignore_errors: yes + register: error1 + +# Check error +- name: Check error1 + assert: + that: + - error1 is failed + - "'Profile does not exist or is disabled' in error1.msg" - name: Test centralize enrollment with wrong key_type @@ -70,6 +78,14 @@ label-2: "ansible" ignore_errors: yes + register: error2 + +# Check error +- name: Check error2 + assert: + that: + - error2 is failed + - "'Invalid key type' in error2.msg" - name: Test centralize enrollment with unexistant label @@ -93,3 +109,11 @@ label-2: "ansible" ignore_errors: yes + register: error3 + +# Check error +- name: Check error3 + assert: + that: + - error3 is failed + - "'Profile does not exist or is disabled' in error3.msg" diff --git a/tests/integration/targets/horizon_certificate_feed/tasks/main.yml b/tests/integration/targets/horizon_certificate_feed/tasks/main.yml index eac6d65..54e6c55 100644 --- a/tests/integration/targets/horizon_certificate_feed/tasks/main.yml +++ b/tests/integration/targets/horizon_certificate_feed/tasks/main.yml @@ -23,6 +23,15 @@ ip: 0.0.0.1 ignore_errors: yes + register: error1 + +# Check error +- name: Check error1 + assert: + that: + - error1 is failed + - "'Missing discovery campaign' in error1.msg" + - name: Feed a certificate without ip evertrust.horizon.horizon_feed: @@ -35,4 +44,13 @@ src: "/PEM.pem" campaign: "Ansible" - ignore_errors: yes \ No newline at end of file + ignore_errors: yes + register: error2 + +# Check error +- name: Check error2 + assert: + that: + - error2 is failed + - "'Missing certificate' in error2.msg" + - "'host ip' in error2.msg" \ No newline at end of file diff --git a/tests/integration/targets/horizon_certificate_update/tasks/main.yml b/tests/integration/targets/horizon_certificate_update/tasks/main.yml index 155830c..78fc27a 100644 --- a/tests/integration/targets/horizon_certificate_update/tasks/main.yml +++ b/tests/integration/targets/horizon_certificate_update/tasks/main.yml @@ -30,6 +30,15 @@ team: "UnknownTeam" ignore_errors: yes + register: error1 + +# Check error +- name: Check error1 + assert: + that: + - error1 is failed + - "'Team' in error1.msg" + - "'is not authorized' in error1.msg" - name: Update with unexistant label @@ -47,4 +56,13 @@ team: "TeamB" - ignore_errors: yes \ No newline at end of file + ignore_errors: yes + register: error2 + +# Check error +- name: Check error2 + assert: + that: + - error2 is failed + - "'Label element' in error2.msg" + - "'is not authorized' in error2.msg" \ No newline at end of file diff --git a/tests/integration/targets/horizon_decentralized_enroll/tasks/main.yml b/tests/integration/targets/horizon_decentralized_enroll/tasks/main.yml index 78eb008..36c313d 100644 --- a/tests/integration/targets/horizon_decentralized_enroll/tasks/main.yml +++ b/tests/integration/targets/horizon_decentralized_enroll/tasks/main.yml @@ -79,4 +79,12 @@ wrongCSR -----END CERTIFICATE REQUEST----- - ignore_errors: yes \ No newline at end of file + ignore_errors: yes + register: error1 + +# Check error +- name: Check error1 + assert: + that: + - error1 is failed + - "'Could not parse provided PEM' in error1.msg" \ No newline at end of file diff --git a/tests/integration/targets/horizon_revoke_certificate/tasks/main.yml b/tests/integration/targets/horizon_revoke_certificate/tasks/main.yml index 56ce601..9eac9a6 100644 --- a/tests/integration/targets/horizon_revoke_certificate/tasks/main.yml +++ b/tests/integration/targets/horizon_revoke_certificate/tasks/main.yml @@ -24,4 +24,11 @@ revocation_reason: "unspecified" ignore_errors: yes - \ No newline at end of file + register: error1 + +# Check error +- name: Check error1 + assert: + that: + - error1 is failed + - "'Certificate is already revoked' in error1.msg" \ No newline at end of file