Neels Hofmeyr | 19bed23 | 2018-03-22 04:54:57 +0100 | [diff] [blame^] | 1 | |
| 2 | --- testing NULL neighbor_ident_list |
| 3 | neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=-ENOMEM, got -12 |
| 4 | (empty) |
| 5 | neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> NULL |
| 6 | neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> nothing deleted |
| 7 | (empty) |
| 8 | |
| 9 | --- adding entries, test that no two identical entries are added |
| 10 | neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 |
| 11 | 0: BTS 0 to ARFCN 1 BSIC 2 |
| 12 | cell_id_list cgi[1] = { |
| 13 | 0: 001-02-3-4 |
| 14 | } |
| 15 | neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> entry returned |
| 16 | cell_id_list cgi[1] = { |
| 17 | 0: 001-02-3-4 |
| 18 | } |
| 19 | neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 |
| 20 | 0: BTS 0 to ARFCN 1 BSIC 2 |
| 21 | cell_id_list cgi[1] = { |
| 22 | 0: 001-02-3-4 |
| 23 | } |
| 24 | neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi2) --> expect rc=2, got 2 |
| 25 | 0: BTS 0 to ARFCN 1 BSIC 2 |
| 26 | cell_id_list cgi[2] = { |
| 27 | 0: 001-02-3-4 |
| 28 | 1: 005-006-7-8 |
| 29 | } |
| 30 | neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi2) --> expect rc=2, got 2 |
| 31 | 0: BTS 0 to ARFCN 1 BSIC 2 |
| 32 | cell_id_list cgi[2] = { |
| 33 | 0: 001-02-3-4 |
| 34 | 1: 005-006-7-8 |
| 35 | } |
| 36 | neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> entry deleted |
| 37 | (empty) |
| 38 | |
| 39 | --- Cannot mix cell identifier types for one entry |
| 40 | neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 |
| 41 | 0: BTS 0 to ARFCN 1 BSIC 2 |
| 42 | cell_id_list cgi[1] = { |
| 43 | 0: 001-02-3-4 |
| 44 | } |
| 45 | neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &lac1) --> expect rc=-EINVAL, got -22 |
| 46 | 0: BTS 0 to ARFCN 1 BSIC 2 |
| 47 | cell_id_list cgi[1] = { |
| 48 | 0: 001-02-3-4 |
| 49 | } |
| 50 | neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> entry deleted |
| 51 | (empty) |
| 52 | |
| 53 | --- BTS matching: specific BTS is stronger |
| 54 | neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2), &lac1) --> expect rc=1, got 1 |
| 55 | 0: BTS * to ARFCN 1 BSIC 2 |
| 56 | cell_id_list lac[1] = { |
| 57 | 0: 123 |
| 58 | } |
| 59 | neighbor_ident_add(k(3, 1, BSIC_6BIT, 2), &lac2) --> expect rc=2, got 2 |
| 60 | 0: BTS * to ARFCN 1 BSIC 2 |
| 61 | cell_id_list lac[1] = { |
| 62 | 0: 123 |
| 63 | } |
| 64 | 1: BTS 3 to ARFCN 1 BSIC 2 |
| 65 | cell_id_list lac[2] = { |
| 66 | 0: 456 |
| 67 | 1: 789 |
| 68 | } |
| 69 | neighbor_ident_get(k(2, 1, BSIC_6BIT, 2)) --> entry returned |
| 70 | cell_id_list lac[1] = { |
| 71 | 0: 123 |
| 72 | } |
| 73 | neighbor_ident_get(k(3, 1, BSIC_6BIT, 2)) --> entry returned |
| 74 | cell_id_list lac[2] = { |
| 75 | 0: 456 |
| 76 | 1: 789 |
| 77 | } |
| 78 | neighbor_ident_get(k(4, 1, BSIC_6BIT, 2)) --> entry returned |
| 79 | cell_id_list lac[1] = { |
| 80 | 0: 123 |
| 81 | } |
| 82 | neighbor_ident_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2)) --> entry returned |
| 83 | cell_id_list lac[1] = { |
| 84 | 0: 123 |
| 85 | } |
| 86 | |
| 87 | --- BSIC matching: 6bit and 9bit are different realms, and wildcard match is weaker |
| 88 | neighbor_ident_add(k(0, 1, BSIC_NONE, 0), &cgi1) --> expect rc=1, got 1 |
| 89 | 0: BTS 0 to ARFCN 1 (any BSIC) |
| 90 | cell_id_list cgi[1] = { |
| 91 | 0: 001-02-3-4 |
| 92 | } |
| 93 | neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &lac1) --> expect rc=1, got 1 |
| 94 | 0: BTS 0 to ARFCN 1 (any BSIC) |
| 95 | cell_id_list cgi[1] = { |
| 96 | 0: 001-02-3-4 |
| 97 | } |
| 98 | 1: BTS 0 to ARFCN 1 BSIC 2 |
| 99 | cell_id_list lac[1] = { |
| 100 | 0: 123 |
| 101 | } |
| 102 | neighbor_ident_add(k(0, 1, BSIC_9BIT, 2), &lac2) --> expect rc=2, got 2 |
| 103 | 0: BTS 0 to ARFCN 1 (any BSIC) |
| 104 | cell_id_list cgi[1] = { |
| 105 | 0: 001-02-3-4 |
| 106 | } |
| 107 | 1: BTS 0 to ARFCN 1 BSIC 2 |
| 108 | cell_id_list lac[1] = { |
| 109 | 0: 123 |
| 110 | } |
| 111 | 2: BTS 0 to ARFCN 1 BSIC 2(9bit) |
| 112 | cell_id_list lac[2] = { |
| 113 | 0: 456 |
| 114 | 1: 789 |
| 115 | } |
| 116 | neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> entry returned |
| 117 | cell_id_list lac[1] = { |
| 118 | 0: 123 |
| 119 | } |
| 120 | neighbor_ident_get(k(0, 1, BSIC_9BIT, 2)) --> entry returned |
| 121 | cell_id_list lac[2] = { |
| 122 | 0: 456 |
| 123 | 1: 789 |
| 124 | } |
| 125 | --- wildcard matches both 6bit and 9bit BSIC regardless: |
| 126 | neighbor_ident_get(k(0, 1, BSIC_6BIT, 23)) --> entry returned |
| 127 | cell_id_list cgi[1] = { |
| 128 | 0: 001-02-3-4 |
| 129 | } |
| 130 | neighbor_ident_get(k(0, 1, BSIC_9BIT, 23)) --> entry returned |
| 131 | cell_id_list cgi[1] = { |
| 132 | 0: 001-02-3-4 |
| 133 | } |
| 134 | |
| 135 | --- Value ranges |
| 136 | neighbor_ident_add(k(0, 6, BSIC_6BIT, 1 << 6), &lac1) --> expect rc=-ERANGE, got -34 |
| 137 | (empty) |
| 138 | neighbor_ident_add(k(0, 9, BSIC_9BIT, 1 << 9), &lac1) --> expect rc=-ERANGE, got -34 |
| 139 | (empty) |
| 140 | neighbor_ident_add(k(0, 6, BSIC_6BIT, -1), &lac1) --> expect rc=-ERANGE, got -34 |
| 141 | (empty) |
| 142 | neighbor_ident_add(k(0, 9, BSIC_9BIT, -1), &lac1) --> expect rc=-ERANGE, got -34 |
| 143 | (empty) |
| 144 | neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_NONE, 1), &cgi2) --> expect rc=-ERANGE, got -34 |
| 145 | (empty) |
| 146 | neighbor_ident_add(k(256, 1, BSIC_NONE, 1), &cgi2) --> expect rc=-ERANGE, got -34 |
| 147 | (empty) |
| 148 | neighbor_ident_add(k(0, 0, BSIC_NONE, 0), &cgi1) --> expect rc=1, got 1 |
| 149 | 0: BTS 0 to ARFCN 0 (any BSIC) |
| 150 | cell_id_list cgi[1] = { |
| 151 | 0: 001-02-3-4 |
| 152 | } |
| 153 | neighbor_ident_add(k(255, 65535, BSIC_NONE, 65535), &lac1) --> expect rc=1, got 1 |
| 154 | 0: BTS 0 to ARFCN 0 (any BSIC) |
| 155 | cell_id_list cgi[1] = { |
| 156 | 0: 001-02-3-4 |
| 157 | } |
| 158 | 1: BTS 255 to ARFCN 65535 (any BSIC) |
| 159 | cell_id_list lac[1] = { |
| 160 | 0: 123 |
| 161 | } |
| 162 | neighbor_ident_add(k(0, 0, BSIC_6BIT, 0), &cgi2) --> expect rc=2, got 2 |
| 163 | 0: BTS 0 to ARFCN 0 (any BSIC) |
| 164 | cell_id_list cgi[1] = { |
| 165 | 0: 001-02-3-4 |
| 166 | } |
| 167 | 1: BTS 255 to ARFCN 65535 (any BSIC) |
| 168 | cell_id_list lac[1] = { |
| 169 | 0: 123 |
| 170 | } |
| 171 | 2: BTS 0 to ARFCN 0 BSIC 0 |
| 172 | cell_id_list cgi[2] = { |
| 173 | 0: 001-02-3-4 |
| 174 | 1: 005-006-7-8 |
| 175 | } |
| 176 | neighbor_ident_add(k(255, 65535, BSIC_6BIT, 0x3f), &lac2) --> expect rc=2, got 2 |
| 177 | 0: BTS 0 to ARFCN 0 (any BSIC) |
| 178 | cell_id_list cgi[1] = { |
| 179 | 0: 001-02-3-4 |
| 180 | } |
| 181 | 1: BTS 255 to ARFCN 65535 (any BSIC) |
| 182 | cell_id_list lac[1] = { |
| 183 | 0: 123 |
| 184 | } |
| 185 | 2: BTS 0 to ARFCN 0 BSIC 0 |
| 186 | cell_id_list cgi[2] = { |
| 187 | 0: 001-02-3-4 |
| 188 | 1: 005-006-7-8 |
| 189 | } |
| 190 | 3: BTS 255 to ARFCN 65535 BSIC 63 |
| 191 | cell_id_list lac[2] = { |
| 192 | 0: 456 |
| 193 | 1: 789 |
| 194 | } |
| 195 | neighbor_ident_add(k(0, 0, BSIC_9BIT, 0), &cgi1) --> expect rc=1, got 1 |
| 196 | 0: BTS 0 to ARFCN 0 (any BSIC) |
| 197 | cell_id_list cgi[1] = { |
| 198 | 0: 001-02-3-4 |
| 199 | } |
| 200 | 1: BTS 255 to ARFCN 65535 (any BSIC) |
| 201 | cell_id_list lac[1] = { |
| 202 | 0: 123 |
| 203 | } |
| 204 | 2: BTS 0 to ARFCN 0 BSIC 0 |
| 205 | cell_id_list cgi[2] = { |
| 206 | 0: 001-02-3-4 |
| 207 | 1: 005-006-7-8 |
| 208 | } |
| 209 | 3: BTS 255 to ARFCN 65535 BSIC 63 |
| 210 | cell_id_list lac[2] = { |
| 211 | 0: 456 |
| 212 | 1: 789 |
| 213 | } |
| 214 | 4: BTS 0 to ARFCN 0 BSIC 0(9bit) |
| 215 | cell_id_list cgi[1] = { |
| 216 | 0: 001-02-3-4 |
| 217 | } |
| 218 | neighbor_ident_add(k(255, 65535, BSIC_9BIT, 0x1ff), &cgi2) --> expect rc=2, got 2 |
| 219 | 0: BTS 0 to ARFCN 0 (any BSIC) |
| 220 | cell_id_list cgi[1] = { |
| 221 | 0: 001-02-3-4 |
| 222 | } |
| 223 | 1: BTS 255 to ARFCN 65535 (any BSIC) |
| 224 | cell_id_list lac[1] = { |
| 225 | 0: 123 |
| 226 | } |
| 227 | 2: BTS 0 to ARFCN 0 BSIC 0 |
| 228 | cell_id_list cgi[2] = { |
| 229 | 0: 001-02-3-4 |
| 230 | 1: 005-006-7-8 |
| 231 | } |
| 232 | 3: BTS 255 to ARFCN 65535 BSIC 63 |
| 233 | cell_id_list lac[2] = { |
| 234 | 0: 456 |
| 235 | 1: 789 |
| 236 | } |
| 237 | 4: BTS 0 to ARFCN 0 BSIC 0(9bit) |
| 238 | cell_id_list cgi[1] = { |
| 239 | 0: 001-02-3-4 |
| 240 | } |
| 241 | 5: BTS 255 to ARFCN 65535 BSIC 511(9bit) |
| 242 | cell_id_list cgi[2] = { |
| 243 | 0: 001-02-3-4 |
| 244 | 1: 005-006-7-8 |
| 245 | } |
| 246 | |
| 247 | --- size limits |
| 248 | Added first cell identifier list (added 127) --> rc = 127 |
| 249 | Added second cell identifier list (tried to add 1) --> rc = -28 |