From 4e13a8f9f9d40e5d62c9cee7d76348ef8b558981 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 31 Jan 2015 22:16:00 +0100 Subject: 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 --- openbsc/tests/ctrl_test_runner.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'openbsc/tests/ctrl_test_runner.py') diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py index a1e1d4dc6..502da7657 100644 --- a/openbsc/tests/ctrl_test_runner.py +++ b/openbsc/tests/ctrl_test_runner.py @@ -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): -- cgit v1.2.3