[PATCH] osmo-bsc[master]: ctrl_test_runner: add tests for 3-digit MNC

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Mar 5 01:27:00 UTC 2018


Review at  https://gerrit.osmocom.org/7081

ctrl_test_runner: add tests for 3-digit MNC

Expand MCC-MNC test cases: show that the CTRL interface currently does not
preserve the third digit of the MNC if it is zero.

Change-Id: I5b097dbb6329f284e3b4914a744d5c3ad628f715
---
M tests/ctrl_test_runner.py
1 file changed, 38 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/81/7081/1

diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py
index 4f5df39..41765ff 100755
--- a/tests/ctrl_test_runner.py
+++ b/tests/ctrl_test_runner.py
@@ -392,6 +392,12 @@
         self.assertEquals(r['var'], 'mnc')
         self.assertEquals(r['value'], '9')
 
+        r = self.do_set('mnc', '009')
+        r = self.do_get('mnc')
+        self.assertEquals(r['mtype'], 'GET_REPLY')
+        self.assertEquals(r['var'], 'mnc')
+        self.assertEquals(r['value'], '9') # FAIL: expecting '009'
+
 
     def testMccMncApply(self):
         # Test some invalid input
@@ -451,6 +457,38 @@
         self.assertEquals(r['var'], 'mcc')
         self.assertEquals(r['value'], '202')
 
+        # Test MNC with 3 digits
+        r = self.do_set('mcc-mnc-apply', '2,003')
+        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') # FAIL: expecting '003'
+
+        r = self.do_get('mcc')
+        self.assertEquals(r['mtype'], 'GET_REPLY')
+        self.assertEquals(r['var'], 'mcc')
+        self.assertEquals(r['value'], '2')
+
+        # Set same MNC with 3 digits
+        r = self.do_set('mcc-mnc-apply', '2,003')
+        self.assertEquals(r['mtype'], 'SET_REPLY')
+        self.assertEquals(r['var'], 'mcc-mnc-apply')
+        self.assertEquals(r['value'], 'Nothing changed')
+
+        r = self.do_get('mnc')
+        self.assertEquals(r['mtype'], 'GET_REPLY')
+        self.assertEquals(r['var'], 'mnc')
+        self.assertEquals(r['value'], '3') # FAIL: expecting '003'
+
+        r = self.do_get('mcc')
+        self.assertEquals(r['mtype'], 'GET_REPLY')
+        self.assertEquals(r['var'], 'mcc')
+        self.assertEquals(r['value'], '2')
+
 class TestCtrlNAT(TestCtrlBase):
 
     def ctrl_command(self):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b097dbb6329f284e3b4914a744d5c3ad628f715
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list