aboutsummaryrefslogtreecommitdiffstats
path: root/tests/handover/neighbor_ident_test.ok
blob: 961a33cdc8f57078e2e3853a5ee5ad826bb8aea6 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
--- testing NULL neighbor_ident_list
neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=-ENOMEM, got -12
     (empty)
neighbor_ident_get(k(0, 1, 2)) --> NULL
neighbor_ident_del(k(0, 1, 2)) --> nothing deleted
     (empty)

--- adding entries, test that no two identical entries are added
neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=1, got 1
  0: BTS 0 to ARFCN 1 BSIC 2
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
neighbor_ident_get(k(0, 1, 2)) --> entry returned
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=1, got 1
  0: BTS 0 to ARFCN 1 BSIC 2
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
neighbor_ident_add(k(0, 1, 2), &cgi2) --> expect rc=2, got 2
  0: BTS 0 to ARFCN 1 BSIC 2
     cell_id_list cgi[2] = {
        0: 001-02-3-4
        1: 005-006-7-8
     }
neighbor_ident_add(k(0, 1, 2), &cgi2) --> expect rc=2, got 2
  0: BTS 0 to ARFCN 1 BSIC 2
     cell_id_list cgi[2] = {
        0: 001-02-3-4
        1: 005-006-7-8
     }
neighbor_ident_del(k(0, 1, 2)) --> entry deleted
     (empty)

--- Cannot mix cell identifier types for one entry
neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=1, got 1
  0: BTS 0 to ARFCN 1 BSIC 2
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
neighbor_ident_add(k(0, 1, 2), &lac1) --> expect rc=-EINVAL, got -22
  0: BTS 0 to ARFCN 1 BSIC 2
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
neighbor_ident_del(k(0, 1, 2)) --> entry deleted
     (empty)

--- BTS matching: specific BTS is stronger
neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, 2), &lac1) --> expect rc=1, got 1
  0: BTS * to ARFCN 1 BSIC 2
     cell_id_list lac[1] = {
       0: 123
     }
neighbor_ident_add(k(3, 1, 2), &lac2) --> expect rc=2, got 2
  0: BTS * to ARFCN 1 BSIC 2
     cell_id_list lac[1] = {
       0: 123
     }
  1: BTS 3 to ARFCN 1 BSIC 2
     cell_id_list lac[2] = {
       0: 456
       1: 789
     }
neighbor_ident_get(k(2, 1, 2)) --> entry returned
     cell_id_list lac[1] = {
       0: 123
     }
neighbor_ident_get(k(3, 1, 2)) --> entry returned
     cell_id_list lac[2] = {
       0: 456
       1: 789
     }
neighbor_ident_get(k(4, 1, 2)) --> entry returned
     cell_id_list lac[1] = {
       0: 123
     }
neighbor_ident_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, 2)) --> entry returned
     cell_id_list lac[1] = {
       0: 123
     }

--- BSIC matching: 6bit and 9bit are different realms, and wildcard match is weaker
neighbor_ident_add(k(0, 1, BSIC_ANY), &cgi1) --> expect rc=1, got 1
  0: BTS 0 to ARFCN 1 (any BSIC)
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
neighbor_ident_add(k(0, 1, 2), &lac1) --> expect rc=1, got 1
  0: BTS 0 to ARFCN 1 (any BSIC)
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
  1: BTS 0 to ARFCN 1 BSIC 2
     cell_id_list lac[1] = {
       0: 123
     }
neighbor_ident_add(k(0, 1, 2), &lac2) --> expect rc=2, got 3
ERROR
  0: BTS 0 to ARFCN 1 (any BSIC)
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
  1: BTS 0 to ARFCN 1 BSIC 2
     cell_id_list lac[3] = {
       0: 123
       1: 456
       2: 789
     }
neighbor_ident_get(k(0, 1, 2)) --> entry returned
     cell_id_list lac[3] = {
       0: 123
       1: 456
       2: 789
     }
neighbor_ident_get(k(0, 1, 2)) --> entry returned
     cell_id_list lac[3] = {
       0: 123
       1: 456
       2: 789
     }

--- Value ranges
neighbor_ident_add(k(0, 6, 1 << 6), &lac1) --> expect rc=-ERANGE, got -34
     (empty)
neighbor_ident_add(k(0, 6, BSIC_ANY - 1), &lac1) --> expect rc=-ERANGE, got -34
     (empty)
neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_ANY), &cgi2) --> expect rc=-ERANGE, got -34
     (empty)
neighbor_ident_add(k(256, 1, BSIC_ANY), &cgi2) --> expect rc=-ERANGE, got -34
     (empty)
neighbor_ident_add(k(0, 0, BSIC_ANY), &cgi1) --> expect rc=1, got 1
  0: BTS 0 to ARFCN 0 (any BSIC)
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
neighbor_ident_add(k(255, 65535, BSIC_ANY), &lac1) --> expect rc=1, got 1
  0: BTS 0 to ARFCN 0 (any BSIC)
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
  1: BTS 255 to ARFCN 65535 (any BSIC)
     cell_id_list lac[1] = {
       0: 123
     }
neighbor_ident_add(k(0, 0, 0), &cgi2) --> expect rc=2, got 2
  0: BTS 0 to ARFCN 0 (any BSIC)
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
  1: BTS 255 to ARFCN 65535 (any BSIC)
     cell_id_list lac[1] = {
       0: 123
     }
  2: BTS 0 to ARFCN 0 BSIC 0
     cell_id_list cgi[2] = {
        0: 001-02-3-4
        1: 005-006-7-8
     }
neighbor_ident_add(k(255, 65535, 0x3f), &lac2) --> expect rc=2, got 2
  0: BTS 0 to ARFCN 0 (any BSIC)
     cell_id_list cgi[1] = {
        0: 001-02-3-4
     }
  1: BTS 255 to ARFCN 65535 (any BSIC)
     cell_id_list lac[1] = {
       0: 123
     }
  2: BTS 0 to ARFCN 0 BSIC 0
     cell_id_list cgi[2] = {
        0: 001-02-3-4
        1: 005-006-7-8
     }
  3: BTS 255 to ARFCN 65535 BSIC 63
     cell_id_list lac[2] = {
       0: 456
       1: 789
     }

--- size limits
Added first cell identifier list (added 127) --> rc = 127
Added second cell identifier list (tried to add 1) --> rc = -28