blob: bf44a62457b831e60b1e50dddc4f2c87e03de76b [file] [log] [blame]
Anssi Mannila4abf1802021-01-28 13:06:46 +02001/*
2==================================================================================
3 Copyright (c) 2019 AT&T Intellectual Property.
4 Copyright (c) 2019 Nokia
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17==================================================================================
18*/
19
20package control
21
22import (
23 "testing"
24)
25
26func TestAddAllCountersOnce(t *testing.T) {
27
28 // Check that all counters can be added correctly
Anssi Mannila6b3796f2021-02-12 09:11:35 +020029 mainCtrl.CounterValuesToBeVeriefied(t, CountersToBeAdded{
30 Counter{cSubReqFromXapp, 1},
Anssi Mannila6b3796f2021-02-12 09:11:35 +020031 Counter{cSubRespToXapp, 1},
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000032 Counter{cSubFailToXapp, 1},
Anssi Mannila316d8a12021-06-02 11:08:54 +030033 Counter{cRestSubReqFromXapp, 1},
34 Counter{cRestSubRespToXapp, 1},
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000035 Counter{cRestSubFailToXapp, 1},
Anssi Mannila3d80b722021-11-12 13:17:15 +020036 Counter{cRestReqRejDueE2Down, 1},
Anssi Mannila316d8a12021-06-02 11:08:54 +030037 Counter{cRestSubNotifToXapp, 1},
38 Counter{cRestSubFailNotifToXapp, 1},
Anssi Mannila6b3796f2021-02-12 09:11:35 +020039 Counter{cSubReqToE2, 1},
40 Counter{cSubReReqToE2, 1},
41 Counter{cSubRespFromE2, 1},
Anssi Mannila56233b02022-01-24 13:26:42 +020042 Counter{cPartialSubRespFromE2, 1},
Anssi Mannila6b3796f2021-02-12 09:11:35 +020043 Counter{cSubFailFromE2, 1},
44 Counter{cSubReqTimerExpiry, 1},
45 Counter{cRouteCreateFail, 1},
46 Counter{cRouteCreateUpdateFail, 1},
47 Counter{cMergedSubscriptions, 1},
Anssi Mannila316d8a12021-06-02 11:08:54 +030048 Counter{cDuplicateE2SubReq, 1},
Anssi Mannila6b3796f2021-02-12 09:11:35 +020049 Counter{cSubDelReqFromXapp, 1},
50 Counter{cSubDelRespToXapp, 1},
Anssi Mannila316d8a12021-06-02 11:08:54 +030051 Counter{cRestSubDelReqFromXapp, 1},
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000052 Counter{cRestSubDelRespToXapp, 1},
Anssi Mannila6b3796f2021-02-12 09:11:35 +020053 Counter{cSubDelReqToE2, 1},
54 Counter{cSubDelReReqToE2, 1},
55 Counter{cSubDelRespFromE2, 1},
56 Counter{cSubDelFailFromE2, 1},
57 Counter{cSubDelReqTimerExpiry, 1},
gunjarastogi4378baf2023-01-18 17:51:55 +053058 Counter{cSubDelRequFromE2, 1},
Anssi Mannila6b3796f2021-02-12 09:11:35 +020059 Counter{cRouteDeleteFail, 1},
60 Counter{cRouteDeleteUpdateFail, 1},
61 Counter{cUnmergedSubscriptions, 1},
62 Counter{cSDLWriteFailure, 1},
63 Counter{cSDLReadFailure, 1},
64 Counter{cSDLRemoveFailure, 1},
Anssi Mannila3d80b722021-11-12 13:17:15 +020065 Counter{cE2StateChangedToUp, 1},
66 Counter{cE2StateChangedToDown, 1},
Anssi Mannila6b3796f2021-02-12 09:11:35 +020067 })
Anssi Mannila4abf1802021-01-28 13:06:46 +020068
69 mainCtrl.c.UpdateCounter(cSubReqFromXapp)
70 mainCtrl.c.UpdateCounter(cSubRespToXapp)
71 mainCtrl.c.UpdateCounter(cSubFailToXapp)
Anssi Mannila316d8a12021-06-02 11:08:54 +030072 mainCtrl.c.UpdateCounter(cRestSubReqFromXapp)
73 mainCtrl.c.UpdateCounter(cRestSubRespToXapp)
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000074 mainCtrl.c.UpdateCounter(cRestSubFailToXapp)
Anssi Mannila3d80b722021-11-12 13:17:15 +020075 mainCtrl.c.UpdateCounter(cRestReqRejDueE2Down)
Anssi Mannila316d8a12021-06-02 11:08:54 +030076 mainCtrl.c.UpdateCounter(cRestSubNotifToXapp)
77 mainCtrl.c.UpdateCounter(cRestSubFailNotifToXapp)
Anssi Mannila4abf1802021-01-28 13:06:46 +020078 mainCtrl.c.UpdateCounter(cSubReqToE2)
79 mainCtrl.c.UpdateCounter(cSubReReqToE2)
80 mainCtrl.c.UpdateCounter(cSubRespFromE2)
Anssi Mannila56233b02022-01-24 13:26:42 +020081 mainCtrl.c.UpdateCounter(cPartialSubRespFromE2)
Anssi Mannila4abf1802021-01-28 13:06:46 +020082 mainCtrl.c.UpdateCounter(cSubFailFromE2)
83 mainCtrl.c.UpdateCounter(cSubReqTimerExpiry)
84 mainCtrl.c.UpdateCounter(cRouteCreateFail)
85 mainCtrl.c.UpdateCounter(cRouteCreateUpdateFail)
86 mainCtrl.c.UpdateCounter(cMergedSubscriptions)
Anssi Mannila316d8a12021-06-02 11:08:54 +030087 mainCtrl.c.UpdateCounter(cDuplicateE2SubReq)
Anssi Mannila4abf1802021-01-28 13:06:46 +020088 mainCtrl.c.UpdateCounter(cSubDelReqFromXapp)
89 mainCtrl.c.UpdateCounter(cSubDelRespToXapp)
Anssi Mannila316d8a12021-06-02 11:08:54 +030090 mainCtrl.c.UpdateCounter(cRestSubDelReqFromXapp)
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000091 mainCtrl.c.UpdateCounter(cRestSubDelRespToXapp)
Anssi Mannila4abf1802021-01-28 13:06:46 +020092 mainCtrl.c.UpdateCounter(cSubDelReqToE2)
93 mainCtrl.c.UpdateCounter(cSubDelReReqToE2)
94 mainCtrl.c.UpdateCounter(cSubDelRespFromE2)
95 mainCtrl.c.UpdateCounter(cSubDelFailFromE2)
96 mainCtrl.c.UpdateCounter(cSubDelReqTimerExpiry)
gunjarastogi4378baf2023-01-18 17:51:55 +053097 mainCtrl.c.UpdateCounter(cSubDelRequFromE2)
Anssi Mannila4abf1802021-01-28 13:06:46 +020098 mainCtrl.c.UpdateCounter(cRouteDeleteFail)
99 mainCtrl.c.UpdateCounter(cRouteDeleteUpdateFail)
100 mainCtrl.c.UpdateCounter(cUnmergedSubscriptions)
101 mainCtrl.c.UpdateCounter(cSDLWriteFailure)
102 mainCtrl.c.UpdateCounter(cSDLReadFailure)
103 mainCtrl.c.UpdateCounter(cSDLRemoveFailure)
Anssi Mannila3d80b722021-11-12 13:17:15 +0200104 mainCtrl.c.UpdateCounter(cE2StateChangedToUp)
105 mainCtrl.c.UpdateCounter(cE2StateChangedToDown)
Anssi Mannila4abf1802021-01-28 13:06:46 +0200106
107 mainCtrl.VerifyCounterValues(t)
108}