Browse Source

Merge "fix mixed up molecule tests" into stable/train

changes/66/759566/1
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
8fbd2867fe
3 changed files with 38 additions and 36 deletions
  1. +5
    -31
      roles/switch_vlans/molecule/default/converge.yml
  2. +31
    -5
      roles/tls_everywhere/molecule/default/converge.yml
  3. +2
    -0
      zuul.d/molecule.yaml

+ 5
- 31
roles/switch_vlans/molecule/default/converge.yml View File

@@ -17,36 +17,10 @@

- name: Converge
hosts: all
vars:
ipa_bin: echo
kinit_bin: echo
kdestroy_bin: echo
tls_everywhere_undercloud_fqdn: "undercloud.example.com"
tasks:
- name: Run ipa_server_check validation
block:
- name: run validation
include_role:
name: tls_everywhere
tasks_from: ipa-server-check
rescue:
- name: clear errors
meta: clear_host_errors

- name: check command outputs
assert:
that:
- tls_everywhere_aci_check_kinit_output == "host/undercloud.example.com -k -t /etc/krb5.keytab"
- tls_everywhere_aci_check_dns_record_show_output == "dnsrecord-show example.com freeipa-0"
- tls_everywhere_aci_check_service_show_output == "service-show nova/undercloud.example.com --all --raw"
- ipa_server_aci_check_kdestroy_output == "-A"
- ipa_server_aci_check_failures|length == 1
- '"Modify Realm Domains" in ipa_server_aci_check_failures[0]'
gather_facts: false

- name: End play
meta: end_play

- name: Fail the test
tasks:
- name: Warn developers about the lack of molecule testing
fail:
msg: |
The ipa-server-check validation didn't fail as expected
msg: >-
This role needs molecule tests!

+ 31
- 5
roles/tls_everywhere/molecule/default/converge.yml View File

@@ -17,10 +17,36 @@

- name: Converge
hosts: all
gather_facts: false

vars:
ipa_bin: echo
kinit_bin: echo
kdestroy_bin: echo
tls_everywhere_undercloud_fqdn: "undercloud.example.com"
tasks:
- name: Warn developers about the lack of molecule testing
- name: Run ipa_server_check validation
block:
- name: run validation
include_role:
name: tls_everywhere
tasks_from: ipa-server-check
rescue:
- name: clear errors
meta: clear_host_errors

- name: check command outputs
assert:
that:
- tls_everywhere_aci_check_kinit_output == "host/undercloud.example.com -k -t /etc/krb5.keytab"
- tls_everywhere_aci_check_dns_record_show_output == "dnsrecord-show example.com freeipa-0"
- tls_everywhere_aci_check_service_show_output == "service-show nova/undercloud.example.com --all --raw"
- ipa_server_aci_check_kdestroy_output == "-A"
- ipa_server_aci_check_failures|length == 1
- '"Modify Realm Domains" in ipa_server_aci_check_failures[0]'

- name: End play
meta: end_play

- name: Fail the test
fail:
msg: >-
This role needs molecule tests!
msg: |
The ipa-server-check validation didn't fail as expected

+ 2
- 0
zuul.d/molecule.yaml View File

@@ -16,6 +16,7 @@
- tripleo-validations-centos-8-molecule-rabbitmq_limits
- tripleo-validations-centos-8-molecule-repos
- tripleo-validations-centos-8-molecule-stonith_exists
- tripleo-validations-centos-8-molecule-tls_everywhere
- tripleo-validations-centos-8-molecule-undercloud_cpu
- tripleo-validations-centos-8-molecule-undercloud_debug
- tripleo-validations-centos-8-molecule-undercloud_disk_space
@@ -38,6 +39,7 @@
- tripleo-validations-centos-8-molecule-rabbitmq_limits
- tripleo-validations-centos-8-molecule-repos
- tripleo-validations-centos-8-molecule-stonith_exists
- tripleo-validations-centos-8-molecule-tls_everywhere
- tripleo-validations-centos-8-molecule-undercloud_cpu
- tripleo-validations-centos-8-molecule-undercloud_debug
- tripleo-validations-centos-8-molecule-undercloud_disk_space


Loading…
Cancel
Save