summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-04-24 10:30:05 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-04-24 10:30:05 +0200
commite9faa6f3a411e4fc7ff7968ee4be279b28296eec (patch)
treec4217c6dc27a3ffe9be70ce88dd7bb0e8dee4083
parent86decfb53ca4efff2548980e4bee7fd246198d93 (diff)
ctrl: Extend the testcase for using '09' as numbers on the interface
Verify that '0X' numbers are parsed correctly from the wire interface.
-rw-r--r--openbsc/tests/ctrl_test_runner.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py
index 70ae0908a..b50e93c51 100644
--- a/openbsc/tests/ctrl_test_runner.py
+++ b/openbsc/tests/ctrl_test_runner.py
@@ -264,6 +264,33 @@ class TestCtrlBSC(TestCtrlBase):
self.assertEquals(r['var'], 'bts.0.timezone')
self.assertEquals(r['value'], 'off')
+ def testMcc(self):
+ r = self.do_set('mcc', '23')
+ r = self.do_get('mcc')
+ self.assertEquals(r['mtype'], 'GET_REPLY')
+ self.assertEquals(r['var'], 'mcc')
+ self.assertEquals(r['value'], '23')
+
+ r = self.do_set('mcc', '023')
+ r = self.do_get('mcc')
+ self.assertEquals(r['mtype'], 'GET_REPLY')
+ self.assertEquals(r['var'], 'mcc')
+ self.assertEquals(r['value'], '23')
+
+ def testMnc(self):
+ r = self.do_set('mnc', '9')
+ r = self.do_get('mnc')
+ self.assertEquals(r['mtype'], 'GET_REPLY')
+ self.assertEquals(r['var'], 'mnc')
+ self.assertEquals(r['value'], '9')
+
+ r = self.do_set('mnc', '09')
+ r = self.do_get('mnc')
+ self.assertEquals(r['mtype'], 'GET_REPLY')
+ self.assertEquals(r['var'], 'mnc')
+ self.assertEquals(r['value'], '9')
+
+
def testMccMncApply(self):
# Test some invalid input
r = self.do_set('mcc-mnc-apply', 'WRONG')
@@ -306,6 +333,22 @@ class TestCtrlBSC(TestCtrlBase):
self.assertEquals(r['var'], 'mcc')
self.assertEquals(r['value'], '201')
+ # Change it
+ r = self.do_set('mcc-mnc-apply', '202,03')
+ self.assertEquals(r['mtype'], 'SET_REPLY')
+ self.assertEquals(r['var'], 'mcc-mnc-apply')
+ self.assertEquals(r['value'], 'Tried to drop the BTS')
+
+ r = self.do_get('mnc')
+ self.assertEquals(r['mtype'], 'GET_REPLY')
+ self.assertEquals(r['var'], 'mnc')
+ self.assertEquals(r['value'], '3')
+
+ r = self.do_get('mcc')
+ self.assertEquals(r['mtype'], 'GET_REPLY')
+ self.assertEquals(r['var'], 'mcc')
+ self.assertEquals(r['value'], '202')
+
class TestCtrlNITB(TestCtrlBase):
def tearDown(self):