summaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-11-11 14:01:48 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-09 10:00:41 +0100
commit207f4a5deba610b34d5e140f512e538e34a7115f (patch)
treec71639dda123271986b4b1e8a7424895bb775dae /openbsc/tests
parent98647ca0ef59430f3cd7ddb7530d85db7fa2688f (diff)
sgsn: Add VTY commands to manage subscriber cache
This adds the following commands to the ENABLE node: - show subscriber cache - update-subscriber imsi IMSI insert authorized (0|1) - update-subscriber imsi IMSI cancel - update-subscriber imsi IMSI commit These commands are mainly testing tools and maintenance helpers. The update commands work asynchronously and can be used to complete a pending update request or to terminate an existing connection. The 'insert' command just update the subscriber records but does not notify the GMM layer. Invoke the 'commit' command to continue with pending procedures. Note that the subscriber cache is not stored persistently and will always be empty after an SGSN restart. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/vty_test_runner.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index 64437a19c..a3cb9e580 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -756,6 +756,22 @@ class TestVTYSGSN(TestVTYGenericBSC):
res = self.vty.command("show running-config")
self.assert_(res.find('auth-policy remote') > 0)
+ def testVtySubscriber(self):
+ self.vty.enable()
+ res = self.vty.command('show subscriber cache')
+ self.assert_(res.find('1234567890') < 0)
+ self.assertTrue(self.vty.verify('update-subscriber imsi 1234567890 insert authorized 1', ['']))
+ res = self.vty.command('show subscriber cache')
+ self.assert_(res.find('1234567890') >= 0)
+ self.assert_(res.find('Authorized: 1') >= 0)
+ self.assertTrue(self.vty.verify('update-subscriber imsi 1234567890 insert authorized 0', ['']))
+ res = self.vty.command('show subscriber cache')
+ self.assert_(res.find('Authorized: 0') >= 0)
+ self.assertTrue(self.vty.verify('update-subscriber imsi 1234567890 commit', ['']))
+ self.assertTrue(self.vty.verify('update-subscriber imsi 1234567890 cancel', ['']))
+ res = self.vty.command('show subscriber cache')
+ self.assert_(res.find('1234567890') < 0)
+
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")