bsc/nitb: Allow to set the GPRS mode through the ctrl command

Create a control command to read and modify the gprs mode. Use
the get_string_value to indicate if the value was found or not.
This is useful for the ctrl interface where I didn't want to
replicate "none", "gprs" and "egprs". Share code to verify that
a BTS supports the mode.

Related: SYS#591
This commit is contained in:
Holger Hans Peter Freyther
2015-01-31 22:16:00 +01:00
parent b8c204cb92
commit 4e13a8f9f9
5 changed files with 86 additions and 14 deletions

View File

@@ -491,6 +491,25 @@ class TestCtrlNITB(TestCtrlBase):
self.assertEquals(r['mtype'], 'SET_REPLY')
self.assertEquals(r['value'], 'Tried to drop the BTS')
def testGprsMode(self):
r = self.do_get('bts.0.gprs-mode')
self.assertEquals(r['mtype'], 'GET_REPLY')
self.assertEquals(r['var'], 'bts.0.gprs-mode')
self.assertEquals(r['value'], 'none')
r = self.do_set('bts.0.gprs-mode', 'bla')
self.assertEquals(r['mtype'], 'ERROR')
self.assertEquals(r['error'], 'Mode is not known')
r = self.do_set('bts.0.gprs-mode', 'egprs')
self.assertEquals(r['mtype'], 'SET_REPLY')
self.assertEquals(r['value'], 'egprs')
r = self.do_get('bts.0.gprs-mode')
self.assertEquals(r['mtype'], 'GET_REPLY')
self.assertEquals(r['var'], 'bts.0.gprs-mode')
self.assertEquals(r['value'], 'egprs')
class TestCtrlNAT(TestCtrlBase):
def ctrl_command(self):