-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add molecule test to ovn_bgp_agent component
- Loading branch information
Fernando Royo
committed
Nov 3, 2023
1 parent
ebe1621
commit 00349d2
Showing
6 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
roles/edpm_ovn_bgp_agent/molecule/default/molecule copy.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
- name: Verify ovn_bgp_agent | ||
gather_facts: false | ||
hosts: compute-1 | ||
vars: | ||
test_helper_dir: "../../../../molecule/test-helpers" | ||
tasks: | ||
- name: ensure expected directories exist | ||
ansible.builtin.include_tasks: "{{test_helper_dir}}/verify_dir.yaml" | ||
loop: | ||
- "/var/lib/config-data/ansible-generated/ovn-bgp-agent/etc/ovn-bgp-agent/bgp-agent.conf" | ||
- "/var/log/containers/ovn-bgp-agent" | ||
- "/var/lib/edpm-config/container-startup-config/ovn_bgp_agent" | ||
|
||
- name: ensure systemd services are defined and functional | ||
ansible.builtin.include_tasks: "{{test_helper_dir}}/verify_systemd_unit.yaml" | ||
loop: | ||
- {"name": "edpm_ovn_bgp_agent.service"} | ||
|
||
- name: ensure podman container exists and are running | ||
ansible.builtin.include_tasks: "{{test_helper_dir}}/verify_podman.yaml" | ||
loop: | ||
- "ovn_bgp_agent" | ||
|
||
- name: ensure that log file for ovn_bgp_agent exist | ||
become: true | ||
block: | ||
- name: Check if file /var/log/containers/stdouts/ovn_bgp_agent.log exist | ||
ansible.builtin.stat: | ||
path: /var/log/containers/stdouts/ovn_bgp_agent.log | ||
register: log_file | ||
- name: Assert file /var/log/containers/stdouts/ovn_bgp_agent.log exist | ||
ansible.builtin.assert: | ||
that: | ||
- log_file.stat.exists | ||
fail_msg: "File /vvar/log/containers/stdouts/ovn_bgp_agent.log does not exist" | ||
|
||
- name: Ensure that 10-ovn_bgp_agent.conf was copied into the container | ||
block: | ||
- name: ovn_bgp_agent config file exists | ||
become: true | ||
ansible.builtin.stat: | ||
path: "/var/lib/config-data/ansible-generated/ovn-bgp-agent/etc/ovn-bgp-agent/10-ovn-bgp-agent.conf" | ||
register: ovn_bgp_agent_config | ||
|
||
- name: assert that the config exists | ||
ansible.builtin.assert: | ||
that: | ||
- ovn_bgp_agent_config.stat.exists | ||
fail_msg: "ovn_bgp_agent config file does not exist" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ scenario: | |
- create | ||
- prepare | ||
- converge | ||
- verify | ||
- destroy | ||
verifier: | ||
name: ansible |
15 changes: 15 additions & 0 deletions
15
roles/edpm_ovn_bgp_agent/molecule/default/test-data/10-ovn-bgp-agent.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[DEFAULT] | ||
debug=True | ||
reconcile_interval=300 | ||
expose_tenant_networks=True | ||
expose_ipv6_gua_tenant_networks=False | ||
driver=ovn_bgp_driver | ||
bgp_AS=64999 | ||
bgp_nic=bgp-nic | ||
bgp_vrf=bgp-vrf | ||
bgp_vrf_table_id=10 | ||
ovsdb_connection=tcp:127.0.0.1:6640 | ||
|
||
[agent] | ||
root_helper=sudo ovn-bgp-agent-rootwrap /etc/ovn-bgp-agent/rootwrap.conf | ||
root_helper_daemon=sudo ovn-bgp-agent-rootwrap-daemon /etc/ovn-bgp-agent/rootwrap.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters