|
6 | 6 | ## |
7 | 7 | - name: "NETBOX_LOOKUP 1: Lookup returns exactly two sites" |
8 | 8 | assert: |
9 | | - that: query_result == 3 |
| 9 | + that: query_result == "3" |
10 | 10 | vars: |
11 | 11 | query_result: "{{ query('netbox.netbox.nb_lookup', 'sites', api_endpoint='http://localhost:32768', token='0123456789abcdef0123456789abcdef01234567')|count }}" |
12 | 12 |
|
13 | 13 | - name: "NETBOX_LOOKUP 2: Query doesn't return Wibble (sanity check json_query)" |
14 | 14 | assert: |
15 | | - that: query_result == 0 |
| 15 | + that: query_result == "0" |
16 | 16 | vars: |
17 | 17 | query_result: "{{ query('netbox.netbox.nb_lookup', 'devices', api_endpoint='http://localhost:32768', token='0123456789abcdef0123456789abcdef01234567')|community.general.json_query('[?value.display==`Wibble`]')|count}}" |
18 | 18 |
|
19 | 19 | - name: "NETBOX_LOOKUP 3: Device query returns exactly one TestDeviceR1" |
20 | 20 | assert: |
21 | | - that: query_result == 1 |
| 21 | + that: query_result == "1" |
22 | 22 | vars: |
23 | 23 | query_result: "{{ query('netbox.netbox.nb_lookup', 'devices', api_endpoint='http://localhost:32768', token='0123456789abcdef0123456789abcdef01234567')|community.general.json_query('[?value.display==`TestDeviceR1`]')|count }}" |
24 | 24 |
|
|
58 | 58 |
|
59 | 59 | - name: "NETBOX_LOOKUP 7: Device query returns exactly the L2 device" |
60 | 60 | assert: |
61 | | - that: query_result == 1 |
| 61 | + that: query_result == "1" |
62 | 62 | vars: |
63 | 63 | query_result: "{{ query('netbox.netbox.nb_lookup', 'devices', api_filter='role=core-switch tag=lookup', api_endpoint='http://localhost:32768', token='0123456789abcdef0123456789abcdef01234567')|community.general.json_query('[?value.display==`L2`]')|count }}" |
64 | 64 |
|
65 | 65 | - name: "NETBOX_LOOKUP 8: Device query specifying raw data returns payload without key/value dict" |
66 | 66 | assert: |
67 | | - that: query_result == 1 |
| 67 | + that: query_result == "1" |
68 | 68 | vars: |
69 | 69 | query_result: "{{ query('netbox.netbox.nb_lookup', 'devices', api_filter='role=core-switch tag=lookup', api_endpoint='http://localhost:32768', token='0123456789abcdef0123456789abcdef01234567', raw_data=True)|community.general.json_query('[?display==`L2`]')|count }}" |
70 | 70 |
|
|
0 commit comments