diff --git a/test/integration/ovs.yaml b/test/integration/ovs.yaml new file mode 100644 index 00000000000..f3f812673ab --- /dev/null +++ b/test/integration/ovs.yaml @@ -0,0 +1,12 @@ +--- +- hosts: ovs + gather_facts: no + remote_user: ubuntu + become: yes + + vars: + limit_to: "*" + debug: false + + roles: + - { role: openvswitch_db, when: "limit_to in ['*', 'openvswitch_db']" } diff --git a/test/integration/targets/openvswitch_db/aliases b/test/integration/targets/openvswitch_db/aliases new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/integration/targets/openvswitch_db/defaults/main.yaml b/test/integration/targets/openvswitch_db/defaults/main.yaml new file mode 100644 index 00000000000..9ef5ba51651 --- /dev/null +++ b/test/integration/targets/openvswitch_db/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +testcase: "*" +test_items: [] diff --git a/test/integration/targets/openvswitch_db/meta/main.yaml b/test/integration/targets/openvswitch_db/meta/main.yaml new file mode 100644 index 00000000000..20d55f506f8 --- /dev/null +++ b/test/integration/targets/openvswitch_db/meta/main.yaml @@ -0,0 +1,2 @@ +dependencies: + - prepare_ovs_tests diff --git a/test/integration/targets/openvswitch_db/tasks/main.yml b/test/integration/targets/openvswitch_db/tasks/main.yml new file mode 100644 index 00000000000..306d99c801f --- /dev/null +++ b/test/integration/targets/openvswitch_db/tasks/main.yml @@ -0,0 +1,16 @@ +--- + +- name: collect all test cases + find: + paths: "{{ role_path }}/tests" + patterns: "{{ testcase }}.yaml" + register: test_cases + +- name: set test_items + set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + +- name: run test case + include: "{{ test_case_to_run }}" + with_items: "{{ test_items }}" + loop_control: + loop_var: test_case_to_run diff --git a/test/integration/targets/openvswitch_db/tests/basic.yaml b/test/integration/targets/openvswitch_db/tests/basic.yaml new file mode 100644 index 00000000000..1f2a3345509 --- /dev/null +++ b/test/integration/targets/openvswitch_db/tests/basic.yaml @@ -0,0 +1,25 @@ +--- + +- command: ovs-vsctl add-br br-test + +- openvswitch_db: + table: Bridge + record: br-test + col: other_config + key: disable-in-band + value: true + +- openvswitch_db: + table: Bridge + record: br-test + col: other_config + key: disable-in-band + value: false + +- openvswitch_db: + table: Bridge + record: br-test + col: other_config + key: disable-in-band + value: false + state: absent diff --git a/test/integration/targets/prepare_ovs_tests/tasks/main.yml b/test/integration/targets/prepare_ovs_tests/tasks/main.yml new file mode 100644 index 00000000000..92d86b85c48 --- /dev/null +++ b/test/integration/targets/prepare_ovs_tests/tasks/main.yml @@ -0,0 +1,15 @@ +--- + +- name: Install openvswitch-switch package if we are on Ubuntu + apt: + name: openvswitch-switch + state: installed + update_cache: yes + when: ansible_distribution == 'Ubuntu' + +- name: Install openvswitch package if we are on Fedora + yum: + name: openvswitch + state: installed + update_cache: yes + when: ansible_distribution == 'Fedora'