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
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() );