aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ctrl_test_runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ctrl_test_runner.py')
-rwxr-xr-xtests/ctrl_test_runner.py212
1 files changed, 3 insertions, 209 deletions
diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py
index f43c09a79..f161fe68d 100755
--- a/tests/ctrl_test_runner.py
+++ b/tests/ctrl_test_runner.py
@@ -108,7 +108,9 @@ class TestCtrlBase(unittest.TestCase):
id = self.next_id
self.next_id += 1
self.send_set(var, value, id)
- return self.recv_msgs()[id]
+ x = self.recv_msgs()
+ print repr(x)
+ return x[id]
def do_get(self, var):
id = self.next_id
@@ -157,214 +159,6 @@ class TestCtrlBSC(TestCtrlBase):
def ctrl_app(self):
return (4249, "./src/osmo-bsc/osmo-bsc", "OsmoBSC", "bsc")
- def testCtrlErrs(self):
- r = self.do_get('invalid')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Command not found')
-
- r = self.do_set('rf_locked', '999')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Value failed verification.')
-
- r = self.do_get('bts')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Error while parsing the index.')
-
- r = self.do_get('bts.999')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Error while resolving object')
-
- def testBtsLac(self):
- r = self.do_get('bts.0.location-area-code')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'bts.0.location-area-code')
- self.assertEquals(r['value'], '1')
-
- r = self.do_set('bts.0.location-area-code', '23')
- self.assertEquals(r['mtype'], 'SET_REPLY')
- self.assertEquals(r['var'], 'bts.0.location-area-code')
- self.assertEquals(r['value'], '23')
-
- r = self.do_get('bts.0.location-area-code')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'bts.0.location-area-code')
- self.assertEquals(r['value'], '23')
-
- r = self.do_set('bts.0.location-area-code', '-1')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Input not within the range')
-
- def testBtsCi(self):
- r = self.do_get('bts.0.cell-identity')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'bts.0.cell-identity')
- self.assertEquals(r['value'], '0')
-
- r = self.do_set('bts.0.cell-identity', '23')
- self.assertEquals(r['mtype'], 'SET_REPLY')
- self.assertEquals(r['var'], 'bts.0.cell-identity')
- self.assertEquals(r['value'], '23')
-
- r = self.do_get('bts.0.cell-identity')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'bts.0.cell-identity')
- self.assertEquals(r['value'], '23')
-
- r = self.do_set('bts.0.cell-identity', '-1')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Input not within the range')
-
- def testBtsGenerateSystemInformation(self):
- r = self.do_get('bts.0.send-new-system-informations')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Write Only attribute')
-
- # No RSL links so it will fail
- r = self.do_set('bts.0.send-new-system-informations', '1')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Failed to generate SI')
-
- def testBtsChannelLoad(self):
- r = self.do_set('bts.0.channel-load', '1')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Read Only attribute')
-
- # No RSL link so everything is 0
- r = self.do_get('bts.0.channel-load')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['value'],
- 'CCCH+SDCCH4,0,0 TCH/F,0,0 TCH/H,0,0 SDCCH8,0,0'
- + ' TCH/F_PDCH,0,0 CCCH+SDCCH4+CBCH,0,0'
- + ' SDCCH8+CBCH,0,0 TCH/F_TCH/H_PDCH,0,0')
-
- def testBtsOmlConnectionState(self):
- """Check OML state. It will not be connected"""
- r = self.do_set('bts.0.oml-connection-state', '1')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Read Only attribute')
-
- # No RSL link so everything is 0
- r = self.do_get('bts.0.oml-connection-state')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['value'], 'disconnected')
-
- def testTrxPowerRed(self):
- r = self.do_get('bts.0.trx.0.max-power-reduction')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'bts.0.trx.0.max-power-reduction')
- self.assertEquals(r['value'], '20')
-
- r = self.do_set('bts.0.trx.0.max-power-reduction', '22')
- self.assertEquals(r['mtype'], 'SET_REPLY')
- self.assertEquals(r['var'], 'bts.0.trx.0.max-power-reduction')
- self.assertEquals(r['value'], '22')
-
- r = self.do_get('bts.0.trx.0.max-power-reduction')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'bts.0.trx.0.max-power-reduction')
- self.assertEquals(r['value'], '22')
-
- r = self.do_set('bts.0.trx.0.max-power-reduction', '1')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Value must be even')
-
- def testTrxArfcn(self):
- r = self.do_get('bts.0.trx.0.arfcn')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'bts.0.trx.0.arfcn')
- self.assertEquals(r['value'], '871')
-
- r = self.do_set('bts.0.trx.0.arfcn', '873')
- self.assertEquals(r['mtype'], 'SET_REPLY')
- self.assertEquals(r['var'], 'bts.0.trx.0.arfcn')
- self.assertEquals(r['value'], '873')
-
- r = self.do_get('bts.0.trx.0.arfcn')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'bts.0.trx.0.arfcn')
- self.assertEquals(r['value'], '873')
-
- r = self.do_set('bts.0.trx.0.arfcn', '2000')
- self.assertEquals(r['mtype'], 'ERROR')
- self.assertEquals(r['error'], 'Input not within the range')
-
- def testRfLock(self):
- r = self.do_get('bts.0.rf_state')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'bts.0.rf_state')
- self.assertEquals(r['value'], 'inoperational,unlocked,on')
-
- r = self.do_set('rf_locked', '1')
- self.assertEquals(r['mtype'], 'SET_REPLY')
- self.assertEquals(r['var'], 'rf_locked')
- self.assertEquals(r['value'], '1')
-
- time.sleep(1.5)
-
- r = self.do_get('bts.0.rf_state')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'bts.0.rf_state')
- self.assertEquals(r['value'], 'inoperational,locked,off')
-
- r = self.do_get('rf_locked')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'rf_locked')
- self.assertEquals(r['value'], 'state=off,policy=off')
-
- r = self.do_set('rf_locked', '0')
- self.assertEquals(r['mtype'], 'SET_REPLY')
- self.assertEquals(r['var'], 'rf_locked')
- self.assertEquals(r['value'], '0')
-
- time.sleep(1.5)
-
- r = self.do_get('bts.0.rf_state')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'bts.0.rf_state')
- self.assertEquals(r['value'], 'inoperational,unlocked,on')
-
- r = self.do_get('rf_locked')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'rf_locked')
- self.assertEquals(r['value'], 'state=off,policy=on')
-
- def testTimezone(self):
- r = self.do_get('timezone')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'timezone')
- self.assertEquals(r['value'], 'off')
-
- r = self.do_set('timezone', '-2,15,2')
- self.assertEquals(r['mtype'], 'SET_REPLY')
- self.assertEquals(r['var'], 'timezone')
- self.assertEquals(r['value'], '-2,15,2')
-
- r = self.do_get('timezone')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'timezone')
- self.assertEquals(r['value'], '-2,15,2')
-
- # Test invalid input
- r = self.do_set('timezone', '-2,15,2,5,6,7')
- self.assertEquals(r['mtype'], 'SET_REPLY')
- self.assertEquals(r['var'], 'timezone')
- self.assertEquals(r['value'], '-2,15,2')
-
- r = self.do_set('timezone', '-2,15')
- self.assertEquals(r['mtype'], 'ERROR')
- r = self.do_set('timezone', '-2')
- self.assertEquals(r['mtype'], 'ERROR')
- r = self.do_set('timezone', '1')
-
- r = self.do_set('timezone', 'off')
- self.assertEquals(r['mtype'], 'SET_REPLY')
- self.assertEquals(r['var'], 'timezone')
- self.assertEquals(r['value'], 'off')
-
- r = self.do_get('timezone')
- self.assertEquals(r['mtype'], 'GET_REPLY')
- self.assertEquals(r['var'], 'timezone')
- self.assertEquals(r['value'], 'off')
def testMcc(self):
r = self.do_set('mcc', '23')