Change in osmo-ttcn3-hacks[master]: remsim: Add RemsimServer_Tests.TC_slotmap_add_out_of_range()

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
Thu Feb 20 17:51:15 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17240 )


Change subject: remsim: Add RemsimServer_Tests.TC_slotmap_add_out_of_range()
......................................................................

remsim: Add RemsimServer_Tests.TC_slotmap_add_out_of_range()

Validate if osmo-remsim-server permits out-of-range integers in REST.

Change-Id: I449541420a15826ed0d2f1460e3ca4b3468662c3
---
M remsim/RemsimServer_Tests.ttcn
1 file changed, 26 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/40/17240/1

diff --git a/remsim/RemsimServer_Tests.ttcn b/remsim/RemsimServer_Tests.ttcn
index e154cc2..bada70a 100644
--- a/remsim/RemsimServer_Tests.ttcn
+++ b/remsim/RemsimServer_Tests.ttcn
@@ -260,6 +260,31 @@
 	f_ensure_slotmap_exists_only(sm.client, sm.bank, NEW);
 }
 
+/* test adding a single slotmap with out-of-range values */
+testcase TC_slotmap_add_out_of_range() runs on test_CT {
+	f_rsres_init();
+
+	var HTTPMessage http_resp;
+	var charstring body;
+
+	body := "{ \"bank\": { \"bankId\": 10000, \"slotNr\": 2 }, \"client\": { \"clientId\": 3, \"slotNr\": 4 } }";
+	http_resp := f_http_transact(url := "/api/backend/v1/slotmaps", method := "POST",
+				     body := body, exp := tr_HTTP_Resp(400));
+
+	body := "{ \"bank\": { \"bankId\": 100, \"slotNr\": 2000 }, \"client\": { \"clientId\": 3, \"slotNr\": 4 } }";
+	http_resp := f_http_transact(url := "/api/backend/v1/slotmaps", method := "POST",
+				     body := body, exp := tr_HTTP_Resp(400));
+
+	body := "{ \"bank\": { \"bankId\": 100, \"slotNr\": 2 }, \"client\": { \"clientId\": 3000, \"slotNr\": 4 } }";
+	http_resp := f_http_transact(url := "/api/backend/v1/slotmaps", method := "POST",
+				     body := body, exp := tr_HTTP_Resp(400));
+
+	body := "{ \"bank\": { \"bankId\": 100, \"slotNr\": 2 }, \"client\": { \"clientId\": 3, \"slotNr\": 4000 } }";
+	http_resp := f_http_transact(url := "/api/backend/v1/slotmaps", method := "POST",
+				     body := body, exp := tr_HTTP_Resp(400));
+}
+
+
 /* test adding a slotmap and then connecting a client + bankd */
 testcase TC_slotmap_add_conn_cl_b() runs on test_CT {
 	/* Simulate one client */
@@ -521,7 +546,6 @@
 /* TODO
  * - connect client w/slotmap; delete slotmap via REST (see if it is deleted)
  *   - don't acknowledge delete from client, disconnect client (see if slotmap is deleted)
- * - create slotmap with integers out of range via REST
 
  * - connect from unknown client (name not known, no clientId provisioned?
  * - add client name/ID mappings from REST API?
@@ -534,6 +558,7 @@
 	execute( TC_connect_bank() );
 	execute( TC_slotmap_add() );
 	execute( TC_slotmap_add_conn_cl_b() );
+	execute( TC_slotmap_add_out_of_range() );
 	execute( TC_conn_cl_b_slotmap_add() );
 	execute( TC_slotmap_del_new() );
 	execute( TC_slotmap_del_nonexistant() );

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17240
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: I449541420a15826ed0d2f1460e3ca4b3468662c3
Gerrit-Change-Number: 17240
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200220/4e9eae10/attachment.htm>


More information about the gerrit-log mailing list