aboutsummaryrefslogtreecommitdiffstats
path: root/selftest/resource_test/resource_test.ok
blob: 64cf39b031686dfecda122c76504313903dea8fe (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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
- expect solutions:
[0, 1, 2]
[0, 1, 2]
[1, 0, 2]
[1, 2, 0]
- expect failure to solve:
The requested resource requirements are not solvable [[0, 2], [2], [0, 2]]
- test removing a Resources list from itself
ok, caused exception RuntimeError: Refusing to drop a list of resources from itself. This is probably a bug where a list of Resources() should have been copied but is passed as-is. use Resources.clear() instead.
- test removing a Resources list from one with the same list in it
- test resources config and state dir:
cnf -: DBG: Found main configuration file in  [PATH]/selftest/resource_test/conf/paths.conf which is [PATH]/selftest/resource_test/conf/paths.conf
cnf -: DBG: MAIN CONFIG:
{'default_suites_conf_path': '[PATH]/selftest/resource_test/conf/default-suites.conf',
 'defaults_conf_path': '[PATH]/selftest/resource_test/conf/defaults.conf',
 'resource_conf_path': '[PATH]/selftest/resource_test/conf/resources.conf',
 'scenarios_dir': ['[PATH]/selftest/resource_test/conf/scenarios'],
 'state_dir': '[PATH]/selftest/resource_test/conf/test_work/state_dir',
 'suites_dir': ['[PATH]/selftest/resource_test/conf/suite_test'],
 'trial_dir': '[PATH]/selftest/resource_test/conf/trial'}
*** all resources:
{'bts': [{'_hash': 'd2aa7c1124943de352351b650ca0c751784da6b6',
          'addr': '10.42.42.114',
          'band': 'GSM-1800',
          'ciphers': ['a5_0', 'a5_1'],
          'direct_pcu': 'True',
          'ipa_unit_id': '1',
          'label': 'sysmoBTS 1002',
          'type': 'osmo-bts-sysmo'},
         {'_hash': '2158317d5e0055070e7174c2498dedf53a2957e9',
          'addr': '10.42.42.50',
          'band': 'GSM-1800',
          'ciphers': ['a5_0', 'a5_1'],
          'ipa_unit_id': '6',
          'label': 'Ettus B200',
          'osmo_trx': {'clock_reference': 'external', 'launch_trx': 'True'},
          'type': 'osmo-bts-trx'},
         {'_hash': 'f964ba5fe7a37b97ec3e0c4ef21c9231a19de45d',
          'addr': '10.42.42.51',
          'band': 'GSM-1800',
          'ciphers': ['a5_0', 'a5_1'],
          'ipa_unit_id': '7',
          'label': 'sysmoCell 5000',
          'osmo_trx': {'clock_reference': 'external',
                       'launch_trx': 'False',
                       'trx_ip': '10.42.42.112'},
          'type': 'osmo-bts-trx'}],
 'ip_address': [{'_hash': 'fd103b22c7cf2480d609150e06f4bbd92ac78d8c',
                 'addr': '10.42.42.2'},
                {'_hash': '1c614d6210c551d142aadca8f25e1534ebb2a70f',
                 'addr': '10.42.42.3'},
                {'_hash': '862b529c701adf302477bc126a8032cfc2ec4753',
                 'addr': '10.42.42.4'},
                {'_hash': '05feb6e1e24ca4235889eb28d0a8d5cedac6e5d1',
                 'addr': '10.42.42.5'},
                {'_hash': 'e780ac7581ad29f8f46e637b61d0c38898c4c52c',
                 'addr': '10.42.42.6'}],
 'modem': [{'_hash': '0b538cb6ad799fbd7c2953fd3b4463a76c7cc9c0',
            'auth_algo': 'comp128v1',
            'ciphers': ['a5_0', 'a5_1'],
            'imsi': '901700000009031',
            'ki': '80A37E6FDEA931EAC92FFA5F671EFEAD',
            'label': 'sierra_1',
            'path': '/sierra_1'},
           {'_hash': '3a6e7747dfe7dfdf817bd3351031bd08051605c3',
            'auth_algo': 'comp128v1',
            'ciphers': ['a5_0', 'a5_1'],
            'imsi': '901700000009029',
            'ki': '00969E283349D354A8239E877F2E0866',
            'label': 'sierra_2',
            'path': '/sierra_2'},
           {'_hash': 'f6ba17db2ad13da5ba5c54b5385a774f5351bb5a',
            'auth_algo': 'comp128v1',
            'ciphers': ['a5_0', 'a5_1'],
            'imsi': '901700000009030',
            'ki': 'BB70807226393CDBAC8DD3439FF54252',
            'label': 'gobi_0',
            'path': '/gobi_0'},
           {'_hash': 'fbff2e4f06b727fc8a70da23e1d134f9cd763919',
            'auth_algo': 'comp128v1',
            'ciphers': ['a5_0', 'a5_1'],
            'imsi': '901700000009032',
            'ki': '2F70DCA43C45ACB97E947FDD0C7CA30A',
            'label': 'gobi_3',
            'path': '/gobi_3'}]}
*** end: all resources

- request some resources
--- testowner: Verifying 2 x bts (candidates: 3)
--- testowner: DBG: Picked - _hash: d2aa7c1124943de352351b650ca0c751784da6b6
  addr: 10.42.42.114
  band: GSM-1800
  ciphers:
  - a5_0
  - a5_1
  direct_pcu: 'True'
  ipa_unit_id: '1'
  label: sysmoBTS 1002
  type: osmo-bts-sysmo
- _hash: 2158317d5e0055070e7174c2498dedf53a2957e9
  addr: 10.42.42.50
  band: GSM-1800
  ciphers:
  - a5_0
  - a5_1
  ipa_unit_id: '6'
  label: Ettus B200
  osmo_trx:
    clock_reference: external
    launch_trx: 'True'
  type: osmo-bts-trx
--- testowner: Verifying 1 x ip_address (candidates: 5)
--- testowner: DBG: Picked - _hash: fd103b22c7cf2480d609150e06f4bbd92ac78d8c
  addr: 10.42.42.2
--- testowner: Verifying 2 x modem (candidates: 4)
--- testowner: DBG: Picked - _hash: 0b538cb6ad799fbd7c2953fd3b4463a76c7cc9c0
  auth_algo: comp128v1
  ciphers:
  - a5_0
  - a5_1
  imsi: '901700000009031'
  ki: 80A37E6FDEA931EAC92FFA5F671EFEAD
  label: sierra_1
  path: /sierra_1
- _hash: 3a6e7747dfe7dfdf817bd3351031bd08051605c3
  auth_algo: comp128v1
  ciphers:
  - a5_0
  - a5_1
  imsi: '901700000009029'
  ki: 00969E283349D354A8239E877F2E0866
  label: sierra_2
  path: /sierra_2
--- testowner: DBG: FileWatch: scheduling watch for directory [PATH]/selftest/resource_test/conf/test_work/state_dir
--- testowner: Reserving 2 x bts (candidates: 3)
--- testowner: DBG: Picked - _hash: d2aa7c1124943de352351b650ca0c751784da6b6
  addr: 10.42.42.114
  band: GSM-1800
  ciphers:
  - a5_0
  - a5_1
  direct_pcu: 'True'
  ipa_unit_id: '1'
  label: sysmoBTS 1002
  type: osmo-bts-sysmo
- _hash: 2158317d5e0055070e7174c2498dedf53a2957e9
  addr: 10.42.42.50
  band: GSM-1800
  ciphers:
  - a5_0
  - a5_1
  ipa_unit_id: '6'
  label: Ettus B200
  osmo_trx:
    clock_reference: external
    launch_trx: 'True'
  type: osmo-bts-trx
--- testowner: Reserving 1 x ip_address (candidates: 5)
--- testowner: DBG: Picked - _hash: fd103b22c7cf2480d609150e06f4bbd92ac78d8c
  addr: 10.42.42.2
--- testowner: Reserving 2 x modem (candidates: 4)
--- testowner: DBG: Picked - _hash: 0b538cb6ad799fbd7c2953fd3b4463a76c7cc9c0
  auth_algo: comp128v1
  ciphers:
  - a5_0
  - a5_1
  imsi: '901700000009031'
  ki: 80A37E6FDEA931EAC92FFA5F671EFEAD
  label: sierra_1
  path: /sierra_1
- _hash: 3a6e7747dfe7dfdf817bd3351031bd08051605c3
  auth_algo: comp128v1
  ciphers:
  - a5_0
  - a5_1
  imsi: '901700000009029'
  ki: 00969E283349D354A8239E877F2E0866
  label: sierra_2
  path: /sierra_2
--- testowner: DBG: FileWatch: unscheduling watch <ObservedWatch: path=[PATH]/selftest/resource_test/conf/test_work/state_dir, is_recursive=False>
~~~ currently reserved:
bts:
- _hash: d2aa7c1124943de352351b650ca0c751784da6b6
  _reserved_by: testowner-123-1490837279
  addr: 10.42.42.114
  band: GSM-1800
  ciphers:
  - a5_0
  - a5_1
  direct_pcu: 'True'
  ipa_unit_id: '1'
  label: sysmoBTS 1002
  type: osmo-bts-sysmo
- _hash: 2158317d5e0055070e7174c2498dedf53a2957e9
  _reserved_by: testowner-123-1490837279
  addr: 10.42.42.50
  band: GSM-1800
  ciphers:
  - a5_0
  - a5_1
  ipa_unit_id: '6'
  label: Ettus B200
  osmo_trx:
    clock_reference: external
    launch_trx: 'True'
  type: osmo-bts-trx
ip_address:
- _hash: fd103b22c7cf2480d609150e06f4bbd92ac78d8c
  _reserved_by: testowner-123-1490837279
  addr: 10.42.42.2
modem:
- _hash: 0b538cb6ad799fbd7c2953fd3b4463a76c7cc9c0
  _reserved_by: testowner-123-1490837279
  auth_algo: comp128v1
  ciphers:
  - a5_0
  - a5_1
  imsi: '901700000009031'
  ki: 80A37E6FDEA931EAC92FFA5F671EFEAD
  label: sierra_1
  path: /sierra_1
- _hash: 3a6e7747dfe7dfdf817bd3351031bd08051605c3
  _reserved_by: testowner-123-1490837279
  auth_algo: comp128v1
  ciphers:
  - a5_0
  - a5_1
  imsi: '901700000009029'
  ki: 00969E283349D354A8239E877F2E0866
  label: sierra_2
  path: /sierra_2

~~~ end: currently reserved

~~~ with modifiers:
resources(testowner)={'bts': [{'_hash': 'd2aa7c1124943de352351b650ca0c751784da6b6',
          '_reserved_by': 'testowner-123-1490837279',
          'addr': '10.42.42.114',
          'band': 'GSM-1800',
          'ciphers': ['a5_0', 'a5_1'],
          'direct_pcu': 'True',
          'ipa_unit_id': '1',
          'label': 'sysmoBTS 1002',
          'type': 'osmo-bts-sysmo'},
         {'_hash': '2158317d5e0055070e7174c2498dedf53a2957e9',
          '_reserved_by': 'testowner-123-1490837279',
          'addr': '10.42.42.50',
          'band': 'GSM-1800',
          'ciphers': ['a5_0', 'a5_1'],
          'ipa_unit_id': '6',
          'label': 'Ettus B200',
          'num_trx': 2,
          'osmo_trx': {'clock_reference': 'external', 'launch_trx': 'True'},
          'type': 'osmo-bts-trx'}],
 'ip_address': [{'_hash': 'fd103b22c7cf2480d609150e06f4bbd92ac78d8c',
                 '_reserved_by': 'testowner-123-1490837279',
                 'addr': '10.42.42.2'}],
 'modem': [{'_hash': '0b538cb6ad799fbd7c2953fd3b4463a76c7cc9c0',
            '_reserved_by': 'testowner-123-1490837279',
            'auth_algo': 'comp128v1',
            'ciphers': ['a5_0', 'a5_1'],
            'imsi': '901700000009031',
            'ki': '80A37E6FDEA931EAC92FFA5F671EFEAD',
            'label': 'sierra_1',
            'path': '/sierra_1'},
           {'_hash': '3a6e7747dfe7dfdf817bd3351031bd08051605c3',
            '_reserved_by': 'testowner-123-1490837279',
            'auth_algo': 'comp128v1',
            'ciphers': ['a5_0', 'a5_1'],
            'imsi': '901700000009029',
            'ki': '00969E283349D354A8239E877F2E0866',
            'label': 'sierra_2',
            'path': '/sierra_2'}]}
~~~ end: with modifiers:
~~~ currently reserved:
{}

~~~ end: currently reserved

- item_matches:
1st subset matches correctly, pass
2nd subset matches correctly, pass
3rd subset should not match, pass
3rd subset should not match, pass
4th subset should not match, pass
*** concurrent allocation:
--- testowner1: Verifying 2 x bts (candidates: 3)
--- testowner1: Verifying 1 x ip_address (candidates: 5)
--- testowner1: Verifying 2 x modem (candidates: 4)
--- testowner1: Reserving 2 x bts (candidates: 3)
--- testowner1: Reserving 1 x ip_address (candidates: 5)
--- testowner1: Reserving 2 x modem (candidates: 4)
- 2nd instance reserve() start
--- testowner2: Verifying 2 x bts (candidates: 3)
--- testowner2: Verifying 1 x ip_address (candidates: 5)
--- testowner2: Verifying 2 x modem (candidates: 4)
--- testowner2: Reserving 2 x bts (candidates: 1)
--- testowner2: Unable to reserve resources, too many currently reserved. Waiting until some are available again
- 1st instance free()
--- testowner2: Reserving 2 x bts (candidates: 3)
--- testowner2: Reserving 1 x ip_address (candidates: 5)
--- testowner2: Reserving 2 x modem (candidates: 4)
- 2nd instance reserve() done
*** end: concurrent allocation