Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +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 ( |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 23 | "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap" |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 24 | "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststube2ap" |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 25 | "testing" |
| 26 | ) |
| 27 | |
| 28 | //----------------------------------------------------------------------------- |
| 29 | // TestSubReqAndRouteNok |
| 30 | // |
| 31 | // stub stub |
| 32 | // +-------+ +---------+ +---------+ |
| 33 | // | xapp | | submgr | | rtmgr | |
| 34 | // +-------+ +---------+ +---------+ |
| 35 | // | | | |
| 36 | // | SubReq | | |
| 37 | // |------------->| | |
| 38 | // | | | |
| 39 | // | | RouteCreate | |
| 40 | // | |------------->| |
| 41 | // | | | |
| 42 | // | | RouteCreate | |
| 43 | // | | status:400 | |
| 44 | // | |<-------------| |
| 45 | // | | | |
| 46 | // | [SUBS INT DELETE] | |
| 47 | // | | | |
| 48 | // |
| 49 | //----------------------------------------------------------------------------- |
| 50 | |
| 51 | func TestSubReqAndRouteNok(t *testing.T) { |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 52 | CaseBegin("TestSubReqAndRouteNok") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 53 | |
| 54 | waiter := rtmgrHttp.AllocNextEvent(false) |
| 55 | newSubsId := mainCtrl.get_subid(t) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 56 | xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 57 | waiter.WaitResult(t) |
| 58 | |
| 59 | //Wait that subs is cleaned |
Juha Hyttinen | 83ada00 | 2020-01-30 10:36:33 +0200 | [diff] [blame] | 60 | mainCtrl.wait_subs_clean(t, newSubsId, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 61 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 62 | xappConn1.TestMsgChanEmpty(t) |
| 63 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 64 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 65 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | //----------------------------------------------------------------------------- |
| 69 | // TestSubReqAndSubDelOk |
| 70 | // |
| 71 | // stub stub |
| 72 | // +-------+ +---------+ +---------+ |
| 73 | // | xapp | | submgr | | e2term | |
| 74 | // +-------+ +---------+ +---------+ |
| 75 | // | | | |
| 76 | // | SubReq | | |
| 77 | // |------------->| | |
| 78 | // | | | |
| 79 | // | | SubReq | |
| 80 | // | |------------->| |
| 81 | // | | | |
| 82 | // | | SubResp | |
| 83 | // | |<-------------| |
| 84 | // | | | |
| 85 | // | SubResp | | |
| 86 | // |<-------------| | |
| 87 | // | | | |
| 88 | // | | | |
| 89 | // | SubDelReq | | |
| 90 | // |------------->| | |
| 91 | // | | | |
| 92 | // | | SubDelReq | |
| 93 | // | |------------->| |
| 94 | // | | | |
| 95 | // | | SubDelResp | |
| 96 | // | |<-------------| |
| 97 | // | | | |
| 98 | // | SubDelResp | | |
| 99 | // |<-------------| | |
| 100 | // |
| 101 | //----------------------------------------------------------------------------- |
| 102 | func TestSubReqAndSubDelOk(t *testing.T) { |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 103 | CaseBegin("TestSubReqAndSubDelOk") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 104 | |
| 105 | waiter := rtmgrHttp.AllocNextEvent(true) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 106 | cretrans := xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 107 | waiter.WaitResult(t) |
| 108 | |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 109 | crereq, cremsg := e2termConn1.RecvSubsReq(t) |
| 110 | e2termConn1.SendSubsResp(t, crereq, cremsg) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 111 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
| 112 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 113 | delreq, delmsg := e2termConn1.RecvSubsDelReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 114 | |
| 115 | waiter = rtmgrHttp.AllocNextEvent(true) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 116 | e2termConn1.SendSubsDelResp(t, delreq, delmsg) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 117 | xappConn1.RecvSubsDelResp(t, deltrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 118 | waiter.WaitResult(t) |
| 119 | |
| 120 | //Wait that subs is cleaned |
| 121 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 122 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 123 | xappConn1.TestMsgChanEmpty(t) |
| 124 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 125 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 126 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 127 | } |
| 128 | |
| 129 | //----------------------------------------------------------------------------- |
| 130 | // TestSubReqRetransmission |
| 131 | // |
| 132 | // stub stub |
| 133 | // +-------+ +---------+ +---------+ |
| 134 | // | xapp | | submgr | | e2term | |
| 135 | // +-------+ +---------+ +---------+ |
| 136 | // | | | |
| 137 | // | SubReq | | |
| 138 | // |------------->| | |
| 139 | // | | | |
| 140 | // | | SubReq | |
| 141 | // | |------------->| |
| 142 | // | | | |
| 143 | // | SubReq | | |
| 144 | // | (retrans) | | |
| 145 | // |------------->| | |
| 146 | // | | | |
| 147 | // | | SubResp | |
| 148 | // | |<-------------| |
| 149 | // | | | |
| 150 | // | SubResp | | |
| 151 | // |<-------------| | |
| 152 | // | | | |
| 153 | // | [SUBS DELETE] | |
| 154 | // | | | |
| 155 | // |
| 156 | //----------------------------------------------------------------------------- |
| 157 | func TestSubReqRetransmission(t *testing.T) { |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 158 | CaseBegin("TestSubReqRetransmission") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 159 | |
| 160 | //Subs Create |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 161 | cretrans := xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 162 | crereq, cremsg := e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 163 | |
| 164 | seqBef := mainCtrl.get_msgcounter(t) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 165 | xappConn1.SendSubsReq(t, nil, cretrans) //Retransmitted SubReq |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 166 | mainCtrl.wait_msgcounter_change(t, seqBef, 10) |
| 167 | |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 168 | e2termConn1.SendSubsResp(t, crereq, cremsg) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 169 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 170 | |
| 171 | //Subs Delete |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 172 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 173 | delreq, delmsg := e2termConn1.RecvSubsDelReq(t) |
| 174 | e2termConn1.SendSubsDelResp(t, delreq, delmsg) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 175 | xappConn1.RecvSubsDelResp(t, deltrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 176 | |
| 177 | //Wait that subs is cleaned |
| 178 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 179 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 180 | xappConn1.TestMsgChanEmpty(t) |
| 181 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 182 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 183 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | //----------------------------------------------------------------------------- |
| 187 | // TestSubDelReqRetransmission |
| 188 | // |
| 189 | // stub stub |
| 190 | // +-------+ +---------+ +---------+ |
| 191 | // | xapp | | submgr | | e2term | |
| 192 | // +-------+ +---------+ +---------+ |
| 193 | // | | | |
| 194 | // | [SUBS CREATE] | |
| 195 | // | | | |
| 196 | // | | | |
| 197 | // | SubDelReq | | |
| 198 | // |------------->| | |
| 199 | // | | | |
| 200 | // | | SubDelReq | |
| 201 | // | |------------->| |
| 202 | // | | | |
| 203 | // | SubDelReq | | |
| 204 | // | (same sub) | | |
| 205 | // | (same xid) | | |
| 206 | // |------------->| | |
| 207 | // | | | |
| 208 | // | | SubDelResp | |
| 209 | // | |<-------------| |
| 210 | // | | | |
| 211 | // | SubDelResp | | |
| 212 | // |<-------------| | |
| 213 | // |
| 214 | //----------------------------------------------------------------------------- |
| 215 | func TestSubDelReqRetransmission(t *testing.T) { |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 216 | CaseBegin("TestSubDelReqRetransmission") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 217 | |
| 218 | //Subs Create |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 219 | cretrans := xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 220 | crereq, cremsg := e2termConn1.RecvSubsReq(t) |
| 221 | e2termConn1.SendSubsResp(t, crereq, cremsg) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 222 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 223 | |
| 224 | //Subs Delete |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 225 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 226 | delreq, delmsg := e2termConn1.RecvSubsDelReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 227 | |
| 228 | seqBef := mainCtrl.get_msgcounter(t) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 229 | xappConn1.SendSubsDelReq(t, deltrans, e2SubsId) //Retransmitted SubDelReq |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 230 | mainCtrl.wait_msgcounter_change(t, seqBef, 10) |
| 231 | |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 232 | e2termConn1.SendSubsDelResp(t, delreq, delmsg) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 233 | xappConn1.RecvSubsDelResp(t, deltrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 234 | |
| 235 | //Wait that subs is cleaned |
| 236 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 237 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 238 | xappConn1.TestMsgChanEmpty(t) |
| 239 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 240 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 241 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 242 | } |
| 243 | |
| 244 | //----------------------------------------------------------------------------- |
| 245 | // TestSubDelReqCollision |
| 246 | // |
| 247 | // stub stub |
| 248 | // +-------+ +---------+ +---------+ |
| 249 | // | xapp | | submgr | | e2term | |
| 250 | // +-------+ +---------+ +---------+ |
| 251 | // | | | |
| 252 | // | [SUBS CREATE] | |
| 253 | // | | | |
| 254 | // | | | |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 255 | // | SubDelReq 1 | | |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 256 | // |------------->| | |
| 257 | // | | | |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 258 | // | | SubDelReq 1 | |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 259 | // | |------------->| |
| 260 | // | | | |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 261 | // | SubDelReq 2 | | |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 262 | // | (same sub) | | |
| 263 | // | (diff xid) | | |
| 264 | // |------------->| | |
| 265 | // | | | |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 266 | // | | SubDelResp 1 | |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 267 | // | |<-------------| |
| 268 | // | | | |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 269 | // | SubDelResp 1 | | |
| 270 | // |<-------------| | |
| 271 | // | | | |
| 272 | // | SubDelResp 2 | | |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 273 | // |<-------------| | |
| 274 | // |
| 275 | //----------------------------------------------------------------------------- |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 276 | |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 277 | func TestSubDelReqCollision(t *testing.T) { |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 278 | CaseBegin("TestSubDelReqCollision") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 279 | |
| 280 | //Subs Create |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 281 | cretrans := xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 282 | crereq, cremsg := e2termConn1.RecvSubsReq(t) |
| 283 | e2termConn1.SendSubsResp(t, crereq, cremsg) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 284 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 285 | |
| 286 | //Subs Delete |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 287 | xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 288 | delreq1, delmsg1 := e2termConn1.RecvSubsDelReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 289 | |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 290 | // Subs Delete colliding |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 291 | seqBef := mainCtrl.get_msgcounter(t) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 292 | deltranscol2 := xappConn1.NewRmrTransactionId("", "RAN_NAME_1") |
| 293 | xappConn1.SendSubsDelReq(t, deltranscol2, e2SubsId) //Colliding SubDelReq |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 294 | mainCtrl.wait_msgcounter_change(t, seqBef, 10) |
| 295 | |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 296 | // Del resp for first and second |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 297 | e2termConn1.SendSubsDelResp(t, delreq1, delmsg1) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 298 | |
| 299 | // don't care in which order responses are received |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 300 | xappConn1.RecvSubsDelResp(t, nil) |
| 301 | xappConn1.RecvSubsDelResp(t, nil) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 302 | |
| 303 | //Wait that subs is cleaned |
| 304 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 305 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 306 | xappConn1.TestMsgChanEmpty(t) |
| 307 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 308 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 309 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 310 | } |
| 311 | |
| 312 | //----------------------------------------------------------------------------- |
| 313 | // TestSubReqAndSubDelOkTwoParallel |
| 314 | // |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 315 | // stub stub stub |
| 316 | // +-------+ +-------+ +---------+ +---------+ |
| 317 | // | xapp | | xapp | | submgr | | e2term | |
| 318 | // +-------+ +-------+ +---------+ +---------+ |
| 319 | // | | | | |
| 320 | // | | | | |
| 321 | // | | | | |
| 322 | // | | SubReq1 | | |
| 323 | // | |------------->| | |
| 324 | // | | | | |
| 325 | // | | | SubReq1 | |
| 326 | // | | |------------->| |
| 327 | // | | | | |
| 328 | // | SubReq2 | | |
| 329 | // |------------------------>| | |
| 330 | // | | | | |
| 331 | // | | | SubReq2 | |
| 332 | // | | |------------->| |
| 333 | // | | | | |
| 334 | // | | | SubResp1 | |
| 335 | // | | |<-------------| |
| 336 | // | | SubResp1 | | |
| 337 | // | |<-------------| | |
| 338 | // | | | | |
| 339 | // | | | SubResp2 | |
| 340 | // | | |<-------------| |
| 341 | // | SubResp2 | | |
| 342 | // |<------------------------| | |
| 343 | // | | | | |
| 344 | // | | [SUBS 1 DELETE] | |
| 345 | // | | | | |
| 346 | // | | [SUBS 2 DELETE] | |
| 347 | // | | | | |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 348 | // |
| 349 | //----------------------------------------------------------------------------- |
| 350 | func TestSubReqAndSubDelOkTwoParallel(t *testing.T) { |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 351 | CaseBegin("TestSubReqAndSubDelOkTwoParallel") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 352 | |
| 353 | //Req1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 354 | rparams1 := &teststube2ap.E2StubSubsReqParams{} |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 355 | rparams1.Init() |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 356 | rparams1.Req.EventTriggerDefinition.ProcedureCode = 5 |
| 357 | cretrans1 := xappConn1.SendSubsReq(t, rparams1, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 358 | crereq1, cremsg1 := e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 359 | |
| 360 | //Req2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 361 | rparams2 := &teststube2ap.E2StubSubsReqParams{} |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 362 | rparams2.Init() |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 363 | rparams2.Req.EventTriggerDefinition.ProcedureCode = 28 |
| 364 | cretrans2 := xappConn2.SendSubsReq(t, rparams2, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 365 | crereq2, cremsg2 := e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 366 | |
| 367 | //Resp1 |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 368 | e2termConn1.SendSubsResp(t, crereq1, cremsg1) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 369 | e2SubsId1 := xappConn1.RecvSubsResp(t, cretrans1) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 370 | |
| 371 | //Resp2 |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 372 | e2termConn1.SendSubsResp(t, crereq2, cremsg2) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 373 | e2SubsId2 := xappConn2.RecvSubsResp(t, cretrans2) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 374 | |
| 375 | //Del1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 376 | deltrans1 := xappConn1.SendSubsDelReq(t, nil, e2SubsId1) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 377 | delreq1, delmsg1 := e2termConn1.RecvSubsDelReq(t) |
| 378 | e2termConn1.SendSubsDelResp(t, delreq1, delmsg1) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 379 | xappConn1.RecvSubsDelResp(t, deltrans1) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 380 | //Wait that subs is cleaned |
| 381 | mainCtrl.wait_subs_clean(t, e2SubsId1, 10) |
| 382 | |
| 383 | //Del2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 384 | deltrans2 := xappConn2.SendSubsDelReq(t, nil, e2SubsId2) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 385 | delreq2, delmsg2 := e2termConn1.RecvSubsDelReq(t) |
| 386 | e2termConn1.SendSubsDelResp(t, delreq2, delmsg2) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 387 | xappConn2.RecvSubsDelResp(t, deltrans2) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 388 | //Wait that subs is cleaned |
| 389 | mainCtrl.wait_subs_clean(t, e2SubsId2, 10) |
| 390 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 391 | xappConn1.TestMsgChanEmpty(t) |
| 392 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 393 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 394 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 395 | } |
| 396 | |
| 397 | //----------------------------------------------------------------------------- |
| 398 | // TestSameSubsDiffRan |
| 399 | // Same subscription to different RANs |
| 400 | // |
| 401 | // stub stub |
| 402 | // +-------+ +---------+ +---------+ |
| 403 | // | xapp | | submgr | | e2term | |
| 404 | // +-------+ +---------+ +---------+ |
| 405 | // | | | |
| 406 | // | | | |
| 407 | // | | | |
| 408 | // | SubReq(r1) | | |
| 409 | // |------------->| | |
| 410 | // | | | |
| 411 | // | | SubReq(r1) | |
| 412 | // | |------------->| |
| 413 | // | | | |
| 414 | // | | SubResp(r1) | |
| 415 | // | |<-------------| |
| 416 | // | | | |
| 417 | // | SubResp(r1) | | |
| 418 | // |<-------------| | |
| 419 | // | | | |
| 420 | // | SubReq(r2) | | |
| 421 | // |------------->| | |
| 422 | // | | | |
| 423 | // | | SubReq(r2) | |
| 424 | // | |------------->| |
| 425 | // | | | |
| 426 | // | | SubResp(r2) | |
| 427 | // | |<-------------| |
| 428 | // | | | |
| 429 | // | SubResp(r2) | | |
| 430 | // |<-------------| | |
| 431 | // | | | |
| 432 | // | [SUBS r1 DELETE] | |
| 433 | // | | | |
| 434 | // | [SUBS r2 DELETE] | |
| 435 | // | | | |
| 436 | // |
| 437 | //----------------------------------------------------------------------------- |
| 438 | func TestSameSubsDiffRan(t *testing.T) { |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 439 | CaseBegin("TestSameSubsDiffRan") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 440 | |
| 441 | //Req1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 442 | cretrans1 := xappConn1.NewRmrTransactionId("", "RAN_NAME_1") |
| 443 | xappConn1.SendSubsReq(t, nil, cretrans1) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 444 | crereq1, cremsg1 := e2termConn1.RecvSubsReq(t) |
| 445 | e2termConn1.SendSubsResp(t, crereq1, cremsg1) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 446 | e2SubsId1 := xappConn1.RecvSubsResp(t, cretrans1) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 447 | |
| 448 | //Req2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 449 | cretrans2 := xappConn1.NewRmrTransactionId("", "RAN_NAME_2") |
| 450 | xappConn1.SendSubsReq(t, nil, cretrans2) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 451 | crereq2, cremsg2 := e2termConn1.RecvSubsReq(t) |
| 452 | e2termConn1.SendSubsResp(t, crereq2, cremsg2) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 453 | e2SubsId2 := xappConn1.RecvSubsResp(t, cretrans2) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 454 | |
| 455 | //Del1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 456 | deltrans1 := xappConn1.NewRmrTransactionId("", "RAN_NAME_1") |
| 457 | xappConn1.SendSubsDelReq(t, deltrans1, e2SubsId1) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 458 | delreq1, delmsg1 := e2termConn1.RecvSubsDelReq(t) |
| 459 | e2termConn1.SendSubsDelResp(t, delreq1, delmsg1) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 460 | xappConn1.RecvSubsDelResp(t, deltrans1) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 461 | //Wait that subs is cleaned |
| 462 | mainCtrl.wait_subs_clean(t, e2SubsId1, 10) |
| 463 | |
| 464 | //Del2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 465 | deltrans2 := xappConn1.NewRmrTransactionId("", "RAN_NAME_2") |
| 466 | xappConn1.SendSubsDelReq(t, deltrans2, e2SubsId2) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 467 | delreq2, delmsg2 := e2termConn1.RecvSubsDelReq(t) |
| 468 | e2termConn1.SendSubsDelResp(t, delreq2, delmsg2) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 469 | xappConn1.RecvSubsDelResp(t, deltrans2) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 470 | //Wait that subs is cleaned |
| 471 | mainCtrl.wait_subs_clean(t, e2SubsId2, 10) |
| 472 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 473 | xappConn1.TestMsgChanEmpty(t) |
| 474 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 475 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 476 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 477 | } |
| 478 | |
| 479 | //----------------------------------------------------------------------------- |
| 480 | // TestSubReqRetryInSubmgr |
| 481 | // |
| 482 | // stub stub |
| 483 | // +-------+ +---------+ +---------+ |
| 484 | // | xapp | | submgr | | e2term | |
| 485 | // +-------+ +---------+ +---------+ |
| 486 | // | | | |
| 487 | // | SubReq | | |
| 488 | // |------------->| | |
| 489 | // | | | |
| 490 | // | | SubReq | |
| 491 | // | |------------->| |
| 492 | // | | | |
| 493 | // | | | |
| 494 | // | | SubReq | |
| 495 | // | |------------->| |
| 496 | // | | | |
| 497 | // | | SubResp | |
| 498 | // | |<-------------| |
| 499 | // | | | |
| 500 | // | SubResp | | |
| 501 | // |<-------------| | |
| 502 | // | | | |
| 503 | // | [SUBS DELETE] | |
| 504 | // | | | |
| 505 | // |
| 506 | //----------------------------------------------------------------------------- |
| 507 | |
| 508 | func TestSubReqRetryInSubmgr(t *testing.T) { |
| 509 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 510 | CaseBegin("TestSubReqRetryInSubmgr start") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 511 | |
| 512 | // Xapp: Send SubsReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 513 | cretrans := xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 514 | |
| 515 | // E2t: Receive 1st SubsReq |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 516 | e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 517 | |
| 518 | // E2t: Receive 2nd SubsReq and send SubsResp |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 519 | crereq, cremsg := e2termConn1.RecvSubsReq(t) |
| 520 | e2termConn1.SendSubsResp(t, crereq, cremsg) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 521 | |
| 522 | // Xapp: Receive SubsResp |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 523 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 524 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 525 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 526 | delreq, delmsg := e2termConn1.RecvSubsDelReq(t) |
| 527 | e2termConn1.SendSubsDelResp(t, delreq, delmsg) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 528 | xappConn1.RecvSubsDelResp(t, deltrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 529 | |
| 530 | // Wait that subs is cleaned |
| 531 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 532 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 533 | xappConn1.TestMsgChanEmpty(t) |
| 534 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 535 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 536 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 537 | } |
| 538 | |
| 539 | //----------------------------------------------------------------------------- |
| 540 | // TestSubReqTwoRetriesNoRespSubDelRespInSubmgr |
| 541 | // |
| 542 | // stub stub |
| 543 | // +-------+ +---------+ +---------+ |
| 544 | // | xapp | | submgr | | e2term | |
| 545 | // +-------+ +---------+ +---------+ |
| 546 | // | | | |
| 547 | // | SubReq | | |
| 548 | // |------------->| | |
| 549 | // | | | |
| 550 | // | | SubReq | |
| 551 | // | |------------->| |
| 552 | // | | | |
| 553 | // | | | |
| 554 | // | | SubReq | |
| 555 | // | |------------->| |
| 556 | // | | | |
| 557 | // | | SubDelReq | |
| 558 | // | |------------->| |
| 559 | // | | | |
| 560 | // | | | |
| 561 | // | | SubDelReq | |
| 562 | // | |------------->| |
| 563 | // | | | |
| 564 | // | | | |
| 565 | // | | SubDelResp | |
| 566 | // | |<-------------| |
| 567 | // | | | |
| 568 | // |
| 569 | //----------------------------------------------------------------------------- |
| 570 | |
| 571 | func TestSubReqRetryNoRespSubDelRespInSubmgr(t *testing.T) { |
| 572 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 573 | CaseBegin("TestSubReqTwoRetriesNoRespSubDelRespInSubmgr start") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 574 | |
| 575 | // Xapp: Send SubsReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 576 | xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 577 | |
| 578 | // E2t: Receive 1st SubsReq |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 579 | e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 580 | |
| 581 | // E2t: Receive 2nd SubsReq |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 582 | e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 583 | |
| 584 | // E2t: Send receive SubsDelReq and send SubsResp |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 585 | delreq, delmsg := e2termConn1.RecvSubsDelReq(t) |
| 586 | e2termConn1.SendSubsDelResp(t, delreq, delmsg) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 587 | |
| 588 | // Wait that subs is cleaned |
Juha Hyttinen | 83ada00 | 2020-01-30 10:36:33 +0200 | [diff] [blame] | 589 | mainCtrl.wait_subs_clean(t, delreq.RequestId.Seq, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 590 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 591 | xappConn1.TestMsgChanEmpty(t) |
| 592 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 593 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 594 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 595 | } |
| 596 | |
| 597 | //----------------------------------------------------------------------------- |
| 598 | // TestSubReqTwoRetriesNoRespAtAllInSubmgr |
| 599 | // |
| 600 | // stub stub |
| 601 | // +-------+ +---------+ +---------+ |
| 602 | // | xapp | | submgr | | e2term | |
| 603 | // +-------+ +---------+ +---------+ |
| 604 | // | | | |
| 605 | // | SubReq | | |
| 606 | // |------------->| | |
| 607 | // | | | |
| 608 | // | | SubReq | |
| 609 | // | |------------->| |
| 610 | // | | | |
| 611 | // | | | |
| 612 | // | | SubReq | |
| 613 | // | |------------->| |
| 614 | // | | | |
| 615 | // | | SubDelReq | |
| 616 | // | |------------->| |
| 617 | // | | | |
| 618 | // | | | |
| 619 | // | | SubDelReq | |
| 620 | // | |------------->| |
| 621 | // | | | |
| 622 | // | | | |
| 623 | // |
| 624 | //----------------------------------------------------------------------------- |
| 625 | |
| 626 | func TestSubReqTwoRetriesNoRespAtAllInSubmgr(t *testing.T) { |
| 627 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 628 | CaseBegin("TestSubReqTwoRetriesNoRespAtAllInSubmgr start") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 629 | |
| 630 | // Xapp: Send SubsReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 631 | xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 632 | |
| 633 | // E2t: Receive 1st SubsReq |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 634 | e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 635 | |
| 636 | // E2t: Receive 2nd SubsReq |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 637 | e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 638 | |
| 639 | // E2t: Receive 1st SubsDelReq |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 640 | e2termConn1.RecvSubsDelReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 641 | |
| 642 | // E2t: Receive 2nd SubsDelReq |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 643 | delreq, _ := e2termConn1.RecvSubsDelReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 644 | |
| 645 | // Wait that subs is cleaned |
Juha Hyttinen | 83ada00 | 2020-01-30 10:36:33 +0200 | [diff] [blame] | 646 | mainCtrl.wait_subs_clean(t, delreq.RequestId.Seq, 15) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 647 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 648 | xappConn1.TestMsgChanEmpty(t) |
| 649 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 650 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 651 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 652 | } |
| 653 | |
| 654 | //----------------------------------------------------------------------------- |
| 655 | // TestSubReqSubFailRespInSubmgr |
| 656 | // |
| 657 | // stub stub |
| 658 | // +-------+ +---------+ +---------+ |
| 659 | // | xapp | | submgr | | e2term | |
| 660 | // +-------+ +---------+ +---------+ |
| 661 | // | | | |
| 662 | // | SubReq | | |
| 663 | // |------------->| | |
| 664 | // | | | |
| 665 | // | | SubReq | |
| 666 | // | |------------->| |
| 667 | // | | | |
| 668 | // | | SubFail | |
| 669 | // | |<-------------| |
| 670 | // | | | |
| 671 | // | SubFail | | |
| 672 | // |<-------------| | |
| 673 | // | | | |
| 674 | // |
| 675 | //----------------------------------------------------------------------------- |
| 676 | |
| 677 | func TestSubReqSubFailRespInSubmgr(t *testing.T) { |
| 678 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 679 | CaseBegin("TestSubReqSubFailRespInSubmgr start") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 680 | |
| 681 | // Xapp: Send SubsReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 682 | cretrans := xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 683 | |
| 684 | // E2t: Receive SubsReq and send SubsFail |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 685 | crereq, cremsg := e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 686 | fparams := &teststube2ap.E2StubSubsFailParams{} |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 687 | fparams.Set(crereq) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 688 | e2termConn1.SendSubsFail(t, fparams, cremsg) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 689 | |
| 690 | // Xapp: Receive SubsFail |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 691 | e2SubsId := xappConn1.RecvSubsFail(t, cretrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 692 | |
| 693 | // Wait that subs is cleaned |
| 694 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 695 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 696 | xappConn1.TestMsgChanEmpty(t) |
| 697 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 698 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 699 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 700 | } |
| 701 | |
| 702 | //----------------------------------------------------------------------------- |
| 703 | // TestSubDelReqRetryInSubmgr |
| 704 | // |
| 705 | // stub stub |
| 706 | // +-------+ +---------+ +---------+ |
| 707 | // | xapp | | submgr | | e2term | |
| 708 | // +-------+ +---------+ +---------+ |
| 709 | // | | | |
| 710 | // | [SUBS CREATE] | |
| 711 | // | | | |
| 712 | // | | | |
| 713 | // | SubDelReq | | |
| 714 | // |------------->| | |
| 715 | // | | | |
| 716 | // | | SubDelReq | |
| 717 | // | |------------->| |
| 718 | // | | | |
| 719 | // | | SubDelReq | |
| 720 | // | |------------->| |
| 721 | // | | | |
| 722 | // | | SubDelResp | |
| 723 | // | |<-------------| |
| 724 | // | | | |
| 725 | // | SubDelResp | | |
| 726 | // |<-------------| | |
| 727 | // |
| 728 | //----------------------------------------------------------------------------- |
| 729 | |
| 730 | func TestSubDelReqRetryInSubmgr(t *testing.T) { |
| 731 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 732 | CaseBegin("TestSubDelReqRetryInSubmgr start") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 733 | |
| 734 | // Subs Create |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 735 | cretrans := xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 736 | crereq, cremsg := e2termConn1.RecvSubsReq(t) |
| 737 | e2termConn1.SendSubsResp(t, crereq, cremsg) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 738 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 739 | |
| 740 | // Subs Delete |
| 741 | // Xapp: Send SubsDelReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 742 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 743 | |
| 744 | // E2t: Receive 1st SubsDelReq |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 745 | e2termConn1.RecvSubsDelReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 746 | |
| 747 | // E2t: Receive 2nd SubsDelReq and send SubsDelResp |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 748 | delreq, delmsg := e2termConn1.RecvSubsDelReq(t) |
| 749 | e2termConn1.SendSubsDelResp(t, delreq, delmsg) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 750 | |
| 751 | // Xapp: Receive SubsDelResp |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 752 | xappConn1.RecvSubsDelResp(t, deltrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 753 | |
| 754 | // Wait that subs is cleaned |
| 755 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 756 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 757 | xappConn1.TestMsgChanEmpty(t) |
| 758 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 759 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 760 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 761 | } |
| 762 | |
| 763 | //----------------------------------------------------------------------------- |
| 764 | // TestSubDelReqTwoRetriesNoRespInSubmgr |
| 765 | // |
| 766 | // stub stub |
| 767 | // +-------+ +---------+ +---------+ |
| 768 | // | xapp | | submgr | | e2term | |
| 769 | // +-------+ +---------+ +---------+ |
| 770 | // | | | |
| 771 | // | [SUBS CREATE] | |
| 772 | // | | | |
| 773 | // | | | |
| 774 | // | SubDelReq | | |
| 775 | // |------------->| | |
| 776 | // | | | |
| 777 | // | | SubDelReq | |
| 778 | // | |------------->| |
| 779 | // | | | |
| 780 | // | | SubDelReq | |
| 781 | // | |------------->| |
| 782 | // | | | |
| 783 | // | | | |
| 784 | // | SubDelResp | | |
| 785 | // |<-------------| | |
| 786 | // |
| 787 | //----------------------------------------------------------------------------- |
| 788 | |
| 789 | func TestSubDelReqTwoRetriesNoRespInSubmgr(t *testing.T) { |
| 790 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 791 | CaseBegin("TestSubDelReTwoRetriesNoRespInSubmgr start") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 792 | |
| 793 | // Subs Create |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 794 | cretrans := xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 795 | crereq, cremsg := e2termConn1.RecvSubsReq(t) |
| 796 | e2termConn1.SendSubsResp(t, crereq, cremsg) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 797 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 798 | |
| 799 | // Subs Delete |
| 800 | // Xapp: Send SubsDelReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 801 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 802 | |
| 803 | // E2t: Receive 1st SubsDelReq |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 804 | e2termConn1.RecvSubsDelReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 805 | |
| 806 | // E2t: Receive 2nd SubsDelReq |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 807 | e2termConn1.RecvSubsDelReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 808 | |
| 809 | // Xapp: Receive SubsDelResp |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 810 | xappConn1.RecvSubsDelResp(t, deltrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 811 | |
| 812 | // Wait that subs is cleaned |
| 813 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 814 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 815 | xappConn1.TestMsgChanEmpty(t) |
| 816 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 817 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 818 | mainCtrl.wait_registry_empty(t, 10) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 819 | } |
| 820 | |
| 821 | //----------------------------------------------------------------------------- |
| 822 | // TestSubDelReqSubDelFailRespInSubmgr |
| 823 | // |
| 824 | // stub stub |
| 825 | // +-------+ +---------+ +---------+ |
| 826 | // | xapp | | submgr | | e2term | |
| 827 | // +-------+ +---------+ +---------+ |
| 828 | // | | | |
| 829 | // | [SUBS CREATE] | |
| 830 | // | | | |
| 831 | // | | | |
| 832 | // | SubDelReq | | |
| 833 | // |------------->| | |
| 834 | // | | | |
| 835 | // | | SubDelReq | |
| 836 | // | |------------->| |
| 837 | // | | | |
| 838 | // | | SubDelFail | |
| 839 | // | |<-------------| |
| 840 | // | | | |
| 841 | // | SubDelResp | | |
| 842 | // |<-------------| | |
| 843 | // | | | |
| 844 | // |
| 845 | //----------------------------------------------------------------------------- |
| 846 | |
| 847 | func TestSubDelReqSubDelFailRespInSubmgr(t *testing.T) { |
| 848 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 849 | CaseBegin("TestSubReqSubDelFailRespInSubmgr start") |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 850 | |
| 851 | // Subs Create |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 852 | cretrans := xappConn1.SendSubsReq(t, nil, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 853 | crereq, cremsg := e2termConn1.RecvSubsReq(t) |
| 854 | e2termConn1.SendSubsResp(t, crereq, cremsg) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 855 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 856 | |
| 857 | // Xapp: Send SubsDelReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 858 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 859 | |
| 860 | // E2t: Send receive SubsDelReq and send SubsDelFail |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 861 | delreq, delmsg := e2termConn1.RecvSubsDelReq(t) |
| 862 | e2termConn1.SendSubsDelFail(t, delreq, delmsg) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 863 | |
| 864 | // Xapp: Receive SubsDelResp |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 865 | xappConn1.RecvSubsDelResp(t, deltrans) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 866 | |
| 867 | // Wait that subs is cleaned |
| 868 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 869 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 870 | xappConn1.TestMsgChanEmpty(t) |
| 871 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 872 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 873 | mainCtrl.wait_registry_empty(t, 10) |
| 874 | } |
| 875 | |
| 876 | //----------------------------------------------------------------------------- |
| 877 | // TestSubReqAndSubDelOkSameAction |
| 878 | // |
| 879 | // stub stub |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 880 | // +-------+ +-------+ +---------+ +---------+ |
| 881 | // | xapp2 | | xapp1 | | submgr | | e2term | |
| 882 | // +-------+ +-------+ +---------+ +---------+ |
| 883 | // | | | | |
| 884 | // | | | | |
| 885 | // | | | | |
| 886 | // | | SubReq1 | | |
| 887 | // | |------------->| | |
| 888 | // | | | | |
| 889 | // | | | SubReq1 | |
| 890 | // | | |------------->| |
| 891 | // | | | SubResp1 | |
| 892 | // | | |<-------------| |
| 893 | // | | SubResp1 | | |
| 894 | // | |<-------------| | |
| 895 | // | | | | |
| 896 | // | SubReq2 | | |
| 897 | // |--------------------------->| | |
| 898 | // | | | | |
| 899 | // | SubResp2 | | |
| 900 | // |<---------------------------| | |
| 901 | // | | | | |
| 902 | // | | SubDelReq 1 | | |
| 903 | // | |------------->| | |
| 904 | // | | | | |
| 905 | // | | SubDelResp 1 | | |
| 906 | // | |<-------------| | |
| 907 | // | | | | |
| 908 | // | SubDelReq 2 | | |
| 909 | // |--------------------------->| | |
| 910 | // | | | | |
| 911 | // | | | SubDelReq 2 | |
| 912 | // | | |------------->| |
| 913 | // | | | | |
| 914 | // | | | SubDelReq 2 | |
| 915 | // | | |------------->| |
| 916 | // | | | | |
| 917 | // | SubDelResp 2 | | |
| 918 | // |<---------------------------| | |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 919 | // |
| 920 | //----------------------------------------------------------------------------- |
| 921 | func TestSubReqAndSubDelOkSameAction(t *testing.T) { |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 922 | CaseBegin("TestSubReqAndSubDelOkSameAction") |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 923 | |
| 924 | //Req1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 925 | rparams1 := &teststube2ap.E2StubSubsReqParams{} |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 926 | rparams1.Init() |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 927 | cretrans1 := xappConn1.SendSubsReq(t, rparams1, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 928 | crereq1, cremsg1 := e2termConn1.RecvSubsReq(t) |
| 929 | e2termConn1.SendSubsResp(t, crereq1, cremsg1) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 930 | e2SubsId1 := xappConn1.RecvSubsResp(t, cretrans1) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 931 | |
| 932 | //Req2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 933 | rparams2 := &teststube2ap.E2StubSubsReqParams{} |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 934 | rparams2.Init() |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 935 | cretrans2 := xappConn2.SendSubsReq(t, rparams2, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 936 | //crereq2, cremsg2 := e2termConn1.RecvSubsReq(t) |
| 937 | //e2termConn1.SendSubsResp(t, crereq2, cremsg2) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 938 | e2SubsId2 := xappConn2.RecvSubsResp(t, cretrans2) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 939 | |
| 940 | //Del1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 941 | deltrans1 := xappConn1.SendSubsDelReq(t, nil, e2SubsId1) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 942 | //e2termConn1.RecvSubsDelReq(t) |
| 943 | //e2termConn1.SendSubsDelResp(t, delreq1, delmsg1) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 944 | xappConn1.RecvSubsDelResp(t, deltrans1) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 945 | //Wait that subs is cleaned |
| 946 | //mainCtrl.wait_subs_clean(t, e2SubsId1, 10) |
| 947 | |
| 948 | //Del2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 949 | deltrans2 := xappConn2.SendSubsDelReq(t, nil, e2SubsId2) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 950 | delreq2, delmsg2 := e2termConn1.RecvSubsDelReq(t) |
| 951 | e2termConn1.SendSubsDelResp(t, delreq2, delmsg2) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 952 | xappConn2.RecvSubsDelResp(t, deltrans2) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 953 | //Wait that subs is cleaned |
| 954 | mainCtrl.wait_subs_clean(t, e2SubsId2, 10) |
| 955 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 956 | xappConn1.TestMsgChanEmpty(t) |
| 957 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 958 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 959 | mainCtrl.wait_registry_empty(t, 10) |
| 960 | } |
| 961 | |
| 962 | //----------------------------------------------------------------------------- |
| 963 | // TestSubReqAndSubDelOkSameActionParallel |
| 964 | // |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 965 | // stub stub stub |
| 966 | // +-------+ +-------+ +---------+ +---------+ |
| 967 | // | xapp2 | | xapp1 | | submgr | | e2term | |
| 968 | // +-------+ +-------+ +---------+ +---------+ |
| 969 | // | | | | |
| 970 | // | | | | |
| 971 | // | | | | |
| 972 | // | | SubReq1 | | |
| 973 | // | |------------->| | |
| 974 | // | | | | |
| 975 | // | | | SubReq1 | |
| 976 | // | | |------------->| |
| 977 | // | SubReq2 | | |
| 978 | // |--------------------------->| | |
| 979 | // | | | SubResp1 | |
| 980 | // | | |<-------------| |
| 981 | // | | SubResp1 | | |
| 982 | // | |<-------------| | |
| 983 | // | | | | |
| 984 | // | SubResp2 | | |
| 985 | // |<---------------------------| | |
| 986 | // | | | | |
| 987 | // | | SubDelReq 1 | | |
| 988 | // | |------------->| | |
| 989 | // | | | | |
| 990 | // | | SubDelResp 1 | | |
| 991 | // | |<-------------| | |
| 992 | // | | | | |
| 993 | // | SubDelReq 2 | | |
| 994 | // |--------------------------->| | |
| 995 | // | | | | |
| 996 | // | | | SubDelReq 2 | |
| 997 | // | | |------------->| |
| 998 | // | | | | |
| 999 | // | | | SubDelReq 2 | |
| 1000 | // | | |------------->| |
| 1001 | // | | | | |
| 1002 | // | SubDelResp 2 | | |
| 1003 | // |<---------------------------| | |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1004 | // |
| 1005 | //----------------------------------------------------------------------------- |
| 1006 | func TestSubReqAndSubDelOkSameActionParallel(t *testing.T) { |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1007 | CaseBegin("TestSubReqAndSubDelOkSameActionParallel") |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1008 | |
| 1009 | //Req1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1010 | rparams1 := &teststube2ap.E2StubSubsReqParams{} |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1011 | rparams1.Init() |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1012 | cretrans1 := xappConn1.SendSubsReq(t, rparams1, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1013 | crereq1, cremsg1 := e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1014 | |
| 1015 | //Req2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1016 | rparams2 := &teststube2ap.E2StubSubsReqParams{} |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1017 | rparams2.Init() |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1018 | cretrans2 := xappConn2.SendSubsReq(t, rparams2, nil) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1019 | |
| 1020 | //Resp1 |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1021 | e2termConn1.SendSubsResp(t, crereq1, cremsg1) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1022 | e2SubsId1 := xappConn1.RecvSubsResp(t, cretrans1) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1023 | |
| 1024 | //Resp2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1025 | e2SubsId2 := xappConn2.RecvSubsResp(t, cretrans2) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1026 | |
| 1027 | //Del1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1028 | deltrans1 := xappConn1.SendSubsDelReq(t, nil, e2SubsId1) |
| 1029 | xappConn1.RecvSubsDelResp(t, deltrans1) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1030 | |
| 1031 | //Del2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1032 | deltrans2 := xappConn2.SendSubsDelReq(t, nil, e2SubsId2) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1033 | delreq2, delmsg2 := e2termConn1.RecvSubsDelReq(t) |
| 1034 | e2termConn1.SendSubsDelResp(t, delreq2, delmsg2) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1035 | xappConn2.RecvSubsDelResp(t, deltrans2) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1036 | |
| 1037 | //Wait that subs is cleaned |
| 1038 | mainCtrl.wait_subs_clean(t, e2SubsId2, 10) |
| 1039 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1040 | xappConn1.TestMsgChanEmpty(t) |
| 1041 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1042 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1043 | mainCtrl.wait_registry_empty(t, 10) |
| 1044 | } |
| 1045 | |
| 1046 | //----------------------------------------------------------------------------- |
| 1047 | // TestSubReqAndSubDelNokSameActionParallel |
| 1048 | // |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1049 | // stub stub stub |
| 1050 | // +-------+ +-------+ +---------+ +---------+ |
| 1051 | // | xapp2 | | xapp1 | | submgr | | e2term | |
| 1052 | // +-------+ +-------+ +---------+ +---------+ |
| 1053 | // | | | | |
| 1054 | // | | | | |
| 1055 | // | | | | |
| 1056 | // | | SubReq1 | | |
| 1057 | // | |------------->| | |
| 1058 | // | | | | |
| 1059 | // | | | SubReq1 | |
| 1060 | // | | |------------->| |
| 1061 | // | SubReq2 | | |
| 1062 | // |--------------------------->| | |
| 1063 | // | | | SubFail1 | |
| 1064 | // | | |<-------------| |
| 1065 | // | | SubFail1 | | |
| 1066 | // | |<-------------| | |
| 1067 | // | | | | |
| 1068 | // | SubFail2 | | |
| 1069 | // |<---------------------------| | |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1070 | // |
| 1071 | //----------------------------------------------------------------------------- |
| 1072 | func TestSubReqAndSubDelNokSameActionParallel(t *testing.T) { |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1073 | CaseBegin("TestSubReqAndSubDelNokSameActionParallel") |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1074 | |
| 1075 | //Req1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1076 | rparams1 := &teststube2ap.E2StubSubsReqParams{} |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1077 | rparams1.Init() |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1078 | cretrans1 := xappConn1.SendSubsReq(t, rparams1, nil) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1079 | crereq1, cremsg1 := e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1080 | |
| 1081 | //Req2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1082 | rparams2 := &teststube2ap.E2StubSubsReqParams{} |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1083 | rparams2.Init() |
| 1084 | seqBef2 := mainCtrl.get_msgcounter(t) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1085 | cretrans2 := xappConn2.SendSubsReq(t, rparams2, nil) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1086 | mainCtrl.wait_msgcounter_change(t, seqBef2, 10) |
| 1087 | |
| 1088 | //E2T Fail |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1089 | fparams := &teststube2ap.E2StubSubsFailParams{} |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1090 | fparams.Set(crereq1) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1091 | e2termConn1.SendSubsFail(t, fparams, cremsg1) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1092 | |
| 1093 | //Fail1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1094 | e2SubsId1 := xappConn1.RecvSubsFail(t, cretrans1) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1095 | //Fail2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1096 | xappConn2.RecvSubsFail(t, cretrans2) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1097 | |
| 1098 | //Wait that subs is cleaned |
| 1099 | mainCtrl.wait_subs_clean(t, e2SubsId1, 15) |
| 1100 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1101 | xappConn1.TestMsgChanEmpty(t) |
| 1102 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1103 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1104 | mainCtrl.wait_registry_empty(t, 10) |
| 1105 | } |
| 1106 | |
| 1107 | //----------------------------------------------------------------------------- |
| 1108 | // TestSubReqAndSubDelNoAnswerSameActionParallel |
| 1109 | // |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1110 | // stub stub stub |
| 1111 | // +-------+ +-------+ +---------+ +---------+ |
| 1112 | // | xapp2 | | xapp1 | | submgr | | e2term | |
| 1113 | // +-------+ +-------+ +---------+ +---------+ |
| 1114 | // | | | | |
| 1115 | // | | | | |
| 1116 | // | | | | |
| 1117 | // | | SubReq1 | | |
| 1118 | // | |------------->| | |
| 1119 | // | | | | |
| 1120 | // | | | SubReq1 | |
| 1121 | // | | |------------->| |
| 1122 | // | | SubReq2 | | |
| 1123 | // |--------------------------->| | |
| 1124 | // | | | | |
| 1125 | // | | | SubReq1 | |
| 1126 | // | | |------------->| |
| 1127 | // | | | | |
| 1128 | // | | | | |
| 1129 | // | | | SubDelReq | |
| 1130 | // | | |------------->| |
| 1131 | // | | | | |
| 1132 | // | | | SubDelResp | |
| 1133 | // | | |<-------------| |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1134 | // |
| 1135 | //----------------------------------------------------------------------------- |
| 1136 | func TestSubReqAndSubDelNoAnswerSameActionParallel(t *testing.T) { |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1137 | CaseBegin("TestSubReqAndSubDelNoAnswerSameActionParallel") |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1138 | |
| 1139 | //Req1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1140 | rparams1 := &teststube2ap.E2StubSubsReqParams{} |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1141 | rparams1.Init() |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1142 | xappConn1.SendSubsReq(t, rparams1, nil) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1143 | |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1144 | e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1145 | |
| 1146 | //Req2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1147 | rparams2 := &teststube2ap.E2StubSubsReqParams{} |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1148 | rparams2.Init() |
| 1149 | seqBef2 := mainCtrl.get_msgcounter(t) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1150 | xappConn2.SendSubsReq(t, rparams2, nil) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1151 | mainCtrl.wait_msgcounter_change(t, seqBef2, 10) |
| 1152 | |
| 1153 | //Req1 (retransmitted) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1154 | e2termConn1.RecvSubsReq(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1155 | |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1156 | delreq1, delmsg1 := e2termConn1.RecvSubsDelReq(t) |
| 1157 | e2termConn1.SendSubsDelResp(t, delreq1, delmsg1) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1158 | |
| 1159 | //Wait that subs is cleaned |
Juha Hyttinen | 83ada00 | 2020-01-30 10:36:33 +0200 | [diff] [blame] | 1160 | mainCtrl.wait_subs_clean(t, delreq1.RequestId.Seq, 10) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1161 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1162 | xappConn1.TestMsgChanEmpty(t) |
| 1163 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1164 | e2termConn1.TestMsgChanEmpty(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1165 | mainCtrl.wait_registry_empty(t, 15) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 1166 | } |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1167 | |
| 1168 | //----------------------------- Policy cases --------------------------------- |
| 1169 | //----------------------------------------------------------------------------- |
| 1170 | // TestSubReqPolicyAndSubDelOk |
| 1171 | // |
| 1172 | // stub stub |
| 1173 | // +-------+ +---------+ +---------+ |
| 1174 | // | xapp | | submgr | | e2term | |
| 1175 | // +-------+ +---------+ +---------+ |
| 1176 | // | | | |
| 1177 | // | SubReq | | |
| 1178 | // |------------->| | |
| 1179 | // | | | |
| 1180 | // | | SubReq | |
| 1181 | // | |------------->| |
| 1182 | // | | | |
| 1183 | // | | SubResp | |
| 1184 | // | |<-------------| |
| 1185 | // | | | |
| 1186 | // | SubResp | | |
| 1187 | // |<-------------| | |
| 1188 | // | | | |
| 1189 | // | | | |
| 1190 | // | SubDelReq | | |
| 1191 | // |------------->| | |
| 1192 | // | | | |
| 1193 | // | | SubDelReq | |
| 1194 | // | |------------->| |
| 1195 | // | | | |
| 1196 | // | | SubDelResp | |
| 1197 | // | |<-------------| |
| 1198 | // | | | |
| 1199 | // | SubDelResp | | |
| 1200 | // |<-------------| | |
| 1201 | // |
| 1202 | //----------------------------------------------------------------------------- |
| 1203 | func TestSubReqPolicyAndSubDelOk(t *testing.T) { |
| 1204 | CaseBegin("TestSubReqAndSubDelOk") |
| 1205 | |
| 1206 | rparams1 := &teststube2ap.E2StubSubsReqParams{} |
| 1207 | rparams1.Init() |
| 1208 | rparams1.Req.ActionSetups[0].ActionType = e2ap.E2AP_ActionTypePolicy |
| 1209 | cretrans := xappConn1.SendSubsReq(t, rparams1, nil) |
| 1210 | |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1211 | crereq, cremsg := e2termConn1.RecvSubsReq(t) |
| 1212 | e2termConn1.SendSubsResp(t, crereq, cremsg) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1213 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
| 1214 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1215 | delreq, delmsg := e2termConn1.RecvSubsDelReq(t) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1216 | |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1217 | e2termConn1.SendSubsDelResp(t, delreq, delmsg) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1218 | xappConn1.RecvSubsDelResp(t, deltrans) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1219 | |
| 1220 | //Wait that subs is cleaned |
| 1221 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 1222 | |
| 1223 | xappConn1.TestMsgChanEmpty(t) |
| 1224 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1225 | e2termConn1.TestMsgChanEmpty(t) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1226 | mainCtrl.wait_registry_empty(t, 10) |
| 1227 | } |
| 1228 | |
| 1229 | //----------------------------------------------------------------------------- |
| 1230 | // TestSubReqPolicyChangeAndSubDelOk |
| 1231 | // |
| 1232 | // stub stub |
| 1233 | // +-------+ +---------+ +---------+ |
| 1234 | // | xapp | | submgr | | e2term | |
| 1235 | // +-------+ +---------+ +---------+ |
| 1236 | // | | | |
| 1237 | // | SubReq | | |
| 1238 | // |------------->| | |
| 1239 | // | | | |
| 1240 | // | | SubReq | |
| 1241 | // | |------------->| |
| 1242 | // | | | |
| 1243 | // | | SubResp | |
| 1244 | // | |<-------------| |
| 1245 | // | | | |
| 1246 | // | SubResp | | |
| 1247 | // |<-------------| | |
| 1248 | // | | | |
| 1249 | // | SubReq | | |
| 1250 | // |------------->| | |
| 1251 | // | | | |
| 1252 | // | | SubReq | |
| 1253 | // | |------------->| |
| 1254 | // | | | |
| 1255 | // | | SubResp | |
| 1256 | // | |<-------------| |
| 1257 | // | | | |
| 1258 | // | SubResp | | |
| 1259 | // |<-------------| | |
| 1260 | // | | | |
| 1261 | // | SubDelReq | | |
| 1262 | // |------------->| | |
| 1263 | // | | | |
| 1264 | // | | SubDelReq | |
| 1265 | // | |------------->| |
| 1266 | // | | | |
| 1267 | // | | SubDelResp | |
| 1268 | // | |<-------------| |
| 1269 | // | | | |
| 1270 | // | SubDelResp | | |
| 1271 | // |<-------------| | |
| 1272 | // |
| 1273 | //----------------------------------------------------------------------------- |
| 1274 | |
| 1275 | func TestSubReqPolicyChangeAndSubDelOk(t *testing.T) { |
| 1276 | CaseBegin("TestSubReqAndSubDelOk") |
| 1277 | |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1278 | rparams1 := &teststube2ap.E2StubSubsReqParams{} |
| 1279 | rparams1.Init() |
| 1280 | rparams1.Req.ActionSetups[0].ActionType = e2ap.E2AP_ActionTypePolicy |
| 1281 | cretrans := xappConn1.SendSubsReq(t, rparams1, nil) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1282 | |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1283 | crereq, cremsg := e2termConn1.RecvSubsReq(t) |
| 1284 | e2termConn1.SendSubsResp(t, crereq, cremsg) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1285 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
| 1286 | |
| 1287 | //Policy change |
| 1288 | rparams1.Req.RequestId.Seq = e2SubsId |
| 1289 | rparams1.Req.ActionSetups[0].SubsequentAction.TimetoWait = e2ap.E2AP_TimeToWaitW200ms |
| 1290 | xappConn1.SendSubsReq(t, rparams1, cretrans) |
| 1291 | |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1292 | crereq, cremsg = e2termConn1.RecvSubsReq(t) |
| 1293 | e2termConn1.SendSubsResp(t, crereq, cremsg) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1294 | e2SubsId = xappConn1.RecvSubsResp(t, cretrans) |
| 1295 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1296 | delreq, delmsg := e2termConn1.RecvSubsDelReq(t) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1297 | |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1298 | e2termConn1.SendSubsDelResp(t, delreq, delmsg) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1299 | xappConn1.RecvSubsDelResp(t, deltrans) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1300 | |
| 1301 | //Wait that subs is cleaned |
| 1302 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 1303 | |
| 1304 | xappConn1.TestMsgChanEmpty(t) |
| 1305 | xappConn2.TestMsgChanEmpty(t) |
Juha Hyttinen | 896c3ac | 2020-02-24 12:49:20 +0200 | [diff] [blame] | 1306 | e2termConn1.TestMsgChanEmpty(t) |
| 1307 | mainCtrl.wait_registry_empty(t, 10) |
| 1308 | } |
| 1309 | |
| 1310 | //----------------------------------------------------------------------------- |
| 1311 | // TestSubReqAndSubDelOkTwoE2termParallel |
| 1312 | // |
| 1313 | // stub stub stub |
| 1314 | // +-------+ +---------+ +---------+ +---------+ |
| 1315 | // | xapp | | submgr | | e2term1 | | e2term2 | |
| 1316 | // +-------+ +---------+ +---------+ +---------+ |
| 1317 | // | | | | |
| 1318 | // | | | | |
| 1319 | // | | | | |
| 1320 | // | SubReq1 | | | |
| 1321 | // |------------->| | | |
| 1322 | // | | | | |
| 1323 | // | | SubReq1 | | |
| 1324 | // | |------------->| | |
| 1325 | // | | | | |
| 1326 | // | SubReq2 | | | |
| 1327 | // |------------->| | | |
| 1328 | // | | | | |
| 1329 | // | | SubReq2 | | |
| 1330 | // | |---------------------------->| |
| 1331 | // | | | | |
| 1332 | // | | SubResp1 | | |
| 1333 | // | |<-------------| | |
| 1334 | // | SubResp1 | | | |
| 1335 | // |<-------------| | | |
| 1336 | // | | SubResp2 | | |
| 1337 | // | |<----------------------------| |
| 1338 | // | SubResp2 | | | |
| 1339 | // |<-------------| | | |
| 1340 | // | | | | |
| 1341 | // | [SUBS 1 DELETE] | | |
| 1342 | // | | | | |
| 1343 | // | [SUBS 2 DELETE] | | |
| 1344 | // | | | | |
| 1345 | // |
| 1346 | //----------------------------------------------------------------------------- |
| 1347 | func TestSubReqAndSubDelOkTwoE2termParallel(t *testing.T) { |
| 1348 | CaseBegin("TestSubReqAndSubDelOkTwoE2termParallel") |
| 1349 | |
| 1350 | //Req1 |
| 1351 | cretrans1 := xappConn1.NewRmrTransactionId("", "RAN_NAME_1") |
| 1352 | xappConn1.SendSubsReq(t, nil, cretrans1) |
| 1353 | crereq1, cremsg1 := e2termConn1.RecvSubsReq(t) |
| 1354 | |
| 1355 | cretrans2 := xappConn1.NewRmrTransactionId("", "RAN_NAME_11") |
| 1356 | xappConn1.SendSubsReq(t, nil, cretrans2) |
| 1357 | crereq2, cremsg2 := e2termConn2.RecvSubsReq(t) |
| 1358 | |
| 1359 | //Resp1 |
| 1360 | e2termConn1.SendSubsResp(t, crereq1, cremsg1) |
| 1361 | e2SubsId1 := xappConn1.RecvSubsResp(t, cretrans1) |
| 1362 | |
| 1363 | //Resp2 |
| 1364 | e2termConn2.SendSubsResp(t, crereq2, cremsg2) |
| 1365 | e2SubsId2 := xappConn1.RecvSubsResp(t, cretrans2) |
| 1366 | |
| 1367 | //Del1 |
| 1368 | deltrans1 := xappConn1.SendSubsDelReq(t, nil, e2SubsId1) |
| 1369 | delreq1, delmsg1 := e2termConn1.RecvSubsDelReq(t) |
| 1370 | e2termConn1.SendSubsDelResp(t, delreq1, delmsg1) |
| 1371 | xappConn1.RecvSubsDelResp(t, deltrans1) |
| 1372 | //Wait that subs is cleaned |
| 1373 | mainCtrl.wait_subs_clean(t, e2SubsId1, 10) |
| 1374 | |
| 1375 | //Del2 |
| 1376 | deltrans2 := xappConn1.SendSubsDelReq(t, nil, e2SubsId2) |
| 1377 | delreq2, delmsg2 := e2termConn2.RecvSubsDelReq(t) |
| 1378 | e2termConn2.SendSubsDelResp(t, delreq2, delmsg2) |
| 1379 | xappConn1.RecvSubsDelResp(t, deltrans2) |
| 1380 | //Wait that subs is cleaned |
| 1381 | mainCtrl.wait_subs_clean(t, e2SubsId2, 10) |
| 1382 | |
| 1383 | xappConn1.TestMsgChanEmpty(t) |
| 1384 | xappConn2.TestMsgChanEmpty(t) |
| 1385 | e2termConn1.TestMsgChanEmpty(t) |
| 1386 | e2termConn2.TestMsgChanEmpty(t) |
Anssi Mannila | 9bcb0a4 | 2020-02-11 11:30:44 +0200 | [diff] [blame] | 1387 | mainCtrl.wait_registry_empty(t, 10) |
| 1388 | } |