summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-10-17 22:26:00 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-10-27 02:37:20 +0200
commit3f697cdc7157883f5c9a33122a7aa1f8dc5598af (patch)
tree93d2c12fe8ca7f62e30329a7e5e301a7b1794f30
parent446eb0f1bc0ca859873d104dc95509586f211d8e (diff)
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
-rw-r--r--tests/test_subscriber.ctrl16
-rw-r--r--tests/test_subscriber.sql4
2 files changed, 20 insertions, 0 deletions
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 @@ ms_purged_ps 0
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 auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '00010
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');