path: root/openbsc/tests/ctrl_test_runner.py
diff options
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-09-16 11:20:29 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-09-16 14:07:20 +0200
commit4f13d03213f5a121c437a261d6fcb522049df180 (patch)
tree8dce9ddbfc87808743bb577c565821047379da5e /openbsc/tests/ctrl_test_runner.py
parent0760a83910a487e0bdd4e958829616fd491d95ba (diff)
ctrl: Set a generic reply when it hasn'n been set
When verification failed and the reply string was not updated, the message "Someone forgot to fill in the reply." was shown instead of the default "Value failed verification." message. This patch changes the default reply handling in ctrl_cmd_handle() by setting the reply to NULL initially and then checking it at the end. If it hasn't been set, a generic message is assigned and an error is logged.
Diffstat (limited to 'openbsc/tests/ctrl_test_runner.py')
1 files changed, 4 insertions, 0 deletions
diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py
index 24732e031..dfdec403c 100644
--- a/openbsc/tests/ctrl_test_runner.py
+++ b/openbsc/tests/ctrl_test_runner.py
@@ -159,6 +159,10 @@ class TestCtrlBSC(TestCtrlBase):
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.')