|
4 | 4 | ### NETBOX_CIRCUIT_TERMINATION |
5 | 5 | ## |
6 | 6 | ## |
| 7 | +- name: "NETBOX_CIRCUIT_TERMINATION 0: Create provider network within NetBox with only required information" |
| 8 | + netbox.netbox.netbox_provider_network: |
| 9 | + netbox_url: http://localhost:32768 |
| 10 | + netbox_token: "0123456789abcdef0123456789abcdef01234567" |
| 11 | + data: |
| 12 | + provider: Test Provider |
| 13 | + name: Test Provider Network One |
| 14 | + state: present |
| 15 | + register: test_one |
| 16 | + |
| 17 | +- name: "NETBOX_CIRCUIT_TERMINATION 0: ASSERT - Necessary info creation" |
| 18 | + ansible.builtin.assert: |
| 19 | + that: |
| 20 | + - test_one is changed |
| 21 | + - test_one['diff']['before']['state'] == "absent" |
| 22 | + - test_one['diff']['after']['state'] == "present" |
| 23 | + - test_one['provider_network']['name'] == "Test Provider Network One" |
| 24 | + - test_one['msg'] == "provider_network Test Provider Network One created" |
| 25 | + |
7 | 26 | - name: "NETBOX_CIRCUIT_TERMINATION 1: Create provider within NetBox with only required information" |
8 | 27 | netbox.netbox.netbox_circuit_termination: |
9 | 28 | netbox_url: http://localhost:32768 |
10 | 29 | netbox_token: "0123456789abcdef0123456789abcdef01234567" |
11 | 30 | data: |
12 | 31 | circuit: Test Circuit |
13 | 32 | term_side: A |
14 | | - site: Test Site |
| 33 | + termination_id: 2 |
| 34 | + termination_type: circuits.providernetwork |
15 | 35 | port_speed: 10000 |
16 | 36 | state: present |
17 | 37 | register: test_one |
|
22 | 42 | - test_one is changed |
23 | 43 | - test_one['diff']['before']['state'] == "absent" |
24 | 44 | - test_one['diff']['after']['state'] == "present" |
| 45 | + - test_one['circuit_termination']['termination_type'] == "circuits.providernetwork" |
| 46 | + - test_one['circuit_termination']['termination_id'] == 2 |
25 | 47 | - test_one['circuit_termination']['circuit'] == 1 |
26 | 48 | - test_one['circuit_termination']['term_side'] == "A" |
27 | | - - test_one['circuit_termination']['site'] == 1 |
28 | 49 | - test_one['circuit_termination']['port_speed'] == 10000 |
29 | 50 | - test_one['msg'] == "circuit_termination test_circuit_a created" |
30 | 51 |
|
|
42 | 63 | ansible.builtin.assert: |
43 | 64 | that: |
44 | 65 | - not test_two['changed'] |
| 66 | + - test_one['circuit_termination']['termination_type'] == "circuits.providernetwork" |
| 67 | + - test_one['circuit_termination']['termination_id'] == 2 |
45 | 68 | - test_two['circuit_termination']['circuit'] == 1 |
46 | 69 | - test_two['circuit_termination']['term_side'] == "A" |
47 | | - - test_two['circuit_termination']['site'] == 1 |
48 | 70 | - test_two['circuit_termination']['port_speed'] == 10000 |
49 | 71 | - test_two['msg'] == "circuit_termination test_circuit_a already exists" |
50 | 72 |
|
|
66 | 88 | ansible.builtin.assert: |
67 | 89 | that: |
68 | 90 | - test_three is changed |
| 91 | + - test_one['circuit_termination']['termination_type'] == "circuits.providernetwork" |
| 92 | + - test_one['circuit_termination']['termination_id'] == 2 |
69 | 93 | - test_three['diff']['after']['upstream_speed'] == 1000 |
70 | 94 | - test_three['diff']['after']['xconnect_id'] == "10X100" |
71 | 95 | - test_three['diff']['after']['pp_info'] == "PP10-24" |
72 | 96 | - test_three['diff']['after']['description'] == "Test description" |
73 | 97 | - test_three['circuit_termination']['circuit'] == 1 |
74 | 98 | - test_three['circuit_termination']['term_side'] == "A" |
75 | | - - test_three['circuit_termination']['site'] == 1 |
76 | 99 | - test_three['circuit_termination']['port_speed'] == 10000 |
77 | 100 | - test_three['circuit_termination']['upstream_speed'] == 1000 |
78 | 101 | - test_three['circuit_termination']['xconnect_id'] == "10X100" |
|
87 | 110 | data: |
88 | 111 | circuit: Test Circuit |
89 | 112 | term_side: Z |
90 | | - site: Test Site |
| 113 | + termination_id: 2 |
| 114 | + termination_type: circuits.providernetwork |
91 | 115 | port_speed: 10000 |
92 | 116 | state: present |
93 | 117 | register: test_four |
|
98 | 122 | - test_four is changed |
99 | 123 | - test_four['diff']['before']['state'] == "absent" |
100 | 124 | - test_four['diff']['after']['state'] == "present" |
| 125 | + - test_one['circuit_termination']['termination_type'] == "circuits.providernetwork" |
| 126 | + - test_one['circuit_termination']['termination_id'] == 2 |
101 | 127 | - test_four['circuit_termination']['circuit'] == 1 |
102 | 128 | - test_four['circuit_termination']['term_side'] == "Z" |
103 | | - - test_four['circuit_termination']['site'] == 1 |
104 | 129 | - test_four['circuit_termination']['port_speed'] == 10000 |
105 | 130 | - test_four['msg'] == "circuit_termination test_circuit_z created" |
106 | 131 |
|
|
120 | 145 | - test_five is changed |
121 | 146 | - test_five['circuit_termination']['circuit'] == 1 |
122 | 147 | - test_five['circuit_termination']['term_side'] == "A" |
123 | | - - test_five['circuit_termination']['site'] == 1 |
124 | 148 | - test_five['circuit_termination']['port_speed'] == 10000 |
125 | 149 | - test_five['circuit_termination']['upstream_speed'] == 1000 |
126 | 150 | - test_five['circuit_termination']['xconnect_id'] == "10X100" |
127 | 151 | - test_five['circuit_termination']['pp_info'] == "PP10-24" |
128 | 152 | - test_five['circuit_termination']['description'] == "Test description" |
| 153 | + - test_one['circuit_termination']['termination_type'] == "circuits.providernetwork" |
| 154 | + - test_one['circuit_termination']['termination_id'] == 2 |
129 | 155 | - test_five['msg'] == "circuit_termination test_circuit_a deleted" |
0 commit comments