aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/ctrl_test_runner.py
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-23 12:06:36 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-23 14:05:49 +0100
commit9dbc3f8db7ca2c95ad6b986cdc4cd6c7a602a8b4 (patch)
treec8be2ecaafb259acc7b2808b0e9946f855cc5b14 /openbsc/tests/ctrl_test_runner.py
parentd092f486486db4b2cb2cdc018ad3948d48a26827 (diff)
nitb/ctrl: Add command to add/modify a subscriber to the database
The test has been manually verified. Executing the select for the subscribers showed: sqlite> select * from Subscriber; 1|2014-03-23 12:12:46|2014-03-23 12:19:09|2620345||445567|1||0| This created a subscriber with the right IMSI, MSISDN and has it authorized. Fixes: SYS#275
Diffstat (limited to 'openbsc/tests/ctrl_test_runner.py')
-rw-r--r--openbsc/tests/ctrl_test_runner.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py
index afcd42cd5..07a005d83 100644
--- a/openbsc/tests/ctrl_test_runner.py
+++ b/openbsc/tests/ctrl_test_runner.py
@@ -306,6 +306,33 @@ class TestCtrlBSC(TestCtrlBase):
self.assertEquals(r['var'], 'mcc')
self.assertEquals(r['value'], '201')
+class TestCtrlNITB(TestCtrlBase):
+
+ def tearDown(self):
+ TestCtrlBase.tearDown(self)
+ os.unlink("test_hlr.sqlite3")
+
+ def ctrl_command(self):
+ return ["./src/osmo-nitb/osmo-nitb", "-c",
+ "doc/examples/osmo-nitb/nanobts/openbsc.cfg", "-l", "test_hlr.sqlite3"]
+
+ def ctrl_app(self):
+ return (4249, "./src/osmo-nitb/osmo-nitb", "OsmoBSC", "nitb")
+
+ def testSubscriberAdd(self):
+ r = self.do_set('subscriber-modify-v1', '2620345,445566')
+ self.assertEquals(r['mtype'], 'SET_REPLY')
+ self.assertEquals(r['var'], 'subscriber-modify-v1')
+ self.assertEquals(r['value'], 'OK')
+
+ r = self.do_set('subscriber-modify-v1', '2620345,445567')
+ self.assertEquals(r['mtype'], 'SET_REPLY')
+ self.assertEquals(r['var'], 'subscriber-modify-v1')
+ self.assertEquals(r['value'], 'OK')
+
+ # TODO. verify that the entry has been created and modified? Invoke
+ # the sqlite3 CLI or do it through the DB libraries?
+
class TestCtrlNAT(TestCtrlBase):
def ctrl_command(self):
@@ -348,6 +375,10 @@ def add_bsc_test(suite, workdir):
test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlBSC)
suite.addTest(test)
+def add_nitb_test(suite, workdir):
+ test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlNITB)
+ suite.addTest(test)
+
def add_nat_test(suite, workdir):
if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc_nat/osmo-bsc_nat")):
print("Skipping the NAT test")
@@ -386,6 +417,7 @@ if __name__ == '__main__':
print "Running tests for specific control commands"
suite = unittest.TestSuite()
add_bsc_test(suite, workdir)
+ add_nitb_test(suite, workdir)
add_nat_test(suite, workdir)
res = unittest.TextTestRunner(verbosity=verbose_level).run(suite)
sys.exit(len(res.errors) + len(res.failures))