ansible/test/integration/targets/net_vrf/tests/junos/basic.yaml
Matt Martz 4fe08441be Deprecate tests used as filters (#32361)
* Warn on tests used as filters

* Update docs, add aliases for tests that fit more gramatically with test syntax

* Fix rst formatting

* Add successful filter, alias of success

* Remove renamed_deprecation, it was overkill

* Make directory alias for is_dir

* Update tests to use proper jinja test syntax

* Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax

* Add conversion script, porting guide updates, and changelog updates

* Update newly added uses of tests as filters

* No underscore variable

* Convert recent tests as filter changes to win_stat

* Fix some changes related to rebasing a few integration tests

* Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name

* Add test for tests_as_filters_warning

* Update tests as filters in newly added/modified tests

* Address recent changes to several integration tests

* Address recent changes in cs_vpc
2017-11-27 17:58:08 -05:00

201 lines
6 KiB
YAML

---
- debug: msg="START net_vrf junos/basic.yaml"
- name: setup - remove vrf
net_vrf:
name: test-1
state: absent
provider: "{{ netconf }}"
- name: Configure vrf and its parameter
net_vrf:
name: test-1
description: test-vrf-1
interfaces:
- ge-0/0/6
- ge-0/0/5
rd: 3.3.3.3:10
target: target:65513:111
state: present
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == true"
- result.diff.prepared is search("\+ *test-1")
- result.diff.prepared is search("\+ *description test-vrf-1")
- result.diff.prepared is search("\+ *instance-type vrf")
- result.diff.prepared is search("\+ *interface ge-0/0/5.0")
- result.diff.prepared is search("\+ *interface ge-0/0/6.0")
- result.diff.prepared is search("\+ *route-distinguisher 3.3.3.3:10")
- result.diff.prepared is search("\+ *vrf-target target:65513:111")
- name: Configure vrf and its parameter (idempotent)
net_vrf:
name: test-1
description: test-vrf-1
interfaces:
- ge-0/0/6
- ge-0/0/5
rd: 3.3.3.3:10
target: target:65513:111
state: present
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == false"
- name: Change vrf parameter
net_vrf:
name: test-1
description: test-vrf-1
interfaces:
- ge-0/0/3
- ge-0/0/2
rd: 1.1.1.1:10
target: target:65514:113
state: present
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == true"
- "'[edit routing-instances test-1]' in result.diff.prepared"
- result.diff.prepared is search("\+ *interface ge-0/0/2.0")
- result.diff.prepared is search("\+ *interface ge-0/0/3.0")
- "'[edit routing-instances test-1]' in result.diff.prepared"
- result.diff.prepared is search("\+ *route-distinguisher 1.1.1.1:10")
- result.diff.prepared is search("\+ *vrf-target target:65514:113")
- name: Delete vrf
net_vrf:
name: test-1
description: test-vrf-1
interfaces:
- ge-0/0/3
- ge-0/0/2
rd: 1.1.1.1:10
target: target:65514:113
state: absent
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == true"
- result.diff.prepared is search("\- *test-1")
- result.diff.prepared is search("\- *description test-vrf-1")
- result.diff.prepared is search("\- *instance-type vrf")
- result.diff.prepared is search("\- *interface ge-0/0/2.0")
- result.diff.prepared is search("\- *interface ge-0/0/3.0")
- result.diff.prepared is search("\- *route-distinguisher 1.1.1.1:10")
- result.diff.prepared is search("\- *vrf-target target:65514:113")
- name: Delete vrf (idempotent)
net_vrf:
name: test-1
description: test-vrf-1
interfaces:
- ge-0/0/3
- ge-0/0/2
rd: 1.1.1.1:10
target: target:65514:113
state: absent
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == false"
- name: Setup vrf using aggregate
net_vrf:
aggregate:
- name: test-1
- name: test-2
state: absent
provider: "{{ netconf }}"
register: result
- name: Create vrf using aggregate
net_vrf:
aggregate:
- name: test-1
description: test-vrf-1
interfaces:
- ge-0/0/3
- ge-0/0/2
rd: 1.1.1.1:10
target: target:65514:113
- name: test-2
description: test-vrf-2
interfaces:
- ge-0/0/4
- ge-0/0/5
rd: 2.2.2.2:10
target: target:65515:114
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == true"
- result.diff.prepared is search("\+ *test-1")
- result.diff.prepared is search("\+ *description test-vrf-1")
- result.diff.prepared is search("\+ *instance-type vrf")
- result.diff.prepared is search("\+ *interface ge-0/0/2.0")
- result.diff.prepared is search("\+ *interface ge-0/0/3.0")
- result.diff.prepared is search("\+ *route-distinguisher 1.1.1.1:10")
- result.diff.prepared is search("\+ *vrf-target target:65514:113")
- result.diff.prepared is search("\+ *test-2")
- result.diff.prepared is search("\+ *description test-vrf-2")
- result.diff.prepared is search("\+ *instance-type vrf")
- result.diff.prepared is search("\+ *interface ge-0/0/4.0")
- result.diff.prepared is search("\+ *interface ge-0/0/5.0")
- result.diff.prepared is search("\+ *route-distinguisher 2.2.2.2:10")
- result.diff.prepared is search("\+ *vrf-target target:65515:114")
- name: Delete vrf configuration using aggregate
net_vrf:
aggregate:
- name: test-1
- name: test-2
state: absent
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == true"
- result.diff.prepared is search("\- *test-1")
- result.diff.prepared is search("\- *description test-vrf-1")
- result.diff.prepared is search("\- *instance-type vrf")
- result.diff.prepared is search("\- *interface ge-0/0/2.0")
- result.diff.prepared is search("\- *interface ge-0/0/3.0")
- result.diff.prepared is search("\- *route-distinguisher 1.1.1.1:10")
- result.diff.prepared is search("\- *vrf-target target:65514:113")
- result.diff.prepared is search("\- *test-2")
- result.diff.prepared is search("\- *description test-vrf-2")
- result.diff.prepared is search("\- *instance-type vrf")
- result.diff.prepared is search("\- *interface ge-0/0/4.0")
- result.diff.prepared is search("\- *interface ge-0/0/5.0")
- result.diff.prepared is search("\- *route-distinguisher 2.2.2.2:10")
- result.diff.prepared is search("\- *vrf-target target:65515:114")
- name: Delete vrf configuration using aggregate (idempotent)
net_vrf:
aggregate:
- name: test-1
- name: test-2
state: absent
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == false"