Added assertions on endpoint module results

Signed-off-by: Jakob Meng <code@jakobmeng.de>
Change-Id: If8befd62ac59ef19debf0d63abe76f11b47c2da3
This commit is contained in:
Jakob Meng 2022-07-12 10:39:33 +02:00
parent a120db2d60
commit 070e77feca
2 changed files with 14 additions and 2 deletions
ci/roles/endpoint
defaults
tasks

@ -0,0 +1,9 @@
expected_fields:
- id
- interface
- is_enabled
- links
- name
- region_id
- service_id
- url

@ -9,10 +9,13 @@
state: present state: present
register: endpoint_test register: endpoint_test
- name: Ensure service endpoint was created - debug: var=endpoint_test
- name: Assert return values of endpoint module
assert: assert:
that: that:
- endpoint_test.endpoint.id is defined # allow new fields to be introduced but prevent fields from being removed
- expected_fields|difference(endpoint_test.endpoint.keys())|length == 0
- name: Ensure service have the proper endpoint - name: Ensure service have the proper endpoint
assert: assert: