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) |
| 64 | e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 109 | crereq, cremsg := e2termConn.RecvSubsReq(t) |
| 110 | e2termConn.SendSubsResp(t, crereq, cremsg) |
| 111 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
| 112 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
| 113 | delreq, delmsg := e2termConn.RecvSubsDelReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 114 | |
| 115 | waiter = rtmgrHttp.AllocNextEvent(true) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 116 | e2termConn.SendSubsDelResp(t, delreq, delmsg) |
| 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) |
| 125 | e2termConn.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) |
| 162 | crereq, cremsg := e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 168 | e2termConn.SendSubsResp(t, crereq, cremsg) |
| 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) |
| 173 | delreq, delmsg := e2termConn.RecvSubsDelReq(t) |
| 174 | e2termConn.SendSubsDelResp(t, delreq, delmsg) |
| 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) |
| 182 | e2termConn.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) |
| 220 | crereq, cremsg := e2termConn.RecvSubsReq(t) |
| 221 | e2termConn.SendSubsResp(t, crereq, cremsg) |
| 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) |
| 226 | delreq, delmsg := e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 232 | e2termConn.SendSubsDelResp(t, delreq, delmsg) |
| 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) |
| 240 | e2termConn.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) |
| 282 | crereq, cremsg := e2termConn.RecvSubsReq(t) |
| 283 | e2termConn.SendSubsResp(t, crereq, cremsg) |
| 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) |
| 288 | delreq1, delmsg1 := e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 297 | e2termConn.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) |
| 308 | e2termConn.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 | // |
| 315 | // stub stub |
| 316 | // +-------+ +---------+ +---------+ |
| 317 | // | 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 | // | | SubResp2 | |
| 337 | // | |<-------------| |
| 338 | // | | | |
| 339 | // | SubResp1 | | |
| 340 | // |<-------------| | |
| 341 | // | SubResp2 | | |
| 342 | // |<-------------| | |
| 343 | // | | | |
| 344 | // | [SUBS 1 DELETE] | |
| 345 | // | | | |
| 346 | // | [SUBS 2 DELETE] | |
| 347 | // | | | |
| 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) |
| 358 | crereq1, cremsg1 := e2termConn.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) |
| 365 | crereq2, cremsg2 := e2termConn.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 366 | |
| 367 | //Resp1 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 368 | e2termConn.SendSubsResp(t, crereq1, cremsg1) |
| 369 | e2SubsId1 := xappConn1.RecvSubsResp(t, cretrans1) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 370 | |
| 371 | //Resp2 |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 372 | e2termConn.SendSubsResp(t, crereq2, cremsg2) |
| 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) |
| 377 | delreq1, delmsg1 := e2termConn.RecvSubsDelReq(t) |
| 378 | e2termConn.SendSubsDelResp(t, delreq1, delmsg1) |
| 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) |
| 385 | delreq2, delmsg2 := e2termConn.RecvSubsDelReq(t) |
| 386 | e2termConn.SendSubsDelResp(t, delreq2, delmsg2) |
| 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) |
| 393 | e2termConn.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) |
| 444 | crereq1, cremsg1 := e2termConn.RecvSubsReq(t) |
| 445 | e2termConn.SendSubsResp(t, crereq1, cremsg1) |
| 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) |
| 451 | crereq2, cremsg2 := e2termConn.RecvSubsReq(t) |
| 452 | e2termConn.SendSubsResp(t, crereq2, cremsg2) |
| 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) |
| 458 | delreq1, delmsg1 := e2termConn.RecvSubsDelReq(t) |
| 459 | e2termConn.SendSubsDelResp(t, delreq1, delmsg1) |
| 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) |
| 467 | delreq2, delmsg2 := e2termConn.RecvSubsDelReq(t) |
| 468 | e2termConn.SendSubsDelResp(t, delreq2, delmsg2) |
| 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) |
| 475 | e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 516 | e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 519 | crereq, cremsg := e2termConn.RecvSubsReq(t) |
| 520 | e2termConn.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) |
| 526 | delreq, delmsg := e2termConn.RecvSubsDelReq(t) |
| 527 | e2termConn.SendSubsDelResp(t, delreq, delmsg) |
| 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) |
| 535 | e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 579 | e2termConn.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 580 | |
| 581 | // E2t: Receive 2nd SubsReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 582 | e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 585 | delreq, delmsg := e2termConn.RecvSubsDelReq(t) |
| 586 | e2termConn.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) |
| 593 | e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 634 | e2termConn.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 635 | |
| 636 | // E2t: Receive 2nd SubsReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 637 | e2termConn.RecvSubsReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 638 | |
| 639 | // E2t: Receive 1st SubsDelReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 640 | e2termConn.RecvSubsDelReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 641 | |
| 642 | // E2t: Receive 2nd SubsDelReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 643 | delreq, _ := e2termConn.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) |
| 650 | e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 685 | crereq, cremsg := e2termConn.RecvSubsReq(t) |
| 686 | fparams := &teststube2ap.E2StubSubsFailParams{} |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 687 | fparams.Set(crereq) |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 688 | e2termConn.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) |
| 698 | e2termConn.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) |
| 736 | crereq, cremsg := e2termConn.RecvSubsReq(t) |
| 737 | e2termConn.SendSubsResp(t, crereq, cremsg) |
| 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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 745 | e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 748 | delreq, delmsg := e2termConn.RecvSubsDelReq(t) |
| 749 | e2termConn.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) |
| 759 | e2termConn.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) |
| 795 | crereq, cremsg := e2termConn.RecvSubsReq(t) |
| 796 | e2termConn.SendSubsResp(t, crereq, cremsg) |
| 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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 804 | e2termConn.RecvSubsDelReq(t) |
Juha Hyttinen | fa01566 | 2020-01-24 10:05:18 +0200 | [diff] [blame] | 805 | |
| 806 | // E2t: Receive 2nd SubsDelReq |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 807 | e2termConn.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) |
| 817 | e2termConn.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) |
| 853 | crereq, cremsg := e2termConn.RecvSubsReq(t) |
| 854 | e2termConn.SendSubsResp(t, crereq, cremsg) |
| 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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 861 | delreq, delmsg := e2termConn.RecvSubsDelReq(t) |
| 862 | e2termConn.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) |
| 872 | e2termConn.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 |
| 880 | // +-------+ +---------+ +---------+ |
| 881 | // | xapp | | 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 | // |<-------------| | |
| 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) |
| 928 | crereq1, cremsg1 := e2termConn.RecvSubsReq(t) |
| 929 | e2termConn.SendSubsResp(t, crereq1, cremsg1) |
| 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) |
| 936 | //crereq2, cremsg2 := e2termConn.RecvSubsReq(t) |
| 937 | //e2termConn.SendSubsResp(t, crereq2, cremsg2) |
| 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) |
| 942 | //e2termConn.RecvSubsDelReq(t) |
| 943 | //e2termConn.SendSubsDelResp(t, delreq1, delmsg1) |
| 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) |
| 950 | delreq2, delmsg2 := e2termConn.RecvSubsDelReq(t) |
| 951 | e2termConn.SendSubsDelResp(t, delreq2, delmsg2) |
| 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) |
| 958 | e2termConn.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 | // |
| 965 | // stub stub |
| 966 | // +-------+ +---------+ +---------+ |
| 967 | // | xapp | | 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 | // |<-------------| | |
| 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) |
| 1013 | crereq1, cremsg1 := e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1021 | e2termConn.SendSubsResp(t, crereq1, cremsg1) |
| 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) |
| 1033 | delreq2, delmsg2 := e2termConn.RecvSubsDelReq(t) |
| 1034 | e2termConn.SendSubsDelResp(t, delreq2, delmsg2) |
| 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) |
| 1042 | e2termConn.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 | // |
| 1049 | // stub stub |
| 1050 | // +-------+ +---------+ +---------+ |
| 1051 | // | xapp | | 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 | // |<-------------| | |
| 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) |
| 1079 | crereq1, cremsg1 := e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1091 | e2termConn.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) |
| 1103 | e2termConn.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 | // |
| 1110 | // stub stub |
| 1111 | // +-------+ +---------+ +---------+ |
| 1112 | // | xapp | | 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 | // | |<-------------| |
| 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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1144 | e2termConn.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 | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1154 | e2termConn.RecvSubsReq(t) |
Juha Hyttinen | 3944a22 | 2020-01-24 11:51:46 +0200 | [diff] [blame] | 1155 | |
Juha Hyttinen | 5f8ffa0 | 2020-02-06 15:28:59 +0200 | [diff] [blame] | 1156 | delreq1, delmsg1 := e2termConn.RecvSubsDelReq(t) |
| 1157 | e2termConn.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) |
| 1164 | e2termConn.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 | |
| 1211 | crereq, cremsg := e2termConn.RecvSubsReq(t) |
| 1212 | e2termConn.SendSubsResp(t, crereq, cremsg) |
| 1213 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
| 1214 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
| 1215 | delreq, delmsg := e2termConn.RecvSubsDelReq(t) |
| 1216 | |
| 1217 | waiter := rtmgrHttp.AllocNextEvent(true) |
| 1218 | e2termConn.SendSubsDelResp(t, delreq, delmsg) |
| 1219 | xappConn1.RecvSubsDelResp(t, deltrans) |
| 1220 | waiter.WaitResult(t) |
| 1221 | |
| 1222 | //Wait that subs is cleaned |
| 1223 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 1224 | |
| 1225 | xappConn1.TestMsgChanEmpty(t) |
| 1226 | xappConn2.TestMsgChanEmpty(t) |
| 1227 | e2termConn.TestMsgChanEmpty(t) |
| 1228 | mainCtrl.wait_registry_empty(t, 10) |
| 1229 | } |
| 1230 | |
| 1231 | //----------------------------------------------------------------------------- |
| 1232 | // TestSubReqPolicyChangeAndSubDelOk |
| 1233 | // |
| 1234 | // stub stub |
| 1235 | // +-------+ +---------+ +---------+ |
| 1236 | // | xapp | | submgr | | e2term | |
| 1237 | // +-------+ +---------+ +---------+ |
| 1238 | // | | | |
| 1239 | // | SubReq | | |
| 1240 | // |------------->| | |
| 1241 | // | | | |
| 1242 | // | | SubReq | |
| 1243 | // | |------------->| |
| 1244 | // | | | |
| 1245 | // | | SubResp | |
| 1246 | // | |<-------------| |
| 1247 | // | | | |
| 1248 | // | SubResp | | |
| 1249 | // |<-------------| | |
| 1250 | // | | | |
| 1251 | // | SubReq | | |
| 1252 | // |------------->| | |
| 1253 | // | | | |
| 1254 | // | | SubReq | |
| 1255 | // | |------------->| |
| 1256 | // | | | |
| 1257 | // | | SubResp | |
| 1258 | // | |<-------------| |
| 1259 | // | | | |
| 1260 | // | SubResp | | |
| 1261 | // |<-------------| | |
| 1262 | // | | | |
| 1263 | // | SubDelReq | | |
| 1264 | // |------------->| | |
| 1265 | // | | | |
| 1266 | // | | SubDelReq | |
| 1267 | // | |------------->| |
| 1268 | // | | | |
| 1269 | // | | SubDelResp | |
| 1270 | // | |<-------------| |
| 1271 | // | | | |
| 1272 | // | SubDelResp | | |
| 1273 | // |<-------------| | |
| 1274 | // |
| 1275 | //----------------------------------------------------------------------------- |
| 1276 | |
| 1277 | func TestSubReqPolicyChangeAndSubDelOk(t *testing.T) { |
| 1278 | CaseBegin("TestSubReqAndSubDelOk") |
| 1279 | |
| 1280 | waiter := rtmgrHttp.AllocNextEvent(true) |
| 1281 | rparams1 := &teststube2ap.E2StubSubsReqParams{} |
| 1282 | rparams1.Init() |
| 1283 | rparams1.Req.ActionSetups[0].ActionType = e2ap.E2AP_ActionTypePolicy |
| 1284 | cretrans := xappConn1.SendSubsReq(t, rparams1, nil) |
| 1285 | waiter.WaitResult(t) |
| 1286 | |
| 1287 | crereq, cremsg := e2termConn.RecvSubsReq(t) |
| 1288 | e2termConn.SendSubsResp(t, crereq, cremsg) |
| 1289 | e2SubsId := xappConn1.RecvSubsResp(t, cretrans) |
| 1290 | |
| 1291 | //Policy change |
| 1292 | rparams1.Req.RequestId.Seq = e2SubsId |
| 1293 | rparams1.Req.ActionSetups[0].SubsequentAction.TimetoWait = e2ap.E2AP_TimeToWaitW200ms |
| 1294 | xappConn1.SendSubsReq(t, rparams1, cretrans) |
| 1295 | |
| 1296 | crereq, cremsg = e2termConn.RecvSubsReq(t) |
| 1297 | e2termConn.SendSubsResp(t, crereq, cremsg) |
| 1298 | e2SubsId = xappConn1.RecvSubsResp(t, cretrans) |
| 1299 | deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId) |
| 1300 | delreq, delmsg := e2termConn.RecvSubsDelReq(t) |
| 1301 | |
| 1302 | waiter = rtmgrHttp.AllocNextEvent(true) |
| 1303 | e2termConn.SendSubsDelResp(t, delreq, delmsg) |
| 1304 | xappConn1.RecvSubsDelResp(t, deltrans) |
| 1305 | waiter.WaitResult(t) |
| 1306 | |
| 1307 | //Wait that subs is cleaned |
| 1308 | mainCtrl.wait_subs_clean(t, e2SubsId, 10) |
| 1309 | |
| 1310 | xappConn1.TestMsgChanEmpty(t) |
| 1311 | xappConn2.TestMsgChanEmpty(t) |
| 1312 | e2termConn.TestMsgChanEmpty(t) |
| 1313 | mainCtrl.wait_registry_empty(t, 10) |
| 1314 | } |