forked from omec-project/ausf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ausf_test.go
615 lines (602 loc) · 20.4 KB
/
ausf_test.go
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
// SPDX-FileCopyrightText: 2024 Canonical Ltd.
//
// SPDX-License-Identifier: Apache-2.0
//
/*
* AUSF Unit Testcases
*
*/
package main
import (
"context"
"errors"
"fmt"
"io"
"net/http"
"os"
"strings"
"testing"
"time"
"github.com/antihax/optional"
"github.com/omec-project/ausf/consumer"
ausfContext "github.com/omec-project/ausf/context"
"github.com/omec-project/ausf/factory"
"github.com/omec-project/ausf/producer"
"github.com/omec-project/ausf/service"
"github.com/omec-project/openapi/Nnrf_NFDiscovery"
"github.com/omec-project/openapi/models"
"github.com/stretchr/testify/assert"
)
var (
AUSFTest = &service.AUSF{}
nfInstanceID = "34343-4343-43-434-343"
subscriptionID = "46326-232353-2323"
)
func setupTest() {
if err := os.Setenv("POD_IP", "127.0.0.1"); err != nil {
fmt.Printf("could not set env POD_IP: %+v", err)
}
if err := factory.InitConfigFactory("factory/ausfcfg.yaml"); err != nil {
fmt.Printf("could not InitConfigFactory: %+v", err)
}
}
func TestRegisterNF(t *testing.T) {
origRegisterNFInstance := consumer.SendRegisterNFInstance
origSearchNFInstances := consumer.SendSearchNFInstances
origUpdateNFInstance := consumer.SendUpdateNFInstance
defer func() {
consumer.SendRegisterNFInstance = origRegisterNFInstance
consumer.SendSearchNFInstances = origSearchNFInstances
consumer.SendUpdateNFInstance = origUpdateNFInstance
}()
fmt.Printf("test case TestRegisterNF")
var prof models.NfProfile
consumer.SendRegisterNFInstance = func(nrfUri string, nfInstanceId string, profile models.NfProfile) (models.NfProfile, string, string, error) {
prof = profile
prof.HeartBeatTimer = 1
fmt.Printf("test RegisterNFInstance called")
return prof, "", "", nil
}
consumer.SendSearchNFInstances = func(nrfUri string, targetNfType, requestNfType models.NfType, param *Nnrf_NFDiscovery.SearchNFInstancesParamOpts) (models.SearchResult, error) {
fmt.Printf("test SearchNFInstance called")
return models.SearchResult{}, nil
}
consumer.SendUpdateNFInstance = func(patchItem []models.PatchItem) (nfProfile models.NfProfile, problemDetails *models.ProblemDetails, err error) {
return prof, nil, nil
}
go AUSFTest.RegisterNF()
service.ConfigPodTrigger <- true
time.Sleep(5 * time.Second)
assert.Equal(t, service.KeepAliveTimer != nil, true)
service.ConfigPodTrigger <- false
time.Sleep(1 * time.Second)
assert.Equal(t, service.KeepAliveTimer == nil, true)
}
func TestGetUDMUri(t *testing.T) {
fmt.Printf("test cases for Get UDM URI")
callCountSearchNFInstances := 0
callCountSendNfDiscovery := 0
origNRFCacheSearchNFInstances := consumer.NRFCacheSearchNFInstances
origSendNfDiscoveryToNrf := consumer.SendNfDiscoveryToNrf
udmUri1 := "https://10.0.13.1:8090"
udmUri2 := "https://20.20.13.1:8090"
udmProfile1 := models.NfProfile{
UdmInfo: &models.UdmInfo{
RoutingIndicators: []string{},
},
NfInstanceId: nfInstanceID,
Ipv4Addresses: []string{udmUri1},
NfType: "UDM",
NfStatus: "REGISTERED",
}
services1 := []models.NfService{
{
ServiceInstanceId: "datarepository",
ServiceName: models.ServiceName_NUDM_UEAU,
Versions: &[]models.NfServiceVersion{
{
ApiFullVersion: "1",
ApiVersionInUri: "versionUri",
},
},
Scheme: "https",
NfServiceStatus: models.NfServiceStatus_REGISTERED,
ApiPrefix: udmUri1,
IpEndPoints: &[]models.IpEndPoint{
{
Ipv4Address: "10.0.13.1",
Transport: models.TransportProtocol_TCP,
Port: 8090,
},
},
},
}
udmProfile1.NfServices = &services1
nfInstances1 := []models.NfProfile{
udmProfile1,
}
searchResult1 := models.SearchResult{
ValidityPeriod: 7,
NfInstances: nfInstances1,
NrfSupportedFeatures: "",
}
udmProfile2 := models.NfProfile{
UdmInfo: &models.UdmInfo{
RoutingIndicators: []string{},
},
NfInstanceId: "9999-4343-43-434-343",
Ipv4Addresses: []string{udmUri2},
NfType: "UDM",
NfStatus: "REGISTERED",
}
services2 := []models.NfService{
{
ServiceInstanceId: "datarepository",
ServiceName: models.ServiceName_NUDM_UEAU,
Versions: &[]models.NfServiceVersion{
{
ApiFullVersion: "1",
ApiVersionInUri: "versionUri",
},
},
Scheme: "https",
NfServiceStatus: models.NfServiceStatus_REGISTERED,
ApiPrefix: udmUri2,
IpEndPoints: &[]models.IpEndPoint{
{
Ipv4Address: "20.20.13.1",
Transport: models.TransportProtocol_TCP,
Port: 8090,
},
},
},
}
udmProfile2.NfServices = &services2
nfInstances2 := []models.NfProfile{
udmProfile2,
}
searchResult2 := models.SearchResult{
ValidityPeriod: 7,
NfInstances: nfInstances2,
NrfSupportedFeatures: "",
}
defer func() {
consumer.NRFCacheSearchNFInstances = origNRFCacheSearchNFInstances
consumer.SendNfDiscoveryToNrf = origSendNfDiscoveryToNrf
}()
consumer.NRFCacheSearchNFInstances = func(nrfUri string, targetNfType, requestNfType models.NfType, param *Nnrf_NFDiscovery.SearchNFInstancesParamOpts) (models.SearchResult, error) {
fmt.Printf("test SearchNFInstance called")
callCountSearchNFInstances++
return searchResult1, nil
}
consumer.SendNfDiscoveryToNrf = func(nrfUri string, targetNfType, requestNfType models.NfType, param *Nnrf_NFDiscovery.SearchNFInstancesParamOpts) (models.SearchResult, error) {
fmt.Printf("test SendNfDiscoveryToNrf called")
callCountSendNfDiscovery++
return searchResult2, nil
}
parameters := []struct {
testName string
result string
udmUri string
inputEnableNrfCaching bool
expectedCallCountSearchNFInstances int
expectedCallCountSendNfDiscovery int
}{
{
"NRF caching is enabled request is sent to discover UDM",
"UDM URI is retrieved from NRF cache",
"https://10.0.13.1:8090",
true,
1,
0,
},
{
"NRF caching is disabled request is sent to discover UDM",
"UDM URI is retrieved from NRF trough the NF discovery process",
"https://20.20.13.1:8090",
false,
0,
1,
},
}
for i := range parameters {
t.Run(fmt.Sprintf("NRF caching is [%v]", parameters[i].inputEnableNrfCaching), func(t *testing.T) {
ausfContext.GetSelf().EnableNrfCaching = parameters[i].inputEnableNrfCaching
udm_uri := producer.GetUdmUrl(ausfContext.GetSelf().NrfUri)
assert.Equal(t, parameters[i].expectedCallCountSearchNFInstances, callCountSearchNFInstances, "NF instance is searched in the cache.")
assert.Equal(t, parameters[i].expectedCallCountSendNfDiscovery, callCountSendNfDiscovery, "NF discovery request is sent to NRF.")
assert.Equal(t, parameters[i].udmUri, udm_uri, "UDR Uri is set.")
callCountSendNfDiscovery = 0
callCountSearchNFInstances = 0
})
}
}
func TestCreateSubscriptionSuccess(t *testing.T) {
fmt.Printf("test cases for CreateSubscription")
udmProfile := models.NfProfile{
UdmInfo: &models.UdmInfo{
RoutingIndicators: []string{},
},
NfInstanceId: nfInstanceID,
NfType: "UDM",
NfStatus: "REGISTERED",
}
nfInstances := []models.NfProfile{
udmProfile,
}
searchResult := models.SearchResult{
ValidityPeriod: 7,
NfInstances: nfInstances,
NrfSupportedFeatures: "",
}
stringReader := strings.NewReader("successful!")
stringReadCloser := io.NopCloser(stringReader)
httpResponse := http.Response{
Status: "200 OK",
StatusCode: 200,
Proto: "HTTP/1.0",
ProtoMajor: 1,
ProtoMinor: 0,
Body: stringReadCloser,
}
callCountSendCreateSubscription := 0
origStoreApiSearchNFInstances := consumer.StoreApiSearchNFInstances
origCreateSubscription := consumer.CreateSubscription
defer func() {
consumer.StoreApiSearchNFInstances = origStoreApiSearchNFInstances
consumer.CreateSubscription = origCreateSubscription
}()
consumer.StoreApiSearchNFInstances = func(*Nnrf_NFDiscovery.NFInstancesStoreApiService, context.Context, models.NfType, models.NfType, *Nnrf_NFDiscovery.SearchNFInstancesParamOpts) (models.SearchResult, *http.Response, error) {
fmt.Printf("test SearchNFInstances called")
return searchResult, &httpResponse, nil
}
consumer.CreateSubscription = func(nrfUri string, nrfSubscriptionData models.NrfSubscriptionData) (nrfSubData models.NrfSubscriptionData, problemDetails *models.ProblemDetails, err error) {
fmt.Printf("test SendCreateSubscription called")
callCountSendCreateSubscription++
return models.NrfSubscriptionData{
NfStatusNotificationUri: "https://:0/nausf-callback/v1/nf-status-notify",
ReqNfType: "AUSF",
SubscriptionId: subscriptionID,
}, nil, nil
}
// NRF caching is disabled
ausfContext.GetSelf().EnableNrfCaching = false
param := Nnrf_NFDiscovery.SearchNFInstancesParamOpts{
ServiceNames: optional.NewInterface([]models.ServiceName{models.ServiceName_NUDM_UEAU}),
}
parameters := []struct {
expectedError error
testName string
result string
nfInstanceId string
subscriptionId string
expectedCallCountSendCreateSubscription int
}{
{
nil,
"NF instances are found in Store Api subscription is not created for NFInstanceID yet",
"Subscription is created",
nfInstanceID,
subscriptionID,
1,
},
{
nil,
"NF instances are found in Store Api subscription is already created for NFInstanceID",
"Subscription is not created again",
nfInstanceID,
subscriptionID,
0,
},
}
for i := range parameters {
t.Run(fmt.Sprintf("CreateSubscription testname %v result %v", parameters[i].testName, parameters[i].result), func(t *testing.T) {
_, err := consumer.SendNfDiscoveryToNrf("testNRFUri", "UDM", "AUSF", ¶m)
val, _ := ausfContext.GetSelf().NfStatusSubscriptions.Load(parameters[i].nfInstanceId)
assert.Equal(t, val, parameters[i].subscriptionId, "Correct Subscription ID is not stored in the AUSF context.")
assert.Equal(t, parameters[i].expectedError, err, "SendNfDiscoveryToNrf is failed.")
// Subscription is created.
assert.Equal(t, parameters[i].expectedCallCountSendCreateSubscription, callCountSendCreateSubscription, "Subscription is not created for NF instance.")
callCountSendCreateSubscription = 0
})
}
}
func TestCreateSubscriptionFail(t *testing.T) {
fmt.Printf("test cases for CreateSubscription")
udmProfile := models.NfProfile{
UdmInfo: &models.UdmInfo{
RoutingIndicators: []string{},
},
NfInstanceId: "84343-4343-43-434-343",
NfType: "UDM",
NfStatus: "REGISTERED",
}
nfInstances := []models.NfProfile{
udmProfile,
}
searchResult := models.SearchResult{
ValidityPeriod: 7,
NfInstances: nfInstances,
NrfSupportedFeatures: "",
}
emptySearchResult := models.SearchResult{}
nrfSubscriptionData := models.NrfSubscriptionData{
NfStatusNotificationUri: "https://:0/nausf-callback/v1/nf-status-notify",
ReqNfType: "AUSF",
SubscriptionId: "",
}
emptyNrfSubscriptionData := models.NrfSubscriptionData{}
stringReader := strings.NewReader("successful!")
stringReadCloser := io.NopCloser(stringReader)
httpResponseTemporaryDirect := http.Response{
Status: "307 Temporary Direct",
StatusCode: 307,
Proto: "HTTP/1.0",
ProtoMajor: 1,
ProtoMinor: 0,
Body: stringReadCloser,
}
httpResponseSuccess := http.Response{
Status: "200 OK",
StatusCode: 200,
Proto: "HTTP/1.0",
ProtoMajor: 1,
ProtoMinor: 0,
Body: stringReadCloser,
}
serverErrorProblem := models.ProblemDetails{
Status: http.StatusInternalServerError,
Cause: "Server Error",
Detail: "",
}
callCountSendCreateSubscription := 0
origStoreApiSearchNFInstances := consumer.StoreApiSearchNFInstances
origCreateSubscription := consumer.CreateSubscription
defer func() {
consumer.StoreApiSearchNFInstances = origStoreApiSearchNFInstances
consumer.CreateSubscription = origCreateSubscription
}()
// NRF caching is disabled
ausfContext.GetSelf().EnableNrfCaching = false
param := Nnrf_NFDiscovery.SearchNFInstancesParamOpts{
ServiceNames: optional.NewInterface([]models.ServiceName{models.ServiceName_NUDM_UEAU}),
}
parameters := []struct {
httpResponse http.Response
expectedSubscriptionId any
subscriptionError error
expectedError error
subscriptionProblem *models.ProblemDetails
nrfSubscriptionData models.NrfSubscriptionData
searchResult models.SearchResult
testName string
result string
expectedCallCountSendCreateSubscription int
}{
{
httpResponseTemporaryDirect,
nil,
nil,
errors.New("temporary redirect for non NRF consumer"),
nil,
emptyNrfSubscriptionData,
emptySearchResult,
"Store Api returns HTTP code 307",
"Subscription is not created",
0,
},
{
httpResponseSuccess,
"",
nil,
nil,
&serverErrorProblem,
emptyNrfSubscriptionData,
searchResult,
"NF instances are found in Store Api subscription but create subscription reports problem",
"Subscription request is sent but problem is reported",
1,
},
{
httpResponseSuccess,
"",
errors.New("SendCreateSubscription request failed"),
errors.New("SendCreateSubscription request failed"),
nil,
emptyNrfSubscriptionData,
searchResult,
"NF instances are found in Store Api subscription but create subscription reports error",
"Subscription request is sent but error is reported",
1,
},
{
httpResponseSuccess,
"",
nil,
nil,
nil,
nrfSubscriptionData,
searchResult,
"NF instances are found in Store Api subscription subscription is created but nrfSubData does not have Subscription ID",
"SubscriptionId is not stored in NfStatusSubscriptions",
1,
},
}
for i := range parameters {
t.Run(fmt.Sprintf("CreateSubscription testname %v result %v", parameters[i].testName, parameters[i].result), func(t *testing.T) {
consumer.StoreApiSearchNFInstances = func(*Nnrf_NFDiscovery.NFInstancesStoreApiService, context.Context, models.NfType, models.NfType, *Nnrf_NFDiscovery.SearchNFInstancesParamOpts) (models.SearchResult, *http.Response, error) {
fmt.Printf("test SearchNFInstances called")
return parameters[i].searchResult, ¶meters[i].httpResponse, nil
}
consumer.CreateSubscription = func(nrfUri string, nrfSubscriptionData models.NrfSubscriptionData) (nrfSubData models.NrfSubscriptionData, problemDetails *models.ProblemDetails, err error) {
fmt.Printf("test SendCreateSubscription called")
callCountSendCreateSubscription++
return parameters[i].nrfSubscriptionData, parameters[i].subscriptionProblem, parameters[i].subscriptionError
}
_, err := consumer.SendNfDiscoveryToNrf("testNRFUri", "UDM", "AUSF", ¶m)
val, _ := ausfContext.GetSelf().NfStatusSubscriptions.Load(udmProfile.NfInstanceId)
assert.Equal(t, val, parameters[i].expectedSubscriptionId, "Correct Subscription ID is not stored in the AUSF context.")
assert.Equal(t, parameters[i].expectedError, err, "SendNfDiscoveryToNrf is failed.")
assert.Equal(t, parameters[i].expectedCallCountSendCreateSubscription, callCountSendCreateSubscription, "Subscription is not created for NF instance.")
callCountSendCreateSubscription = 0
ausfContext.GetSelf().NfStatusSubscriptions.Delete(udmProfile.NfInstanceId)
})
}
}
func TestNfSubscriptionStatusNotify(t *testing.T) {
fmt.Printf("test cases for NfSubscriptionStatusNotify")
callCountSendRemoveSubscription := 0
callCountNRFCacheRemoveNfProfileFromNrfCache := 0
origSendRemoveSubscription := consumer.SendRemoveSubscription
origNRFCacheRemoveNfProfileFromNrfCache := producer.NRFCacheRemoveNfProfileFromNrfCache
defer func() {
consumer.SendRemoveSubscription = origSendRemoveSubscription
producer.NRFCacheRemoveNfProfileFromNrfCache = origNRFCacheRemoveNfProfileFromNrfCache
}()
consumer.SendRemoveSubscription = func(subscriptionId string) (problemDetails *models.ProblemDetails, err error) {
fmt.Printf("test SendRemoveSubscription called")
callCountSendRemoveSubscription++
return nil, nil
}
producer.NRFCacheRemoveNfProfileFromNrfCache = func(nfInstanceId string) bool {
fmt.Printf("test NRFCacheRemoveNfProfileFromNrfCache called")
callCountNRFCacheRemoveNfProfileFromNrfCache++
return true
}
udmProfile := models.NfProfileNotificationData{
UdmInfo: &models.UdmInfo{
RoutingIndicators: []string{},
},
NfInstanceId: nfInstanceID,
NfType: "UDM",
NfStatus: "DEREGISTERED",
}
badRequestProblem := models.ProblemDetails{
Status: http.StatusBadRequest,
Cause: "MANDATORY_IE_MISSING",
Detail: "Missing IE [Event]/[NfInstanceUri] in NotificationData",
}
parameters := []struct {
expectedProblem *models.ProblemDetails
testName string
result string
nfInstanceId string
nfInstanceIdForSubscription string
subscriptionID string
notificationEventType string
expectedCallCountSendRemoveSubscription int
expectedCallCountNRFCacheRemoveNfProfileFromNrfCache int
enableNrfCaching bool
}{
{
nil,
"Notification event type DEREGISTERED NRF caching is enabled",
"NF profile removed from cache and subscription is removed",
nfInstanceID,
nfInstanceID,
subscriptionID,
"NF_DEREGISTERED",
1,
1,
true,
},
{
nil,
"Notification event type DEREGISTERED NRF caching is enabled Subscription is not found",
"NF profile removed from cache and subscription is not removed",
nfInstanceID,
"",
"",
"NF_DEREGISTERED",
0,
1,
true,
},
{
nil,
"Notification event type DEREGISTERED NRF caching is disabled",
"NF profile is not removed from cache and subscription is removed",
nfInstanceID,
nfInstanceID,
subscriptionID,
"NF_DEREGISTERED",
1,
0,
false,
},
{
nil,
"Notification event type REGISTERED NRF caching is enabled",
"NF profile is not removed from cache and subscription is not removed",
nfInstanceID,
nfInstanceID,
subscriptionID,
"NF_REGISTERED",
0,
0,
true,
},
{
nil,
"Notification event type DEREGISTERED NRF caching is enabled NfInstanceUri in notificationData is different",
"NF profile removed from cache and subscription is not removed",
nfInstanceID,
nfInstanceID,
subscriptionID,
"NF_DEREGISTERED",
1,
1,
true,
},
{
&badRequestProblem,
"Notification event type DEREGISTERED NRF caching is enabled NfInstanceUri in notificationData is empty",
"Return StatusBadRequest with cause MANDATORY_IE_MISSING",
"",
"",
subscriptionID,
"NF_DEREGISTERED",
0,
0,
true,
},
{
&badRequestProblem,
"Notification event type empty NRF caching is enabled",
"Return StatusBadRequest with cause MANDATORY_IE_MISSING",
nfInstanceID,
nfInstanceID,
subscriptionID,
"",
0,
0,
true,
},
}
for i := range parameters {
t.Run(fmt.Sprintf("NfSubscriptionStatusNotify testname %v result %v", parameters[i].testName, parameters[i].result), func(t *testing.T) {
ausfContext.GetSelf().EnableNrfCaching = parameters[i].enableNrfCaching
ausfContext.GetSelf().NfStatusSubscriptions.Store(parameters[i].nfInstanceIdForSubscription, parameters[i].subscriptionID)
notificationData := models.NotificationData{
Event: models.NotificationEventType(parameters[i].notificationEventType),
NfInstanceUri: parameters[i].nfInstanceId,
NfProfile: &udmProfile,
ProfileChanges: []models.ChangeItem{},
}
err := producer.NfSubscriptionStatusNotifyProcedure(notificationData)
assert.Equal(t, parameters[i].expectedProblem, err, "NfSubscriptionStatusNotifyProcedure is failed.")
// Subscription is removed.
assert.Equal(t, parameters[i].expectedCallCountSendRemoveSubscription, callCountSendRemoveSubscription, "Subscription is not removed.")
// NF Profile is removed from NRF cache.
assert.Equal(t, parameters[i].expectedCallCountNRFCacheRemoveNfProfileFromNrfCache, callCountNRFCacheRemoveNfProfileFromNrfCache, "NF Profile is not removed from NRF cache.")
callCountSendRemoveSubscription = 0
callCountNRFCacheRemoveNfProfileFromNrfCache = 0
ausfContext.GetSelf().NfStatusSubscriptions.Delete(parameters[i].nfInstanceIdForSubscription)
})
}
}
func TestMain(m *testing.M) {
setupTest()
exitVal := m.Run()
os.Exit(exitVal)
}