[PATCH] osmo-hlr[master]: test_subscriber.ctrl: test against octal/hex interpretation ...

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Tue Oct 24 15:34:29 UTC 2017


Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/4343

to look at the new patch set (#4).

test_subscriber.ctrl: test against octal/hex interpretation of id

Add a large enough subscriber id and add a test that ensures a leading zero is
not interpreted as octal, and that a leading 0x is invalid and not interpreted
as hexadecimal.

Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173
---
M tests/test_subscriber.ctrl
M tests/test_subscriber.sql
2 files changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/43/4343/4

diff --git a/tests/test_subscriber.ctrl b/tests/test_subscriber.ctrl
index b9be5fe..4cefa4d 100644
--- a/tests/test_subscriber.ctrl
+++ b/tests/test_subscriber.ctrl
@@ -596,3 +596,19 @@
 periodic_lu_timer	0
 periodic_rau_tau_timer	0
 lmsi	00000000
+
+GET 100 subscriber.by-id-00123.info
+GET_REPLY 100 subscriber.by-id-00123.info 
+id	123
+imsi	123123
+msisdn	123
+nam_cs	1
+nam_ps	1
+ms_purged_cs	0
+ms_purged_ps	0
+periodic_lu_timer	0
+periodic_rau_tau_timer	0
+lmsi	00000000
+
+GET 101 subscriber.by-id-0x0123.info
+ERROR 101 Invalid value part of 'by-xxx-value' selector.
diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql
index bce0af2..2b6afac 100644
--- a/tests/test_subscriber.sql
+++ b/tests/test_subscriber.sql
@@ -11,3 +11,7 @@
 INSERT INTO subscriber (id, imsi, msisdn) VALUES (3, '901990000000003', '103');
 INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f');
 INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 2342);
+
+-- A subscriber id > 7 and > 15 to check against octal and hex notations
+INSERT INTO subscriber (id, imsi, msisdn) VALUES (123, '123123', '123');
+INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (123, 3, 'BeefedCafeFaceAcedAddedDecadeFee');

-- 
To view, visit https://gerrit.osmocom.org/4343
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib468b7cb595cf52331ebb41e6de0e8f57f69e173
Gerrit-PatchSet: 4
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list