Skip to content

Commit

Permalink
Improve integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienDucourthial committed May 30, 2024
1 parent 9f255df commit 3066c36
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -35,4 +44,13 @@
src: "/PEM.pem"
campaign: "Ansible"

ignore_errors: yes
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"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -47,4 +56,13 @@

team: "TeamB"

ignore_errors: yes
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"
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,12 @@
wrongCSR
-----END CERTIFICATE REQUEST-----
ignore_errors: yes
ignore_errors: yes
register: error1

# Check error
- name: Check error1
assert:
that:
- error1 is failed
- "'Could not parse provided PEM' in error1.msg"
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,11 @@
revocation_reason: "unspecified"

ignore_errors: yes

register: error1

# Check error
- name: Check error1
assert:
that:
- error1 is failed
- "'Certificate is already revoked' in error1.msg"

0 comments on commit 3066c36

Please sign in to comment.