|
7 | 7 | ### NETBOX_FRONT_PORT_TEMPLATE |
8 | 8 | ## |
9 | 9 | ## |
| 10 | +- name: "NETBOX_FRONT_PORT_TEMPLATE 0.1: Create module type for testing power ports on module types" |
| 11 | + netbox.netbox.netbox_module_type: |
| 12 | + netbox_url: http://localhost:32768 |
| 13 | + netbox_token: "0123456789abcdef0123456789abcdef01234567" |
| 14 | + data: |
| 15 | + model: Module Type Front And Rear Port Tests |
| 16 | + manufacturer: Test Manufacturer |
| 17 | + state: present |
| 18 | + |
10 | 19 | - name: "FRONT_PORT_TEMPLATE 1: Necessary info creation" |
11 | 20 | netbox.netbox.netbox_front_port_template: |
12 | 21 | netbox_url: http://localhost:32768 |
|
145 | 154 | - test_six['front_port_template']['type'] == "bnc" |
146 | 155 | - test_six['front_port_template']['rear_port'] == 1 |
147 | 156 | - test_six['msg'] == "front_port_template Front Port Template already exists" |
| 157 | + |
| 158 | +- name: "FRONT_PORT_TEMPLATE 7: Necessary info creation" |
| 159 | + netbox.netbox.netbox_front_port_template: |
| 160 | + netbox_url: http://localhost:32768 |
| 161 | + netbox_token: "0123456789abcdef0123456789abcdef01234567" |
| 162 | + data: |
| 163 | + name: Module Type Front Port Template |
| 164 | + module_type: Module Type Front And Rear Port Tests |
| 165 | + type: bnc |
| 166 | + rear_port_template: Module Type Rear Port Template |
| 167 | + state: present |
| 168 | + register: test_seven |
| 169 | + |
| 170 | +- name: "FRONT_PORT_TEMPLATE 7: ASSERT - Necessary info creation" |
| 171 | + ansible.builtin.assert: |
| 172 | + that: |
| 173 | + - test_seven is changed |
| 174 | + - test_seven['diff']['before']['state'] == "absent" |
| 175 | + - test_seven['diff']['after']['state'] == "present" |
| 176 | + - test_seven['front_port_template']['name'] == "Module Type Front Port Template" |
| 177 | + - test_seven['front_port_template']['module_type'] == 1 |
| 178 | + - test_seven['front_port_template']['type'] == "bnc" |
| 179 | + - test_seven['front_port_template']['rear_port'] == 4 |
| 180 | + - test_seven['msg'] == "front_port_template Module Type Front Port Template created" |
| 181 | + |
| 182 | +- name: "FRONT_PORT_TEMPLATE 8: Create duplicate" |
| 183 | + netbox.netbox.netbox_front_port_template: |
| 184 | + netbox_url: http://localhost:32768 |
| 185 | + netbox_token: "0123456789abcdef0123456789abcdef01234567" |
| 186 | + data: |
| 187 | + name: Module Type Front Port Template |
| 188 | + module_type: Module Type Front And Rear Port Tests |
| 189 | + type: bnc |
| 190 | + rear_port_template: Module Type Rear Port Template |
| 191 | + state: present |
| 192 | + register: test_eight |
| 193 | + |
| 194 | +- name: "FRONT_PORT_TEMPLATE 8: ASSERT - Create duplicate" |
| 195 | + ansible.builtin.assert: |
| 196 | + that: |
| 197 | + - not test_eight['changed'] |
| 198 | + - test_eight['front_port_template']['name'] == "Module Type Front Port Template" |
| 199 | + - test_eight['front_port_template']['module_type'] == 1 |
| 200 | + - test_eight['front_port_template']['type'] == "bnc" |
| 201 | + - test_eight['front_port_template']['rear_port'] == 4 |
| 202 | + - test_eight['msg'] == "front_port_template Module Type Front Port Template already exists" |
| 203 | + |
| 204 | +- name: "FRONT_PORT_TEMPLATE 9: Update Front Port Template with other fields" |
| 205 | + netbox.netbox.netbox_front_port_template: |
| 206 | + netbox_url: http://localhost:32768 |
| 207 | + netbox_token: "0123456789abcdef0123456789abcdef01234567" |
| 208 | + data: |
| 209 | + name: Module Type Front Port Template |
| 210 | + module_type: Module Type Front And Rear Port Tests |
| 211 | + type: bnc |
| 212 | + rear_port_template: Module Type Rear Port Template |
| 213 | + rear_port_template_position: 5 |
| 214 | + state: present |
| 215 | + register: test_nine |
| 216 | + |
| 217 | +- name: "FRONT_PORT_TEMPLATE 9: ASSERT - Update Front Port Template with other fields" |
| 218 | + ansible.builtin.assert: |
| 219 | + that: |
| 220 | + - test_nine is changed |
| 221 | + - test_nine['diff']['after']['rear_port_position'] == 5 |
| 222 | + - test_nine['front_port_template']['name'] == "Module Type Front Port Template" |
| 223 | + - test_nine['front_port_template']['module_type'] == 1 |
| 224 | + - test_nine['front_port_template']['type'] == "bnc" |
| 225 | + - test_nine['front_port_template']['rear_port_position'] == 5 |
| 226 | + - test_nine['front_port_template']['rear_port'] == 4 |
| 227 | + - test_nine['msg'] == "front_port_template Module Type Front Port Template updated" |
| 228 | + |
| 229 | +- name: "FRONT_PORT_TEMPLATE 10: Create Front Port Template for Delete Test" |
| 230 | + netbox.netbox.netbox_front_port_template: |
| 231 | + netbox_url: http://localhost:32768 |
| 232 | + netbox_token: "0123456789abcdef0123456789abcdef01234567" |
| 233 | + data: |
| 234 | + name: Module Type Front Port Template 2 |
| 235 | + module_type: Module Type Front And Rear Port Tests |
| 236 | + type: bnc |
| 237 | + rear_port_template: Module Type Rear Port Template |
| 238 | + state: present |
| 239 | + register: test_ten |
| 240 | + |
| 241 | +- name: "FRONT_PORT_TEMPLATE 10: ASSERT - Create Front Port Template for Delete Test" |
| 242 | + ansible.builtin.assert: |
| 243 | + that: |
| 244 | + - test_ten is changed |
| 245 | + - test_ten['diff']['before']['state'] == "absent" |
| 246 | + - test_ten['diff']['after']['state'] == "present" |
| 247 | + - test_ten['front_port_template']['name'] == "Module Type Front Port Template 2" |
| 248 | + - test_ten['front_port_template']['module_type'] == 1 |
| 249 | + - test_ten['front_port_template']['type'] == "bnc" |
| 250 | + - test_ten['front_port_template']['rear_port'] == 4 |
| 251 | + - test_ten['msg'] == "front_port_template Module Type Front Port Template 2 created" |
| 252 | + |
| 253 | +- name: "FRONT_PORT_TEMPLATE 11: Delete Front Port Template" |
| 254 | + netbox.netbox.netbox_front_port_template: |
| 255 | + netbox_url: http://localhost:32768 |
| 256 | + netbox_token: "0123456789abcdef0123456789abcdef01234567" |
| 257 | + data: |
| 258 | + name: Module Type Front Port Template 2 |
| 259 | + module_type: Module Type Front And Rear Port Tests |
| 260 | + type: bnc |
| 261 | + rear_port_template: Module Type Rear Port Template |
| 262 | + state: absent |
| 263 | + register: test_eleven |
| 264 | + |
| 265 | +- name: "FRONT_PORT_TEMPLATE 11: ASSERT - Delete Front Port Template" |
| 266 | + ansible.builtin.assert: |
| 267 | + that: |
| 268 | + - test_eleven is changed |
| 269 | + - test_eleven['diff']['before']['state'] == "present" |
| 270 | + - test_eleven['diff']['after']['state'] == "absent" |
| 271 | + - test_eleven['msg'] == "front_port_template Module Type Front Port Template 2 deleted" |
| 272 | + |
| 273 | +- name: "FRONT_PORT_TEMPLATE 12: Create duplicate with rear_port_template dictionary" |
| 274 | + netbox.netbox.netbox_front_port_template: |
| 275 | + netbox_url: http://localhost:32768 |
| 276 | + netbox_token: "0123456789abcdef0123456789abcdef01234567" |
| 277 | + data: |
| 278 | + name: Module Type Front Port Template |
| 279 | + module_type: Module Type Front And Rear Port Tests |
| 280 | + type: bnc |
| 281 | + rear_port_template: |
| 282 | + module: Module Type Front And Rear Port Tests |
| 283 | + name: Module Type Rear Port Template |
| 284 | + state: present |
| 285 | + register: test_twelve |
| 286 | + |
| 287 | +- name: "FRONT_PORT_TEMPLATE 12: ASSERT - Create duplicate with rear_port_template dictionary" |
| 288 | + ansible.builtin.assert: |
| 289 | + that: |
| 290 | + - not test_twelve['changed'] |
| 291 | + - test_twelve['front_port_template']['name'] == "Module Type Front Port Template" |
| 292 | + - test_twelve['front_port_template']['module_type'] == 1 |
| 293 | + - test_twelve['front_port_template']['type'] == "bnc" |
| 294 | + - test_twelve['front_port_template']['rear_port'] == 4 |
| 295 | + - test_twelve['msg'] == "front_port_template Module Type Front Port Template already exists" |
0 commit comments