laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40568?usp=email )
Change subject: remsim: bankd: add TC for creating a mapping with a busy client
......................................................................
remsim: bankd: add TC for creating a mapping with a busy client
Test if a busy client is implicit removed when creating a new mapping
for the same client with a different bankd slot.
After a desynchronisation between the server and bankd happen (e.g. restart the server),
the server might request a mapping between a client slot and a bankd slot
while the bankd still has a different mapping for the same client slot.
Example before this commit:
* server -> bankd: New Mapping (client 1/0, bankd 1/0)
* server <- bankd: Ack
* Restart server
* server -> bankd: New Mapping (client 1/0, bankd 2/0)
* server <- bankd: Ack (implicit remove mapping to bankd 1/0)
Related: SYS#7470
Change-Id: I57112758167c2a29fae9df0cf1e2691c5a8e7bed
---
M remsim/RemsimBankd_Tests.ttcn
1 file changed, 16 insertions(+), 0 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/remsim/RemsimBankd_Tests.ttcn b/remsim/RemsimBankd_Tests.ttcn
index a2686d3..637cb0f 100644
--- a/remsim/RemsimBankd_Tests.ttcn
+++ b/remsim/RemsimBankd_Tests.ttcn
@@ -118,6 +118,21 @@
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, pass);
}
+/* attempt to create a mapping for a client that already has a mapping to a different
slot */
+testcase TC_createMapping_busyClient() runs on bankd_test_CT {
+ f_init();
+ as_connectBankReq(bid := mp_bank_id, nslots := mp_num_slots);
+ f_rspro_srv_reset_state(ok);
+ var BankSlot bs0 := { bankId := mp_bank_id, slotNr := 0 };
+ var BankSlot bs1 := { bankId := mp_bank_id, slotNr := 1 };
+ var ClientSlot cs := { clientId := 23, slotNr := 42 };
+ /* create the mapping the first time */
+ f_rspro_srv_create_slotmap(cs, bs0);
+ /* re-create the mapping a second time */
+ f_rspro_srv_create_slotmap(cs, bs1);
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, pass);
+}
+
/* attempt to create a mapping for an out-of-range slot number */
testcase TC_createMapping_invalidSlot() runs on bankd_test_CT {
f_init();
@@ -415,6 +430,7 @@
execute( TC_createMapping() );
execute( TC_createMapping_busySlot() );
+ execute( TC_createMapping_busyClient() );
execute( TC_createMapping_invalidSlot() );
execute( TC_createMapping_invalidBank() );
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40568?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I57112758167c2a29fae9df0cf1e2691c5a8e7bed
Gerrit-Change-Number: 40568
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>