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