Anssi Mannila | 4abf180 | 2021-01-28 13:06:46 +0200 | [diff] [blame] | 1 | /* |
| 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 | |
| 20 | package control |
| 21 | |
| 22 | import ( |
| 23 | "testing" |
| 24 | ) |
| 25 | |
| 26 | func TestAddAllCountersOnce(t *testing.T) { |
| 27 | |
| 28 | // Check that all counters can be added correctly |
Anssi Mannila | 6b3796f | 2021-02-12 09:11:35 +0200 | [diff] [blame] | 29 | mainCtrl.CounterValuesToBeVeriefied(t, CountersToBeAdded{ |
| 30 | Counter{cSubReqFromXapp, 1}, |
Anssi Mannila | 6b3796f | 2021-02-12 09:11:35 +0200 | [diff] [blame] | 31 | Counter{cSubRespToXapp, 1}, |
Konstantinos Archangelof | 27433e7 | 2021-05-31 08:30:35 +0000 | [diff] [blame] | 32 | Counter{cSubFailToXapp, 1}, |
Anssi Mannila | 316d8a1 | 2021-06-02 11:08:54 +0300 | [diff] [blame] | 33 | Counter{cRestSubReqFromXapp, 1}, |
| 34 | Counter{cRestSubRespToXapp, 1}, |
Konstantinos Archangelof | 27433e7 | 2021-05-31 08:30:35 +0000 | [diff] [blame] | 35 | Counter{cRestSubFailToXapp, 1}, |
Anssi Mannila | 3d80b72 | 2021-11-12 13:17:15 +0200 | [diff] [blame^] | 36 | Counter{cRestReqRejDueE2Down, 1}, |
Anssi Mannila | 316d8a1 | 2021-06-02 11:08:54 +0300 | [diff] [blame] | 37 | Counter{cRestSubNotifToXapp, 1}, |
| 38 | Counter{cRestSubFailNotifToXapp, 1}, |
Anssi Mannila | 6b3796f | 2021-02-12 09:11:35 +0200 | [diff] [blame] | 39 | Counter{cSubReqToE2, 1}, |
| 40 | Counter{cSubReReqToE2, 1}, |
| 41 | Counter{cSubRespFromE2, 1}, |
| 42 | Counter{cSubFailFromE2, 1}, |
| 43 | Counter{cSubReqTimerExpiry, 1}, |
| 44 | Counter{cRouteCreateFail, 1}, |
| 45 | Counter{cRouteCreateUpdateFail, 1}, |
| 46 | Counter{cMergedSubscriptions, 1}, |
Anssi Mannila | 316d8a1 | 2021-06-02 11:08:54 +0300 | [diff] [blame] | 47 | Counter{cDuplicateE2SubReq, 1}, |
Anssi Mannila | 6b3796f | 2021-02-12 09:11:35 +0200 | [diff] [blame] | 48 | Counter{cSubDelReqFromXapp, 1}, |
| 49 | Counter{cSubDelRespToXapp, 1}, |
Anssi Mannila | 316d8a1 | 2021-06-02 11:08:54 +0300 | [diff] [blame] | 50 | Counter{cRestSubDelReqFromXapp, 1}, |
Konstantinos Archangelof | 27433e7 | 2021-05-31 08:30:35 +0000 | [diff] [blame] | 51 | Counter{cRestSubDelRespToXapp, 1}, |
Anssi Mannila | 6b3796f | 2021-02-12 09:11:35 +0200 | [diff] [blame] | 52 | Counter{cSubDelReqToE2, 1}, |
| 53 | Counter{cSubDelReReqToE2, 1}, |
| 54 | Counter{cSubDelRespFromE2, 1}, |
| 55 | Counter{cSubDelFailFromE2, 1}, |
| 56 | Counter{cSubDelReqTimerExpiry, 1}, |
| 57 | Counter{cRouteDeleteFail, 1}, |
| 58 | Counter{cRouteDeleteUpdateFail, 1}, |
| 59 | Counter{cUnmergedSubscriptions, 1}, |
| 60 | Counter{cSDLWriteFailure, 1}, |
| 61 | Counter{cSDLReadFailure, 1}, |
| 62 | Counter{cSDLRemoveFailure, 1}, |
Anssi Mannila | 3d80b72 | 2021-11-12 13:17:15 +0200 | [diff] [blame^] | 63 | Counter{cE2StateChangedToUp, 1}, |
| 64 | Counter{cE2StateChangedToDown, 1}, |
Anssi Mannila | 6b3796f | 2021-02-12 09:11:35 +0200 | [diff] [blame] | 65 | }) |
Anssi Mannila | 4abf180 | 2021-01-28 13:06:46 +0200 | [diff] [blame] | 66 | |
| 67 | mainCtrl.c.UpdateCounter(cSubReqFromXapp) |
| 68 | mainCtrl.c.UpdateCounter(cSubRespToXapp) |
| 69 | mainCtrl.c.UpdateCounter(cSubFailToXapp) |
Anssi Mannila | 316d8a1 | 2021-06-02 11:08:54 +0300 | [diff] [blame] | 70 | mainCtrl.c.UpdateCounter(cRestSubReqFromXapp) |
| 71 | mainCtrl.c.UpdateCounter(cRestSubRespToXapp) |
Konstantinos Archangelof | 27433e7 | 2021-05-31 08:30:35 +0000 | [diff] [blame] | 72 | mainCtrl.c.UpdateCounter(cRestSubFailToXapp) |
Anssi Mannila | 3d80b72 | 2021-11-12 13:17:15 +0200 | [diff] [blame^] | 73 | mainCtrl.c.UpdateCounter(cRestReqRejDueE2Down) |
Anssi Mannila | 316d8a1 | 2021-06-02 11:08:54 +0300 | [diff] [blame] | 74 | mainCtrl.c.UpdateCounter(cRestSubNotifToXapp) |
| 75 | mainCtrl.c.UpdateCounter(cRestSubFailNotifToXapp) |
Anssi Mannila | 4abf180 | 2021-01-28 13:06:46 +0200 | [diff] [blame] | 76 | mainCtrl.c.UpdateCounter(cSubReqToE2) |
| 77 | mainCtrl.c.UpdateCounter(cSubReReqToE2) |
| 78 | mainCtrl.c.UpdateCounter(cSubRespFromE2) |
| 79 | mainCtrl.c.UpdateCounter(cSubFailFromE2) |
| 80 | mainCtrl.c.UpdateCounter(cSubReqTimerExpiry) |
| 81 | mainCtrl.c.UpdateCounter(cRouteCreateFail) |
| 82 | mainCtrl.c.UpdateCounter(cRouteCreateUpdateFail) |
| 83 | mainCtrl.c.UpdateCounter(cMergedSubscriptions) |
Anssi Mannila | 316d8a1 | 2021-06-02 11:08:54 +0300 | [diff] [blame] | 84 | mainCtrl.c.UpdateCounter(cDuplicateE2SubReq) |
Anssi Mannila | 4abf180 | 2021-01-28 13:06:46 +0200 | [diff] [blame] | 85 | mainCtrl.c.UpdateCounter(cSubDelReqFromXapp) |
| 86 | mainCtrl.c.UpdateCounter(cSubDelRespToXapp) |
Anssi Mannila | 316d8a1 | 2021-06-02 11:08:54 +0300 | [diff] [blame] | 87 | mainCtrl.c.UpdateCounter(cRestSubDelReqFromXapp) |
Konstantinos Archangelof | 27433e7 | 2021-05-31 08:30:35 +0000 | [diff] [blame] | 88 | mainCtrl.c.UpdateCounter(cRestSubDelRespToXapp) |
Anssi Mannila | 4abf180 | 2021-01-28 13:06:46 +0200 | [diff] [blame] | 89 | mainCtrl.c.UpdateCounter(cSubDelReqToE2) |
| 90 | mainCtrl.c.UpdateCounter(cSubDelReReqToE2) |
| 91 | mainCtrl.c.UpdateCounter(cSubDelRespFromE2) |
| 92 | mainCtrl.c.UpdateCounter(cSubDelFailFromE2) |
| 93 | mainCtrl.c.UpdateCounter(cSubDelReqTimerExpiry) |
| 94 | mainCtrl.c.UpdateCounter(cRouteDeleteFail) |
| 95 | mainCtrl.c.UpdateCounter(cRouteDeleteUpdateFail) |
| 96 | mainCtrl.c.UpdateCounter(cUnmergedSubscriptions) |
| 97 | mainCtrl.c.UpdateCounter(cSDLWriteFailure) |
| 98 | mainCtrl.c.UpdateCounter(cSDLReadFailure) |
| 99 | mainCtrl.c.UpdateCounter(cSDLRemoveFailure) |
Anssi Mannila | 3d80b72 | 2021-11-12 13:17:15 +0200 | [diff] [blame^] | 100 | mainCtrl.c.UpdateCounter(cE2StateChangedToUp) |
| 101 | mainCtrl.c.UpdateCounter(cE2StateChangedToDown) |
Anssi Mannila | 4abf180 | 2021-01-28 13:06:46 +0200 | [diff] [blame] | 102 | |
| 103 | mainCtrl.VerifyCounterValues(t) |
| 104 | } |