summaryrefslogtreecommitdiff
path: root/test/integration/targets/nxos_vtp_version/tests/common/sanity.yaml
blob: ef5c3231d3cf61745d1b4e2671017f47c3cbf8c8 (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 connection={{ ansible_connection }} nxos_vtp_version sanity test"

- set_fact: vtp_run="true"
- set_fact: vtp_run="false"
  when: platform is search('N3K-F|N9K-F')

- block:
  - name: disable feature vtp
    nxos_feature:
      feature: vtp
      state: disabled
    ignore_errors: yes

  - name: enable feature vtp
    nxos_feature:
      feature: vtp
      state: enabled

  - name: configure supporting vtp domain
    nxos_vtp_domain:
      domain: foo

  - name: configure vtp version
    nxos_vtp_version: &configure
      version: 2
    register: result

  - assert: &true
      that:
        - "result.changed == true"

  - name: "Conf Idempotence"
    nxos_vtp_version: *configure
    register: result

  - assert: &false
      that:
        - "result.changed == false"

  when: vtp_run | bool

  always:
  - name: disable feature vtp
    nxos_feature:
      feature: vtp
      state: disabled

- debug: msg="END connection={{ ansible_connection }} nxos_vtp_version sanity test"