1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/net_static_route/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

134 lines
3.9 KiB
YAML

---
- debug: msg="START net_static_route junos/basic.yaml"
- name: setup - remove static route
net_static_route:
address: 1.1.1.0/24
state: absent
provider: "{{ netconf }}"
- name: Confgiure static route
net_static_route:
prefix: 1.1.1.0/24
next_hop: 3.3.3.3
admin_distance: 10
state: present
provider: "{{ netconf }}"
register: result
- name: Get running configuration
junos_rpc:
rpc: get-configuration
provider: "{{ netconf }}"
register: config
- assert:
that:
- "result.changed == true"
- "'<name>1.1.1.0/24</name>' in config.xml"
- "'<next-hop>3.3.3.3</next-hop>' in config.xml"
- name: Confgiure static route (idempotent)
net_static_route:
prefix: 1.1.1.0/24
next_hop: 3.3.3.3
admin_distance: 10
state: present
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == false"
- name: Delete static route
net_static_route:
prefix: 1.1.1.0/24
state: absent
provider: "{{ netconf }}"
register: result
- name: Get running configuration
junos_rpc:
rpc: get-configuration
provider: "{{ netconf }}"
register: config
- assert:
that:
- "result.changed == true"
- "'<name>1.1.1.0/24</name>' not in config.xml"
- name: Delete static route (idempotent)
net_static_route:
prefix: 1.1.1.0/24
state: absent
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == false"
- name: Setup static route for aggegrate
net_static_route:
aggregate:
- {address: 4.4.4.0/24, state: absent}
- {address: 5.5.5.0/24, state: absent}
provider: "{{ netconf }}"
- name: Confgiure static route using aggegrate
net_static_route:
aggregate:
- {address: 4.4.4.0/24, next_hop: 3.3.3.3, preference: 10, qualified_next_hop: 5.5.5.5, qualified_preference: 30}
- {address: 5.5.5.0/24, next_hop: 6.6.6.6, preference: 11, qualified_next_hop: 7.7.7.7, qualified_preference: 12}
provider: "{{ netconf }}"
register: result
- assert:
that:
- 'result.changed == true'
- result.diff.prepared is search("\+ *route 4.4.4.0/24")
- result.diff.prepared is search("\+ *next-hop 3.3.3.3")
- result.diff.prepared is search("\+ *qualified-next-hop 5.5.5.5")
- result.diff.prepared is search("\+ *preference 30")
- result.diff.prepared is search("\+ *preference 10")
- result.diff.prepared is search("\+ *route 5.5.5.0/24")
- result.diff.prepared is search("\+ *next-hop 6.6.6.6")
- result.diff.prepared is search("\+ *qualified-next-hop 7.7.7.7")
- result.diff.prepared is search("\+ *preference 12")
- result.diff.prepared is search("\+ *preference 11")
- name: Delete static route configuration using aggegrate
net_static_route:
aggregate:
- {address: 4.4.4.0/24, state: absent}
- {address: 5.5.5.0/24, state: absent}
provider: "{{ netconf }}"
register: result
- assert:
that:
- 'result.changed == true'
- result.diff.prepared is search("\- *route 4.4.4.0/24")
- result.diff.prepared is search("\- *next-hop 3.3.3.3")
- result.diff.prepared is search("\- *qualified-next-hop 5.5.5.5")
- result.diff.prepared is search("\- *preference 30")
- result.diff.prepared is search("\- *preference 10")
- result.diff.prepared is search("\- *route 5.5.5.0/24")
- result.diff.prepared is search("\- *next-hop 6.6.6.6")
- result.diff.prepared is search("\- *qualified-next-hop 7.7.7.7")
- result.diff.prepared is search("\- *preference 12")
- result.diff.prepared is search("\- *preference 11")
- name: Delete static route configuration using aggegrate (idempotent)
net_static_route:
aggregate:
- {address: 4.4.4.0/24, state: absent}
- {address: 5.5.5.0/24, state: absent}
provider: "{{ netconf }}"
register: result
- assert:
that:
- "result.changed == false"