blob: 067f2d43405d6dddc7d63055e868804b231726fa [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},
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000031 Counter{cRestSubReqFromXapp, 1},
Anssi Mannila6b3796f2021-02-12 09:11:35 +020032 Counter{cSubRespToXapp, 1},
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000033 Counter{cRestSubRespToXapp, 1},
34 Counter{cSubFailToXapp, 1},
35 Counter{cRestSubFailToXapp, 1},
Anssi Mannila6b3796f2021-02-12 09:11:35 +020036 Counter{cSubReqToE2, 1},
37 Counter{cSubReReqToE2, 1},
38 Counter{cSubRespFromE2, 1},
39 Counter{cSubFailFromE2, 1},
40 Counter{cSubReqTimerExpiry, 1},
41 Counter{cRouteCreateFail, 1},
42 Counter{cRouteCreateUpdateFail, 1},
43 Counter{cMergedSubscriptions, 1},
44 Counter{cSubDelReqFromXapp, 1},
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000045 Counter{cRestSubDelReqFromXapp, 1},
Anssi Mannila6b3796f2021-02-12 09:11:35 +020046 Counter{cSubDelRespToXapp, 1},
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000047 Counter{cRestSubDelRespToXapp, 1},
Anssi Mannila6b3796f2021-02-12 09:11:35 +020048 Counter{cSubDelReqToE2, 1},
49 Counter{cSubDelReReqToE2, 1},
50 Counter{cSubDelRespFromE2, 1},
51 Counter{cSubDelFailFromE2, 1},
52 Counter{cSubDelReqTimerExpiry, 1},
53 Counter{cRouteDeleteFail, 1},
54 Counter{cRouteDeleteUpdateFail, 1},
55 Counter{cUnmergedSubscriptions, 1},
56 Counter{cSDLWriteFailure, 1},
57 Counter{cSDLReadFailure, 1},
58 Counter{cSDLRemoveFailure, 1},
59 })
Anssi Mannila4abf1802021-01-28 13:06:46 +020060
61 mainCtrl.c.UpdateCounter(cSubReqFromXapp)
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000062 mainCtrl.c.UpdateCounter(cRestSubReqFromXapp)
Anssi Mannila4abf1802021-01-28 13:06:46 +020063 mainCtrl.c.UpdateCounter(cSubRespToXapp)
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000064 mainCtrl.c.UpdateCounter(cRestSubRespToXapp)
Anssi Mannila4abf1802021-01-28 13:06:46 +020065 mainCtrl.c.UpdateCounter(cSubFailToXapp)
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000066 mainCtrl.c.UpdateCounter(cRestSubFailToXapp)
Anssi Mannila4abf1802021-01-28 13:06:46 +020067 mainCtrl.c.UpdateCounter(cSubReqToE2)
68 mainCtrl.c.UpdateCounter(cSubReReqToE2)
69 mainCtrl.c.UpdateCounter(cSubRespFromE2)
70 mainCtrl.c.UpdateCounter(cSubFailFromE2)
71 mainCtrl.c.UpdateCounter(cSubReqTimerExpiry)
72 mainCtrl.c.UpdateCounter(cRouteCreateFail)
73 mainCtrl.c.UpdateCounter(cRouteCreateUpdateFail)
74 mainCtrl.c.UpdateCounter(cMergedSubscriptions)
75 mainCtrl.c.UpdateCounter(cSubDelReqFromXapp)
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000076 mainCtrl.c.UpdateCounter(cRestSubDelReqFromXapp)
Anssi Mannila4abf1802021-01-28 13:06:46 +020077 mainCtrl.c.UpdateCounter(cSubDelRespToXapp)
Konstantinos Archangelof27433e72021-05-31 08:30:35 +000078 mainCtrl.c.UpdateCounter(cRestSubDelRespToXapp)
Anssi Mannila4abf1802021-01-28 13:06:46 +020079 mainCtrl.c.UpdateCounter(cSubDelReqToE2)
80 mainCtrl.c.UpdateCounter(cSubDelReReqToE2)
81 mainCtrl.c.UpdateCounter(cSubDelRespFromE2)
82 mainCtrl.c.UpdateCounter(cSubDelFailFromE2)
83 mainCtrl.c.UpdateCounter(cSubDelReqTimerExpiry)
84 mainCtrl.c.UpdateCounter(cRouteDeleteFail)
85 mainCtrl.c.UpdateCounter(cRouteDeleteUpdateFail)
86 mainCtrl.c.UpdateCounter(cUnmergedSubscriptions)
87 mainCtrl.c.UpdateCounter(cSDLWriteFailure)
88 mainCtrl.c.UpdateCounter(cSDLReadFailure)
89 mainCtrl.c.UpdateCounter(cSDLRemoveFailure)
90
91 mainCtrl.VerifyCounterValues(t)
92}