[RIC-306] Split configuration of globalRicId to mmc, mnc and ric id
[ric-plt/e2mgr.git] / E2Manager / configuration / configuration_test.go
1 //
2 // Copyright 2019 AT&T Intellectual Property
3 // Copyright 2019 Nokia
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //      http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16
17 //  This source code is part of the near-RT RIC (RAN Intelligent Controller)
18 //  platform project (RICP).
19
20
21 package configuration
22
23 import (
24         "github.com/stretchr/testify/assert"
25         "gopkg.in/yaml.v2"
26         "io/ioutil"
27         "os"
28         "testing"
29 )
30
31 func TestParseConfigurationSuccess(t *testing.T) {
32         config := ParseConfiguration()
33         assert.Equal(t, 3800, config.Http.Port)
34         assert.Equal(t, 3801, config.Rmr.Port)
35         assert.Equal(t, 65536, config.Rmr.MaxMsgSize)
36         assert.Equal(t, "info", config.Logging.LogLevel)
37         assert.Equal(t, 100, config.NotificationResponseBuffer)
38         assert.Equal(t, 5, config.BigRedButtonTimeoutSec)
39         assert.Equal(t, 4500, config.KeepAliveResponseTimeoutMs)
40         assert.Equal(t, 1500, config.KeepAliveDelayMs)
41         assert.Equal(t, 15000, config.E2TInstanceDeletionTimeoutMs)
42         assert.NotNil(t, config.GlobalRicId)
43         assert.Equal(t, "AACCE", config.GlobalRicId.RicId)
44         assert.Equal(t, 327, config.GlobalRicId.Mcc)
45         assert.Equal(t, 94, config.GlobalRicId.Mnc)
46 }
47
48 func TestStringer(t *testing.T) {
49         config := ParseConfiguration().String()
50         assert.NotEmpty(t, config)
51 }
52
53 func TestParseConfigurationFileNotFoundFailure(t *testing.T) {
54         configPath := "../resources/configuration.yaml"
55         configPathTmp := "../resources/configuration.yaml_tmp"
56         err := os.Rename(configPath, configPathTmp)
57         if err != nil {
58                 t.Errorf("#TestParseConfigurationFileNotFoundFailure - failed to rename configuration file: %s\n", configPath)
59         }
60         defer func() {
61                 err = os.Rename(configPathTmp, configPath)
62                 if err != nil {
63                         t.Errorf("#TestParseConfigurationFileNotFoundFailure - failed to rename configuration file: %s\n", configPath)
64                 }
65         }()
66         assert.Panics(t, func() { ParseConfiguration() })
67 }
68
69 func TestRmrConfigNotFoundFailure(t *testing.T) {
70         configPath := "../resources/configuration.yaml"
71         configPathTmp := "../resources/configuration.yaml_tmp"
72         err := os.Rename(configPath, configPathTmp)
73         if err != nil {
74                 t.Errorf("#TestRmrConfigNotFoundFailure - failed to rename configuration file: %s\n", configPath)
75         }
76         defer func() {
77                 err = os.Rename(configPathTmp, configPath)
78                 if err != nil {
79                         t.Errorf("#TestRmrConfigNotFoundFailure - failed to rename configuration file: %s\n", configPath)
80                 }
81         }()
82         yamlMap := map[string]interface{}{
83                 "logging": map[string]interface{}{"logLevel": "info"},
84                 "http":    map[string]interface{}{"port": 3800},
85                 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
86                 "globalRicId":    map[string]interface{}{"plmnId": "131014", "ricNearRtId": "556670"},
87         }
88         buf, err := yaml.Marshal(yamlMap)
89         if err != nil {
90                 t.Errorf("#TestRmrConfigNotFoundFailure - failed to marshal configuration map\n")
91         }
92         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
93         if err != nil {
94                 t.Errorf("#TestRmrConfigNotFoundFailure - failed to write configuration file: %s\n", configPath)
95         }
96         assert.PanicsWithValue(t, "#configuration.populateRmrConfig - failed to populate RMR configuration: The entry 'rmr' not found\n", func() { ParseConfiguration() })
97 }
98
99 func TestLoggingConfigNotFoundFailure(t *testing.T) {
100         configPath := "../resources/configuration.yaml"
101         configPathTmp := "../resources/configuration.yaml_tmp"
102         err := os.Rename(configPath, configPathTmp)
103         if err != nil {
104                 t.Errorf("#TestLoggingConfigNotFoundFailure - failed to rename configuration file: %s\n", configPath)
105         }
106         defer func() {
107                 err = os.Rename(configPathTmp, configPath)
108                 if err != nil {
109                         t.Errorf("#TestLoggingConfigNotFoundFailure - failed to rename configuration file: %s\n", configPath)
110                 }
111         }()
112         yamlMap := map[string]interface{}{
113                 "rmr":  map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
114                 "http": map[string]interface{}{"port": 3800},
115                 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
116                 "globalRicId":    map[string]interface{}{"plmnId": "131014", "ricNearRtId": "556670"},
117         }
118         buf, err := yaml.Marshal(yamlMap)
119         if err != nil {
120                 t.Errorf("#TestRmrConfigNotFoundFailure - failed to marshal configuration map\n")
121         }
122         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
123         if err != nil {
124                 t.Errorf("#TestRmrConfigNotFoundFailure - failed to write configuration file: %s\n", configPath)
125         }
126         assert.PanicsWithValue(t, "#configuration.populateLoggingConfig - failed to populate logging configuration: The entry 'logging' not found\n",
127                 func() { ParseConfiguration() })
128 }
129
130 func TestHttpConfigNotFoundFailure(t *testing.T) {
131         configPath := "../resources/configuration.yaml"
132         configPathTmp := "../resources/configuration.yaml_tmp"
133         err := os.Rename(configPath, configPathTmp)
134         if err != nil {
135                 t.Errorf("#TestHttpConfigNotFoundFailure - failed to rename configuration file: %s\n", configPath)
136         }
137         defer func() {
138                 err = os.Rename(configPathTmp, configPath)
139                 if err != nil {
140                         t.Errorf("#TestHttpConfigNotFoundFailure - failed to rename configuration file: %s\n", configPath)
141                 }
142         }()
143         yamlMap := map[string]interface{}{
144                 "rmr":     map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
145                 "logging": map[string]interface{}{"logLevel": "info"},
146                 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
147                 "globalRicId":    map[string]interface{}{"plmnId": "131014", "ricNearRtId": "556670"},
148         }
149         buf, err := yaml.Marshal(yamlMap)
150         if err != nil {
151                 t.Errorf("#TestHttpConfigNotFoundFailure - failed to marshal configuration map\n")
152         }
153         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
154         if err != nil {
155                 t.Errorf("#TestHttpConfigNotFoundFailure - failed to write configuration file: %s\n", configPath)
156         }
157         assert.PanicsWithValue(t, "#configuration.populateHttpConfig - failed to populate HTTP configuration: The entry 'http' not found\n",
158                 func() { ParseConfiguration() })
159 }
160
161 func TestRoutingManagerConfigNotFoundFailure(t *testing.T) {
162         configPath := "../resources/configuration.yaml"
163         configPathTmp := "../resources/configuration.yaml_tmp"
164         err := os.Rename(configPath, configPathTmp)
165         if err != nil {
166                 t.Errorf("#TestRoutingManagerConfigNotFoundFailure - failed to rename configuration file: %s\n", configPath)
167         }
168         defer func() {
169                 err = os.Rename(configPathTmp, configPath)
170                 if err != nil {
171                         t.Errorf("#TestRoutingManagerConfigNotFoundFailure - failed to rename configuration file: %s\n", configPath)
172                 }
173         }()
174         yamlMap := map[string]interface{}{
175                 "rmr":     map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
176                 "logging": map[string]interface{}{"logLevel": "info"},
177                 "http": map[string]interface{}{"port": 3800},
178                 "globalRicId":    map[string]interface{}{"mcc": 327, "mnc": 94, "ricId": "AACCE"},
179         }
180         buf, err := yaml.Marshal(yamlMap)
181         if err != nil {
182                 t.Errorf("#TestRoutingManagerConfigNotFoundFailure - failed to marshal configuration map\n")
183         }
184         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
185         if err != nil {
186                 t.Errorf("#TestRoutingManagerConfigNotFoundFailure - failed to write configuration file: %s\n", configPath)
187         }
188         assert.PanicsWithValue(t, "#configuration.populateRoutingManagerConfig - failed to populate Routing Manager configuration: The entry 'routingManager' not found\n",
189                 func() { ParseConfiguration() })
190 }
191
192 func TestGlobalRicIdConfigNotFoundFailure(t *testing.T) {
193         configPath := "../resources/configuration.yaml"
194         configPathTmp := "../resources/configuration.yaml_tmp"
195         err := os.Rename(configPath, configPathTmp)
196         if err != nil {
197                 t.Errorf("#TestGlobalRicIdConfigNotFoundFailure - failed to rename configuration file: %s\n", configPath)
198         }
199         defer func() {
200                 err = os.Rename(configPathTmp, configPath)
201                 if err != nil {
202                         t.Errorf("#TestGlobalRicIdConfigNotFoundFailure - failed to rename configuration file: %s\n", configPath)
203                 }
204         }()
205         yamlMap := map[string]interface{}{
206                 "rmr":     map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
207                 "logging": map[string]interface{}{"logLevel": "info"},
208                 "http": map[string]interface{}{"port": 3800},
209                 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
210         }
211         buf, err := yaml.Marshal(yamlMap)
212         if err != nil {
213                 t.Errorf("#TestGlobalRicIdConfigNotFoundFailure - failed to marshal configuration map\n")
214         }
215         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
216         if err != nil {
217                 t.Errorf("#TestGlobalRicIdConfigNotFoundFailure - failed to write configuration file: %s\n", configPath)
218         }
219         assert.PanicsWithValue(t, "#configuration.validateGlobalRicIdConfig - failed to populate Global RicId configuration: The entry 'globalRicId' not found\n",
220                 func() { ParseConfiguration() })
221 }
222
223 func TestEmptyRicIdFailure(t *testing.T) {
224 configPath := "../resources/configuration.yaml"
225 configPathTmp := "../resources/configuration.yaml_tmp"
226 err := os.Rename(configPath, configPathTmp)
227 if err != nil {
228 t.Errorf("#TestEmptyRicIdFailure - failed to rename configuration file: %s\n", configPath)
229 }
230 defer func() {
231 err = os.Rename(configPathTmp, configPath)
232 if err != nil {
233 t.Errorf("#TestEmptyRicIdFailure - failed to rename configuration file: %s\n", configPath)
234 }
235 }()
236 yamlMap := map[string]interface{}{
237 "rmr":     map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
238 "logging": map[string]interface{}{"logLevel": "info"},
239 "http": map[string]interface{}{"port": 3800},
240 "globalRicId":    map[string]interface{}{"mcc": 327, "mnc": 94, "ricId": ""},
241 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
242 }
243 buf, err := yaml.Marshal(yamlMap)
244 if err != nil {
245 t.Errorf("#TestEmptyRicIdFailure - failed to marshal configuration map\n")
246 }
247 err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
248 if err != nil {
249 t.Errorf("#TestEmptyRicIdFailure - failed to write configuration file: %s\n", configPath)
250 }
251 assert.PanicsWithValue(t, "#configuration.validateRicId - ricId is emtpy\n",
252 func() { ParseConfiguration() })
253 }
254
255 func TestNonHexRicIdFailure(t *testing.T) {
256         configPath := "../resources/configuration.yaml"
257         configPathTmp := "../resources/configuration.yaml_tmp"
258         err := os.Rename(configPath, configPathTmp)
259         if err != nil {
260                 t.Errorf("#TestNonHexRicIdFailure - failed to rename configuration file: %s\n", configPath)
261         }
262         defer func() {
263                 err = os.Rename(configPathTmp, configPath)
264                 if err != nil {
265                         t.Errorf("#TestNonHexRicIdFailure - failed to rename configuration file: %s\n", configPath)
266                 }
267         }()
268         yamlMap := map[string]interface{}{
269                 "rmr":     map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
270                 "logging": map[string]interface{}{"logLevel": "info"},
271                 "http": map[string]interface{}{"port": 3800},
272                 "globalRicId":    map[string]interface{}{"mcc": 327, "mnc": 94, "ricId": "TEST1"},
273                 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
274         }
275         buf, err := yaml.Marshal(yamlMap)
276         if err != nil {
277                 t.Errorf("#TestNonHexRicIdFailure - failed to marshal configuration map\n")
278         }
279         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
280         if err != nil {
281                 t.Errorf("#TestNonHexRicIdFailure - failed to write configuration file: %s\n", configPath)
282         }
283         assert.PanicsWithValue(t, "#configuration.validateRicId - ricId is not hex number\n",
284                 func() { ParseConfiguration() })
285 }
286
287 func TestWrongRicIdLengthFailure(t *testing.T) {
288         configPath := "../resources/configuration.yaml"
289         configPathTmp := "../resources/configuration.yaml_tmp"
290         err := os.Rename(configPath, configPathTmp)
291         if err != nil {
292                 t.Errorf("#TestWrongRicIdLengthFailure - failed to rename configuration file: %s\n", configPath)
293         }
294         defer func() {
295                 err = os.Rename(configPathTmp, configPath)
296                 if err != nil {
297                         t.Errorf("#TestWrongRicIdLengthFailure - failed to rename configuration file: %s\n", configPath)
298                 }
299         }()
300         yamlMap := map[string]interface{}{
301                 "rmr":     map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
302                 "logging": map[string]interface{}{"logLevel": "info"},
303                 "http": map[string]interface{}{"port": 3800},
304                 "globalRicId":    map[string]interface{}{"mcc": 327, "mnc": 94, "ricId": "AA43"},
305                 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
306         }
307         buf, err := yaml.Marshal(yamlMap)
308         if err != nil {
309                 t.Errorf("#TestWrongRicIdLengthFailure - failed to marshal configuration map\n")
310         }
311         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
312         if err != nil {
313                 t.Errorf("#TestWrongRicIdLengthFailure - failed to write configuration file: %s\n", configPath)
314         }
315         assert.PanicsWithValue(t, "#configuration.validateRicId - ricId length should be 5 hex characters\n",
316                 func() { ParseConfiguration() })
317 }
318
319 func TestMccNotThreeDigitsFailure(t *testing.T) {
320         configPath := "../resources/configuration.yaml"
321         configPathTmp := "../resources/configuration.yaml_tmp"
322         err := os.Rename(configPath, configPathTmp)
323         if err != nil {
324                 t.Errorf("#TestMccNotThreeDigitsFailure - failed to rename configuration file: %s\n", configPath)
325         }
326         defer func() {
327                 err = os.Rename(configPathTmp, configPath)
328                 if err != nil {
329                         t.Errorf("#TestMccNotThreeDigitsFailure - failed to rename configuration file: %s\n", configPath)
330                 }
331         }()
332         yamlMap := map[string]interface{}{
333                 "rmr":     map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
334                 "logging": map[string]interface{}{"logLevel": "info"},
335                 "http": map[string]interface{}{"port": 3800},
336                 "globalRicId":    map[string]interface{}{"mcc": "31", "mnc": "94", "ricId": "AA443"},
337                 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
338         }
339         buf, err := yaml.Marshal(yamlMap)
340         if err != nil {
341                 t.Errorf("#TestMccNotThreeDigitsFailure - failed to marshal configuration map\n")
342         }
343         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
344         if err != nil {
345                 t.Errorf("#TestMccNotThreeDigitsFailure - failed to write configuration file: %s\n", configPath)
346         }
347         assert.PanicsWithValue(t, "#configuration.validateMcc - mcc is not 3 digits\n",
348                 func() { ParseConfiguration() })
349 }
350
351 func TestMncLengthIsGreaterThanThreeDigitsFailure(t *testing.T) {
352         configPath := "../resources/configuration.yaml"
353         configPathTmp := "../resources/configuration.yaml_tmp"
354         err := os.Rename(configPath, configPathTmp)
355         if err != nil {
356                 t.Errorf("#TestMncLengthIsGreaterThanThreeDigitsFailure - failed to rename configuration file: %s\n", configPath)
357         }
358         defer func() {
359                 err = os.Rename(configPathTmp, configPath)
360                 if err != nil {
361                         t.Errorf("#TestMncLengthIsGreaterThanThreeDigitsFailure - failed to rename configuration file: %s\n", configPath)
362                 }
363         }()
364         yamlMap := map[string]interface{}{
365                 "rmr":     map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
366                 "logging": map[string]interface{}{"logLevel": "info"},
367                 "http": map[string]interface{}{"port": 3800},
368                 "globalRicId":    map[string]interface{}{"mcc": "310", "mnc": "6794", "ricId": "AA443"},
369                 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
370         }
371         buf, err := yaml.Marshal(yamlMap)
372         if err != nil {
373                 t.Errorf("#TestMncLengthIsGreaterThanThreeDigitsFailure - failed to marshal configuration map\n")
374         }
375         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
376         if err != nil {
377                 t.Errorf("#TestMncLengthIsGreaterThanThreeDigitsFailure - failed to write configuration file: %s\n", configPath)
378         }
379         assert.PanicsWithValue(t, "#configuration.validateMnc - mnc is not 2 or 3 digits\n",
380                 func() { ParseConfiguration() })
381 }
382
383 func TestMncLengthIsLessThanTwoDigitsFailure(t *testing.T) {
384         configPath := "../resources/configuration.yaml"
385         configPathTmp := "../resources/configuration.yaml_tmp"
386         err := os.Rename(configPath, configPathTmp)
387         if err != nil {
388                 t.Errorf("#TestMncLengthIsLessThanTwoDigitsFailure - failed to rename configuration file: %s\n", configPath)
389         }
390         defer func() {
391                 err = os.Rename(configPathTmp, configPath)
392                 if err != nil {
393                         t.Errorf("#TestMncLengthIsLessThanTwoDigitsFailure - failed to rename configuration file: %s\n", configPath)
394                 }
395         }()
396         yamlMap := map[string]interface{}{
397                 "rmr":     map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
398                 "logging": map[string]interface{}{"logLevel": "info"},
399                 "http": map[string]interface{}{"port": 3800},
400                 "globalRicId":    map[string]interface{}{"mcc": "310", "mnc": "4", "ricId": "AA443"},
401                 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
402         }
403         buf, err := yaml.Marshal(yamlMap)
404         if err != nil {
405                 t.Errorf("#TestMncLengthIsLessThanTwoDigitsFailure - failed to marshal configuration map\n")
406         }
407         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
408         if err != nil {
409                 t.Errorf("#TestMncLengthIsLessThanTwoDigitsFailure - failed to write configuration file: %s\n", configPath)
410         }
411         assert.PanicsWithValue(t, "#configuration.validateMnc - mnc is not 2 or 3 digits\n",
412                 func() { ParseConfiguration() })
413 }
414
415 func TestNegativeMncFailure(t *testing.T) {
416         configPath := "../resources/configuration.yaml"
417         configPathTmp := "../resources/configuration.yaml_tmp"
418         err := os.Rename(configPath, configPathTmp)
419         if err != nil {
420                 t.Errorf("#TestNegativeMncFailure - failed to rename configuration file: %s\n", configPath)
421         }
422         defer func() {
423                 err = os.Rename(configPathTmp, configPath)
424                 if err != nil {
425                         t.Errorf("#TestNegativeMncFailure - failed to rename configuration file: %s\n", configPath)
426                 }
427         }()
428         yamlMap := map[string]interface{}{
429                 "rmr":     map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
430                 "logging": map[string]interface{}{"logLevel": "info"},
431                 "http": map[string]interface{}{"port": 3800},
432                 "globalRicId":    map[string]interface{}{"mcc": "310", "mnc": -2, "ricId": "AA443"},
433                 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
434         }
435         buf, err := yaml.Marshal(yamlMap)
436         if err != nil {
437                 t.Errorf("#TestNegativeMncFailure - failed to marshal configuration map\n")
438         }
439         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
440         if err != nil {
441                 t.Errorf("#TestNegativeMncFailure - failed to write configuration file: %s\n", configPath)
442         }
443         assert.PanicsWithValue(t, "#configuration.validateMnc - mnc is negative\n",
444                 func() { ParseConfiguration() })
445 }
446
447 func TestNegativeMccFailure(t *testing.T) {
448         configPath := "../resources/configuration.yaml"
449         configPathTmp := "../resources/configuration.yaml_tmp"
450         err := os.Rename(configPath, configPathTmp)
451         if err != nil {
452                 t.Errorf("#TestNegativeMncFailure - failed to rename configuration file: %s\n", configPath)
453         }
454         defer func() {
455                 err = os.Rename(configPathTmp, configPath)
456                 if err != nil {
457                         t.Errorf("#TestNegativeMncFailure - failed to rename configuration file: %s\n", configPath)
458                 }
459         }()
460         yamlMap := map[string]interface{}{
461                 "rmr":     map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
462                 "logging": map[string]interface{}{"logLevel": "info"},
463                 "http": map[string]interface{}{"port": 3800},
464                 "globalRicId":    map[string]interface{}{"mcc": -31, "mnc": 222, "ricId": "AA443"},
465                 "routingManager":    map[string]interface{}{"baseUrl": "http://iltlv740.intl.att.com:8080/ric/v1/handles/"},
466         }
467         buf, err := yaml.Marshal(yamlMap)
468         if err != nil {
469                 t.Errorf("#TestNegativeMncFailure - failed to marshal configuration map\n")
470         }
471         err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
472         if err != nil {
473                 t.Errorf("#TestNegativeMncFailure - failed to write configuration file: %s\n", configPath)
474         }
475         assert.PanicsWithValue(t, "#configuration.validateMcc - mcc is negative\n",
476                 func() { ParseConfiguration() })
477 }