Change in osmo-ttcn3-hacks[master]: remsim: New TC_slotmap_del_active_client() test

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Feb 16 14:48:27 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17187 )

Change subject: remsim: New TC_slotmap_del_active_client() test
......................................................................

remsim: New TC_slotmap_del_active_client() test

This test verifies that a slotmap delete via REST will not only
delete it from the bankd, but also from the client.

Change-Id: I8c4e53231b5386b00fe2938cde2091aa8b2e2027
Related: OS#4399
---
M remsim/RemsimServer_Tests.ttcn
1 file changed, 54 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/remsim/RemsimServer_Tests.ttcn b/remsim/RemsimServer_Tests.ttcn
index f0589ef..f2dbc25 100644
--- a/remsim/RemsimServer_Tests.ttcn
+++ b/remsim/RemsimServer_Tests.ttcn
@@ -390,7 +390,7 @@
 	f_ensure_slotmaps({});
 }
 
-/* simple delete of a 'ACTIVE' slotmap */
+/* simple delete of a 'ACTIVE' slotmap from server + bankd */
 testcase TC_slotmap_del_active() runs on test_CT {
 	var ComponentIdentity rspro_id := valueof(ts_CompId(remsimBankd, testcasename()));
 	f_rspro_init(rspro[0], mp_server_ip, mp_server_port, rspro_id, 0);
@@ -429,6 +429,58 @@
 }
 
 
+/* simple delete of a 'ACTIVE' slotmap from client */
+testcase TC_slotmap_del_active_client() runs on test_CT {
+	var ComponentIdentity rspro_id := valueof(ts_CompId(remsimBankd, testcasename()));
+	f_rspro_init(rspro[0], mp_server_ip, mp_server_port, rspro_id, 0);
+	rspro[0].rspro_bank_id := 1;
+	rspro[0].rspro_bank_nslots := 8;
+
+	rspro_id := valueof(ts_CompId(remsimClient, testcasename()));
+	f_rspro_init(rspro[1], mp_server_ip, mp_server_port, rspro_id, 1);
+	rspro[1].rspro_client_slot := valueof(ts_ClientSlot(3,4));
+
+	f_rsres_init();
+	var JsSlotmap sm := valueof(ts_JsSlotmap(ts_BankSlot(1,2), ts_ClientSlot(3,4)));
+	var HTTPResponse res;
+
+	/* Create a new slotmap via HTTP */
+	res := f_rsres_post_slotmap(sm);
+
+	/* verify that the slotmap exists and is NEW */
+	f_ensure_slotmap_exists_only(sm.client, sm.bank, NEW);
+
+	/* connect a bankd for that slotmap */
+	f_rspro_connect_client(0);
+
+	/* connect a client for that slotmap */
+	f_rspro_connect_client(1);
+
+	/* expect the slotmap to be pushed to bank and ACK it */
+	as_rspro_create_mapping(0, sm.client, sm.bank);
+
+	/* verify that the slotmap exists and is ACTIVE */
+	f_ensure_slotmap_exists_only(sm.client, sm.bank, ACTIVE);
+
+	/* expect the client to be configured with bankd side settings */
+	as_rspro_cfg_client_bank(1, sm.bank, ?/*FIXME*/);
+
+	f_sleep(1.0);
+
+	/* delete the slotmap via REST */
+	res := f_rsres_delete_slotmap(sm.bank);
+
+	/* verify the slotmap is gone from REST interface immediately */
+	f_ensure_slotmaps({});
+
+	/* verify the slotmap is removed from bankd */
+	as_rspro_remove_mapping(0, sm.client, sm.bank);
+
+	/* verify the slotmap is removed from client by setting IP/port to '0' */
+	as_rspro_cfg_client_bank(1, ?, tr_IpPort(ts_IPv4("0.0.0.0"), 0));
+}
+
+
 /* Add a slotmap to a currently active bank */
 testcase TC_slotmap_add_active_bank() runs on test_CT {
 	var ComponentIdentity rspro_id := valueof(ts_CompId(remsimBankd, testcasename()));
@@ -478,6 +530,7 @@
 	execute( TC_slotmap_del_new() );
 	execute( TC_slotmap_del_unack() );
 	execute( TC_slotmap_del_active() );
+	execute( TC_slotmap_del_active_client() );
 	execute( TC_slotmap_add_active_bank() );
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17187
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I8c4e53231b5386b00fe2938cde2091aa8b2e2027
Gerrit-Change-Number: 17187
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200216/86478adf/attachment.htm>


More information about the gerrit-log mailing list