Pau Espin Pedrol | 266b61a | 2017-11-28 20:08:17 +0100 | [diff] [blame] | 1 | #!/usr/bin/env python2 |
Holger Hans Peter Freyther | 6539752 | 2013-06-24 15:47:34 +0200 | [diff] [blame] | 2 | |
| 3 | # (C) 2013 by Katerina Barone-Adesi <kat.obsc@gmail.com> |
| 4 | # (C) 2013 by Holger Hans Peter Freyther |
| 5 | # This program is free software: you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation, either version 3 of the License, or |
| 8 | # (at your option) any later version. |
| 9 | |
| 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
Max | 5fd9894 | 2016-11-16 14:55:21 +0100 | [diff] [blame] | 18 | import os, sys |
Holger Hans Peter Freyther | 6539752 | 2013-06-24 15:47:34 +0200 | [diff] [blame] | 19 | import time |
| 20 | import unittest |
Jacob Erlbeck | 4684eb6 | 2013-08-14 11:10:34 +0200 | [diff] [blame] | 21 | import socket |
Neels Hofmeyr | d81df4f | 2017-02-03 16:09:17 +0100 | [diff] [blame] | 22 | import subprocess |
Holger Hans Peter Freyther | 6539752 | 2013-06-24 15:47:34 +0200 | [diff] [blame] | 23 | |
| 24 | import osmopy.obscvty as obscvty |
| 25 | import osmopy.osmoutil as osmoutil |
Max | 8a58bcd | 2017-12-19 18:12:11 +0100 | [diff] [blame] | 26 | from osmopy.osmo_ipa import IPA |
Max | 5fd9894 | 2016-11-16 14:55:21 +0100 | [diff] [blame] | 27 | |
Neels Hofmeyr | 6226a36 | 2017-02-24 17:55:11 +0100 | [diff] [blame] | 28 | # to be able to find $top_srcdir/doc/... |
| 29 | confpath = os.path.join(sys.path[0], '..') |
Holger Hans Peter Freyther | 6539752 | 2013-06-24 15:47:34 +0200 | [diff] [blame] | 30 | |
| 31 | class TestVTYBase(unittest.TestCase): |
| 32 | |
Neels Hofmeyr | d489ea3 | 2016-05-20 21:59:55 +0200 | [diff] [blame] | 33 | def checkForEndAndExit(self): |
| 34 | res = self.vty.command("list") |
| 35 | #print ('looking for "exit"\n') |
| 36 | self.assert_(res.find(' exit\r') > 0) |
| 37 | #print 'found "exit"\nlooking for "end"\n' |
| 38 | self.assert_(res.find(' end\r') > 0) |
| 39 | #print 'found "end"\n' |
| 40 | |
Holger Hans Peter Freyther | 6539752 | 2013-06-24 15:47:34 +0200 | [diff] [blame] | 41 | def vty_command(self): |
| 42 | raise Exception("Needs to be implemented by a subclass") |
| 43 | |
| 44 | def vty_app(self): |
| 45 | raise Exception("Needs to be implemented by a subclass") |
| 46 | |
| 47 | def setUp(self): |
| 48 | osmo_vty_cmd = self.vty_command()[:] |
| 49 | config_index = osmo_vty_cmd.index('-c') |
| 50 | if config_index: |
| 51 | cfi = config_index + 1 |
| 52 | osmo_vty_cmd[cfi] = os.path.join(confpath, osmo_vty_cmd[cfi]) |
| 53 | |
| 54 | try: |
Holger Hans Peter Freyther | 6539752 | 2013-06-24 15:47:34 +0200 | [diff] [blame] | 55 | self.proc = osmoutil.popen_devnull(osmo_vty_cmd) |
| 56 | except OSError: |
| 57 | print >> sys.stderr, "Current directory: %s" % os.getcwd() |
| 58 | print >> sys.stderr, "Consider setting -b" |
Holger Hans Peter Freyther | 6539752 | 2013-06-24 15:47:34 +0200 | [diff] [blame] | 59 | |
| 60 | appstring = self.vty_app()[2] |
| 61 | appport = self.vty_app()[0] |
| 62 | self.vty = obscvty.VTYInteract(appstring, "127.0.0.1", appport) |
| 63 | |
| 64 | def tearDown(self): |
Neels Hofmeyr | d5834d1 | 2017-02-24 17:54:22 +0100 | [diff] [blame] | 65 | if self.vty: |
| 66 | self.vty._close_socket() |
Holger Hans Peter Freyther | 6539752 | 2013-06-24 15:47:34 +0200 | [diff] [blame] | 67 | self.vty = None |
| 68 | osmoutil.end_proc(self.proc) |
| 69 | |
Jacob Erlbeck | 768a7c3 | 2013-09-02 13:17:14 +0200 | [diff] [blame] | 70 | |
Neels Hofmeyr | 62507c5 | 2017-07-13 02:03:50 +0200 | [diff] [blame] | 71 | class TestVTYGbproxy(TestVTYBase): |
Jacob Erlbeck | 7553d1c | 2013-10-23 11:24:15 +0200 | [diff] [blame] | 72 | |
| 73 | def vty_command(self): |
| 74 | return ["./src/gprs/osmo-gbproxy", "-c", |
| 75 | "doc/examples/osmo-gbproxy/osmo-gbproxy.cfg"] |
| 76 | |
| 77 | def vty_app(self): |
Pau Espin Pedrol | d7b95e3 | 2018-10-30 17:27:59 +0100 | [diff] [blame] | 78 | return (4246, "./src/gprs/osmo-gbproxy", "OsmoGbProxy", "gbproxy") |
Jacob Erlbeck | 7553d1c | 2013-10-23 11:24:15 +0200 | [diff] [blame] | 79 | |
| 80 | def testVtyTree(self): |
| 81 | self.vty.enable() |
| 82 | self.assertTrue(self.vty.verify('configure terminal', [''])) |
| 83 | self.assertEquals(self.vty.node(), 'config') |
Jacob Erlbeck | a423591 | 2013-10-29 09:30:31 +0100 | [diff] [blame] | 84 | self.checkForEndAndExit() |
Jacob Erlbeck | 7553d1c | 2013-10-23 11:24:15 +0200 | [diff] [blame] | 85 | self.assertTrue(self.vty.verify('ns', [''])) |
| 86 | self.assertEquals(self.vty.node(), 'config-ns') |
| 87 | self.checkForEndAndExit() |
| 88 | self.assertTrue(self.vty.verify('exit', [''])) |
| 89 | self.assertEquals(self.vty.node(), 'config') |
| 90 | self.assertTrue(self.vty.verify('gbproxy', [''])) |
| 91 | self.assertEquals(self.vty.node(), 'config-gbproxy') |
| 92 | self.checkForEndAndExit() |
| 93 | self.assertTrue(self.vty.verify('exit', [''])) |
| 94 | self.assertEquals(self.vty.node(), 'config') |
| 95 | |
| 96 | def testVtyShow(self): |
| 97 | res = self.vty.command("show ns") |
| 98 | self.assert_(res.find('Encapsulation NS-UDP-IP') >= 0) |
| 99 | |
| 100 | res = self.vty.command("show gbproxy stats") |
| 101 | self.assert_(res.find('GBProxy Global Statistics') >= 0) |
| 102 | |
Jacob Erlbeck | 7fee972 | 2013-10-24 12:48:23 +0200 | [diff] [blame] | 103 | def testVtyDeletePeer(self): |
| 104 | self.vty.enable() |
| 105 | self.assertTrue(self.vty.verify('delete-gbproxy-peer 9999 bvci 7777', ['BVC not found'])) |
| 106 | res = self.vty.command("delete-gbproxy-peer 9999 all dry-run") |
| 107 | self.assert_(res.find('Not Deleted 0 BVC') >= 0) |
| 108 | self.assert_(res.find('Not Deleted 0 NS-VC') >= 0) |
| 109 | res = self.vty.command("delete-gbproxy-peer 9999 only-bvc dry-run") |
| 110 | self.assert_(res.find('Not Deleted 0 BVC') >= 0) |
| 111 | self.assert_(res.find('Not Deleted 0 NS-VC') < 0) |
| 112 | res = self.vty.command("delete-gbproxy-peer 9999 only-nsvc dry-run") |
| 113 | self.assert_(res.find('Not Deleted 0 BVC') < 0) |
| 114 | self.assert_(res.find('Not Deleted 0 NS-VC') >= 0) |
| 115 | res = self.vty.command("delete-gbproxy-peer 9999 all") |
| 116 | self.assert_(res.find('Deleted 0 BVC') >= 0) |
| 117 | self.assert_(res.find('Deleted 0 NS-VC') >= 0) |
| 118 | |
Neels Hofmeyr | 62507c5 | 2017-07-13 02:03:50 +0200 | [diff] [blame] | 119 | class TestVTYSGSN(TestVTYBase): |
Jacob Erlbeck | ca1c7aa | 2014-11-04 11:15:01 +0100 | [diff] [blame] | 120 | |
| 121 | def vty_command(self): |
| 122 | return ["./src/gprs/osmo-sgsn", "-c", |
Daniel Willmann | bc5aa6d | 2017-05-11 17:50:04 +0200 | [diff] [blame] | 123 | "doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg"] |
Jacob Erlbeck | ca1c7aa | 2014-11-04 11:15:01 +0100 | [diff] [blame] | 124 | |
| 125 | def vty_app(self): |
| 126 | return (4245, "./src/gprs/osmo-sgsn", "OsmoSGSN", "sgsn") |
| 127 | |
| 128 | def testVtyTree(self): |
| 129 | self.vty.enable() |
| 130 | self.assertTrue(self.vty.verify('configure terminal', [''])) |
| 131 | self.assertEquals(self.vty.node(), 'config') |
| 132 | self.checkForEndAndExit() |
| 133 | self.assertTrue(self.vty.verify('ns', [''])) |
| 134 | self.assertEquals(self.vty.node(), 'config-ns') |
| 135 | self.checkForEndAndExit() |
| 136 | self.assertTrue(self.vty.verify('exit', [''])) |
| 137 | self.assertEquals(self.vty.node(), 'config') |
| 138 | self.assertTrue(self.vty.verify('sgsn', [''])) |
| 139 | self.assertEquals(self.vty.node(), 'config-sgsn') |
| 140 | self.checkForEndAndExit() |
| 141 | self.assertTrue(self.vty.verify('exit', [''])) |
| 142 | self.assertEquals(self.vty.node(), 'config') |
| 143 | |
| 144 | def testVtyShow(self): |
| 145 | res = self.vty.command("show ns") |
| 146 | self.assert_(res.find('Encapsulation NS-UDP-IP') >= 0) |
| 147 | self.assertTrue(self.vty.verify('show bssgp', [''])) |
| 148 | self.assertTrue(self.vty.verify('show bssgp stats', [''])) |
Max | bcb19d4 | 2017-10-20 13:38:45 +0200 | [diff] [blame] | 149 | self.assertTrue(self.vty.verify('show bssgp nsei 123', [''])) |
| 150 | self.assertTrue(self.vty.verify('show bssgp nsei 123 stats', [''])) |
Max | 322e668 | 2017-10-20 13:39:57 +0200 | [diff] [blame] | 151 | self.assertTrue(self.vty.verify('show sgsn', [' GSN: signalling 127.0.0.1, user traffic 127.0.0.1'])) |
Jacob Erlbeck | ca1c7aa | 2014-11-04 11:15:01 +0100 | [diff] [blame] | 152 | self.assertTrue(self.vty.verify('show mm-context all', [''])) |
| 153 | self.assertTrue(self.vty.verify('show mm-context imsi 000001234567', ['No MM context for IMSI 000001234567'])) |
| 154 | self.assertTrue(self.vty.verify('show pdp-context all', [''])) |
| 155 | |
| 156 | res = self.vty.command("show sndcp") |
| 157 | self.assert_(res.find('State of SNDCP Entities') >= 0) |
| 158 | |
| 159 | res = self.vty.command("show llc") |
| 160 | self.assert_(res.find('State of LLC Entities') >= 0) |
| 161 | |
Jacob Erlbeck | d7b7773 | 2014-11-04 10:08:37 +0100 | [diff] [blame] | 162 | def testVtyAuth(self): |
| 163 | self.vty.enable() |
| 164 | self.assertTrue(self.vty.verify('configure terminal', [''])) |
| 165 | self.assertEquals(self.vty.node(), 'config') |
| 166 | self.assertTrue(self.vty.verify('sgsn', [''])) |
| 167 | self.assertEquals(self.vty.node(), 'config-sgsn') |
| 168 | self.assertTrue(self.vty.verify('auth-policy accept-all', [''])) |
| 169 | res = self.vty.command("show running-config") |
| 170 | self.assert_(res.find('auth-policy accept-all') > 0) |
| 171 | self.assertTrue(self.vty.verify('auth-policy acl-only', [''])) |
| 172 | res = self.vty.command("show running-config") |
| 173 | self.assert_(res.find('auth-policy acl-only') > 0) |
| 174 | self.assertTrue(self.vty.verify('auth-policy closed', [''])) |
| 175 | res = self.vty.command("show running-config") |
| 176 | self.assert_(res.find('auth-policy closed') > 0) |
Max | 6f9a6ca | 2016-07-04 11:09:07 +0200 | [diff] [blame] | 177 | self.assertTrue(self.vty.verify('gsup remote-ip 127.0.0.4', [''])) |
| 178 | self.assertTrue(self.vty.verify('gsup remote-port 2222', [''])) |
Jacob Erlbeck | d04f7cc | 2014-11-12 10:18:09 +0100 | [diff] [blame] | 179 | self.assertTrue(self.vty.verify('auth-policy remote', [''])) |
| 180 | res = self.vty.command("show running-config") |
| 181 | self.assert_(res.find('auth-policy remote') > 0) |
Jacob Erlbeck | d7b7773 | 2014-11-04 10:08:37 +0100 | [diff] [blame] | 182 | |
Jacob Erlbeck | c16c350 | 2014-11-11 14:01:48 +0100 | [diff] [blame] | 183 | def testVtySubscriber(self): |
| 184 | self.vty.enable() |
| 185 | res = self.vty.command('show subscriber cache') |
| 186 | self.assert_(res.find('1234567890') < 0) |
Jacob Erlbeck | 90e3ead | 2015-01-19 14:11:46 +0100 | [diff] [blame] | 187 | self.assertTrue(self.vty.verify('update-subscriber imsi 1234567890 create', [''])) |
| 188 | res = self.vty.command('show subscriber cache') |
| 189 | self.assert_(res.find('1234567890') >= 0) |
| 190 | self.assert_(res.find('Authorized: 0') >= 0) |
| 191 | self.assertTrue(self.vty.verify('update-subscriber imsi 1234567890 update-location-result ok', [''])) |
Jacob Erlbeck | c16c350 | 2014-11-11 14:01:48 +0100 | [diff] [blame] | 192 | res = self.vty.command('show subscriber cache') |
| 193 | self.assert_(res.find('1234567890') >= 0) |
| 194 | self.assert_(res.find('Authorized: 1') >= 0) |
Jacob Erlbeck | 3b0d0c0 | 2015-01-27 14:56:40 +0100 | [diff] [blame] | 195 | self.assertTrue(self.vty.verify('update-subscriber imsi 1234567890 cancel update-procedure', [''])) |
Jacob Erlbeck | c16c350 | 2014-11-11 14:01:48 +0100 | [diff] [blame] | 196 | res = self.vty.command('show subscriber cache') |
Jacob Erlbeck | eafb849 | 2015-01-27 12:41:19 +0100 | [diff] [blame] | 197 | self.assert_(res.find('1234567890') >= 0) |
| 198 | self.assertTrue(self.vty.verify('update-subscriber imsi 1234567890 destroy', [''])) |
| 199 | res = self.vty.command('show subscriber cache') |
Jacob Erlbeck | c16c350 | 2014-11-11 14:01:48 +0100 | [diff] [blame] | 200 | self.assert_(res.find('1234567890') < 0) |
| 201 | |
Jacob Erlbeck | 9b3ca64 | 2015-02-03 13:47:53 +0100 | [diff] [blame] | 202 | def testVtyGgsn(self): |
| 203 | self.vty.enable() |
| 204 | self.assertTrue(self.vty.verify('configure terminal', [''])) |
| 205 | self.assertEquals(self.vty.node(), 'config') |
| 206 | self.assertTrue(self.vty.verify('sgsn', [''])) |
| 207 | self.assertEquals(self.vty.node(), 'config-sgsn') |
| 208 | self.assertTrue(self.vty.verify('ggsn 0 remote-ip 127.99.99.99', [''])) |
| 209 | self.assertTrue(self.vty.verify('ggsn 0 gtp-version 1', [''])) |
| 210 | self.assertTrue(self.vty.verify('apn * ggsn 0', [''])) |
| 211 | self.assertTrue(self.vty.verify('apn apn1.test ggsn 0', [''])) |
| 212 | self.assertTrue(self.vty.verify('apn apn1.test ggsn 1', ['% a GGSN with id 1 has not been defined'])) |
| 213 | self.assertTrue(self.vty.verify('apn apn1.test imsi-prefix 123456 ggsn 0', [''])) |
| 214 | self.assertTrue(self.vty.verify('apn apn2.test imsi-prefix 123456 ggsn 0', [''])) |
| 215 | res = self.vty.command("show running-config") |
| 216 | self.assert_(res.find('ggsn 0 remote-ip 127.99.99.99') >= 0) |
| 217 | self.assert_(res.find('ggsn 0 gtp-version 1') >= 0) |
| 218 | self.assert_(res.find('apn * ggsn 0') >= 0) |
| 219 | self.assert_(res.find('apn apn1.test ggsn 0') >= 0) |
| 220 | self.assert_(res.find('apn apn1.test imsi-prefix 123456 ggsn 0') >= 0) |
| 221 | self.assert_(res.find('apn apn2.test imsi-prefix 123456 ggsn 0') >= 0) |
| 222 | |
Holger Hans Peter Freyther | 3739148 | 2015-02-06 16:23:29 +0100 | [diff] [blame] | 223 | def testVtyEasyAPN(self): |
| 224 | self.vty.enable() |
| 225 | self.assertTrue(self.vty.verify('configure terminal', [''])) |
| 226 | self.assertEquals(self.vty.node(), 'config') |
| 227 | self.assertTrue(self.vty.verify('sgsn', [''])) |
| 228 | self.assertEquals(self.vty.node(), 'config-sgsn') |
| 229 | |
| 230 | res = self.vty.command("show running-config") |
| 231 | self.assertEquals(res.find("apn internet"), -1) |
| 232 | |
| 233 | self.assertTrue(self.vty.verify("access-point-name internet.apn", [''])) |
| 234 | res = self.vty.command("show running-config") |
| 235 | self.assert_(res.find("apn internet.apn ggsn 0") >= 0) |
| 236 | |
| 237 | self.assertTrue(self.vty.verify("no access-point-name internet.apn", [''])) |
| 238 | res = self.vty.command("show running-config") |
| 239 | self.assertEquals(res.find("apn internet"), -1) |
| 240 | |
Holger Hans Peter Freyther | 8128387 | 2015-05-06 17:46:08 +0200 | [diff] [blame] | 241 | def testVtyCDR(self): |
| 242 | self.vty.enable() |
| 243 | self.assertTrue(self.vty.verify('configure terminal', [''])) |
| 244 | self.assertEquals(self.vty.node(), 'config') |
| 245 | self.assertTrue(self.vty.verify('sgsn', [''])) |
| 246 | self.assertEquals(self.vty.node(), 'config-sgsn') |
| 247 | |
| 248 | res = self.vty.command("show running-config") |
| 249 | self.assert_(res.find("no cdr filename") > 0) |
| 250 | |
| 251 | self.vty.command("cdr filename bla.cdr") |
| 252 | res = self.vty.command("show running-config") |
| 253 | self.assertEquals(res.find("no cdr filename"), -1) |
| 254 | self.assert_(res.find(" cdr filename bla.cdr") > 0) |
| 255 | |
| 256 | self.vty.command("no cdr filename") |
| 257 | res = self.vty.command("show running-config") |
| 258 | self.assert_(res.find("no cdr filename") > 0) |
| 259 | self.assertEquals(res.find(" cdr filename bla.cdr"), -1) |
| 260 | |
| 261 | res = self.vty.command("show running-config") |
| 262 | self.assert_(res.find(" cdr interval 600") > 0) |
| 263 | |
| 264 | self.vty.command("cdr interval 900") |
| 265 | res = self.vty.command("show running-config") |
| 266 | self.assert_(res.find(" cdr interval 900") > 0) |
| 267 | self.assertEquals(res.find(" cdr interval 600"), -1) |
| 268 | |
Pau Espin Pedrol | 089d2c1 | 2019-08-14 17:45:23 +0200 | [diff] [blame] | 269 | def testVtyTimers(self): |
| 270 | self.vty.enable() |
| 271 | self.assertTrue(self.vty.verify('configure terminal', [''])) |
| 272 | self.assertEquals(self.vty.node(), 'config') |
| 273 | self.assertTrue(self.vty.verify('sgsn', [''])) |
| 274 | self.assertEquals(self.vty.node(), 'config-sgsn') |
| 275 | |
| 276 | for t in [3312, 3322, 3350, 3360, 3370, 3313, 3314, 3316, 3385, 3395, 3397]: |
| 277 | self.assertTrue(self.vty.verify('timer t%d 10' % t, [''])) |
Jacob Erlbeck | 058b1e5 | 2013-08-28 10:16:54 +0200 | [diff] [blame] | 278 | |
Jacob Erlbeck | 7553d1c | 2013-10-23 11:24:15 +0200 | [diff] [blame] | 279 | def add_gbproxy_test(suite, workdir): |
| 280 | if not os.path.isfile(os.path.join(workdir, "src/gprs/osmo-gbproxy")): |
| 281 | print("Skipping the Gb-Proxy test") |
| 282 | return |
| 283 | test = unittest.TestLoader().loadTestsFromTestCase(TestVTYGbproxy) |
| 284 | suite.addTest(test) |
| 285 | |
Jacob Erlbeck | ca1c7aa | 2014-11-04 11:15:01 +0100 | [diff] [blame] | 286 | def add_sgsn_test(suite, workdir): |
| 287 | if not os.path.isfile(os.path.join(workdir, "src/gprs/osmo-sgsn")): |
| 288 | print("Skipping the SGSN test") |
| 289 | return |
| 290 | test = unittest.TestLoader().loadTestsFromTestCase(TestVTYSGSN) |
| 291 | suite.addTest(test) |
| 292 | |
Holger Hans Peter Freyther | 6539752 | 2013-06-24 15:47:34 +0200 | [diff] [blame] | 293 | if __name__ == '__main__': |
| 294 | import argparse |
| 295 | import sys |
| 296 | |
| 297 | workdir = '.' |
| 298 | |
| 299 | parser = argparse.ArgumentParser() |
| 300 | parser.add_argument("-v", "--verbose", dest="verbose", |
| 301 | action="store_true", help="verbose mode") |
| 302 | parser.add_argument("-p", "--pythonconfpath", dest="p", |
| 303 | help="searchpath for config") |
| 304 | parser.add_argument("-w", "--workdir", dest="w", |
| 305 | help="Working directory") |
Neels Hofmeyr | b21619e | 2017-02-28 02:43:29 +0100 | [diff] [blame] | 306 | parser.add_argument("test_name", nargs="*", help="(parts of) test names to run, case-insensitive") |
Holger Hans Peter Freyther | 6539752 | 2013-06-24 15:47:34 +0200 | [diff] [blame] | 307 | args = parser.parse_args() |
| 308 | |
| 309 | verbose_level = 1 |
| 310 | if args.verbose: |
| 311 | verbose_level = 2 |
| 312 | |
| 313 | if args.w: |
| 314 | workdir = args.w |
| 315 | |
| 316 | if args.p: |
| 317 | confpath = args.p |
| 318 | |
| 319 | print "confpath %s, workdir %s" % (confpath, workdir) |
| 320 | os.chdir(workdir) |
| 321 | print "Running tests for specific VTY commands" |
| 322 | suite = unittest.TestSuite() |
Jacob Erlbeck | 7553d1c | 2013-10-23 11:24:15 +0200 | [diff] [blame] | 323 | add_gbproxy_test(suite, workdir) |
Jacob Erlbeck | ca1c7aa | 2014-11-04 11:15:01 +0100 | [diff] [blame] | 324 | add_sgsn_test(suite, workdir) |
Neels Hofmeyr | b21619e | 2017-02-28 02:43:29 +0100 | [diff] [blame] | 325 | |
| 326 | if args.test_name: |
| 327 | osmoutil.pick_tests(suite, *args.test_name) |
| 328 | |
Neels Hofmeyr | 58b99ae | 2016-09-28 23:48:02 +0200 | [diff] [blame] | 329 | res = unittest.TextTestRunner(verbosity=verbose_level, stream=sys.stdout).run(suite) |
Holger Hans Peter Freyther | 6539752 | 2013-06-24 15:47:34 +0200 | [diff] [blame] | 330 | sys.exit(len(res.errors) + len(res.failures)) |
Neels Hofmeyr | 558af7a | 2016-09-26 03:18:32 +0200 | [diff] [blame] | 331 | |
Neels Hofmeyr | b993563 | 2016-09-28 23:28:06 +0200 | [diff] [blame] | 332 | # vim: shiftwidth=4 expandtab nocin ai |