summaryrefslogtreecommitdiff
path: root/test/integration/targets/iosxr_lacp/tests/cli/rtt.yaml
blob: aa449ab6e66aaa52577bd94b243264f06850ee35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
- debug:
    msg: "START isoxr_lacp round trip integration tests on connection={{ ansible_connection }}"

- block:
    - include_tasks: _remove_config.yaml

    - name: Apply the provided configuration (base config)
      iosxr_lacp:
        config:
          system:
            priority: 15
            mac: 00c1.4c00.bd16
        state: merged
      register: base_config
        
    - name: Gather interfaces facts
      iosxr_facts:
        gather_subset:
          - "!all"
          - "!min"
        gather_network_resources:
          - lacp

    - name: Apply the provided configuration (config to be reverted)
      iosxr_lacp:
        config:
          system:
            priority: 10
            mac: 00c1.4c00.bd10
        state: merged
      register: result
      
    - name: Assert that changes were applied
      assert:
        that: "{{ round_trip['after'] == result['after'] }}"

    - name: Revert back to base config using facts round trip
      iosxr_lacp:
        config: "{{ ansible_facts['network_resources']['lacp'] }}"
        state: replaced
      register: revert

    - name: Assert that config was reverted
      assert:
        that: "{{ base_config['after'] == revert['after'] }}"

  always:
    - include_tasks: _remove_config.yaml