summaryrefslogtreecommitdiffstats
path: root/openbsc/tests/vty_test_runner.py
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-05-12 14:56:25 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-05-12 15:43:18 +0200
commit34ce3d93c52a734a7380114254a14ce8bcc77bb1 (patch)
tree0d260153b3d9b5db85ee11959467e443c3efc26a /openbsc/tests/vty_test_runner.py
parent5121576b0c6c323ae5f92d8d987b8c0899d99db0 (diff)
fix VTY parsing: subscriber-create-on-demand random
Fix parsing of the 'subscriber-create-on-demand random' VTY: atoi() is not enough to include the specified range of 1-9999999999. Use atoll() instead to ensure a large enough number space also on 32bit systems. (Note: for me, atoll() truncates at 32 bit when <stdlib.h> is not included.) Add a VTY regression test for this. Related: OS#2253 Change-Id: I353e04481ec567adca383d6b51ba8fb865eed73e
Diffstat (limited to 'openbsc/tests/vty_test_runner.py')
-rw-r--r--openbsc/tests/vty_test_runner.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index 305c956d7..b8869116f 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -476,6 +476,17 @@ class TestVTYNITB(TestVTYGenericBSC):
res = self.vty.command('show subscriber imsi '+imsi)
self.assert_(('% No subscriber found for imsi ' + imsi) == res)
+ # range
+ self.vty.command("end")
+ self.vty.command("configure terminal")
+ self.vty.command("nitb")
+ self.assertTrue(self.vty.verify("subscriber-create-on-demand random 9999999998 9999999999", ['']))
+ res = self.vty.command("show running-config")
+ self.assert_(res.find("subscriber-create-on-demand random 9999999998 9999999999"))
+ self.vty.command("end")
+
+
+
def testSubscriberSettings(self):
self.vty.enable()