diff options
author | Oliver Smith <osmith@sysmocom.de> | 2019-12-10 13:21:11 +0100 |
---|---|---|
committer | osmith <osmith@sysmocom.de> | 2019-12-12 09:29:19 +0000 |
commit | 6dbdf1454de4f149d1cd257b8e69f6fcf4d9def9 (patch) | |
tree | 98e7ee53a59a2aac0327fc162b701990b1a2cd01 /tests/ctrl_test_runner.py | |
parent | 63b246453be19d06035f73c616406a20b0f899d3 (diff) |
osmoappdesc.py, tests: switch to python 3
Make build and external tests work with python3, so we can drop
the python2 dependency.
This should be merged shortly after osmo-python-tests was migrated to
python3, and the jenkins build slaves were (automatically) updated to
have the new osmo-python-tests installed.
Related: OS#2819
Depends: osmo-python-tests I3ffc3519bf6c22536a49dad7a966188ddad351a7
Change-Id: I53ccde96dd3785098df0f7d693c504c8b8302e90
Diffstat (limited to 'tests/ctrl_test_runner.py')
-rwxr-xr-x | tests/ctrl_test_runner.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py index f652a6729..d24cc0019 100755 --- a/tests/ctrl_test_runner.py +++ b/tests/ctrl_test_runner.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # (C) 2013 by Jacob Erlbeck <jerlbeck@sysmocom.de> # (C) 2014 by Holger Hans Peter Freyther @@ -53,8 +53,8 @@ class TestCtrlBase(unittest.TestCase): try: self.proc = osmoutil.popen_devnull(osmo_ctrl_cmd) except OSError: - print >> sys.stderr, "Current directory: %s" % os.getcwd() - print >> sys.stderr, "Consider setting -b" + print("Current directory: %s" % os.getcwd(), file=sys.stderr) + print("Consider setting -b", file=sys.stderr) time.sleep(2) appstring = self.ctrl_app()[2] @@ -72,7 +72,7 @@ class TestCtrlBase(unittest.TestCase): def connect(self, host, port): if verbose: - print "Connecting to host %s:%i" % (host, port) + print("Connecting to host %s:%i" % (host, port)) retries = 30 while True: @@ -92,7 +92,7 @@ class TestCtrlBase(unittest.TestCase): def send(self, data): if verbose: - print "Sending \"%s\"" %(data) + print("Sending \"%s\"" %(data)) data = Ctrl().add_header(data) return self.sock.send(data) == len(data) @@ -123,7 +123,7 @@ class TestCtrlBase(unittest.TestCase): (head, data) = IPA().split_combined(data) answer = Ctrl().rem_header(head) if verbose: - print "Got message:", answer + print("Got message:", answer) (mtype, id, msg) = answer.split(None, 2) id = int(id) rsp = {'mtype': mtype, 'id': id} @@ -139,7 +139,7 @@ class TestCtrlBase(unittest.TestCase): responses[id] = rsp if verbose: - print "Decoded replies: ", responses + print("Decoded replies: ", responses) return responses @@ -183,9 +183,9 @@ if __name__ == '__main__': if args.p: confpath = args.p - print "confpath %s, workdir %s" % (confpath, workdir) + print("confpath %s, workdir %s" % (confpath, workdir)) os.chdir(workdir) - print "Running tests for specific control commands" + print("Running tests for specific control commands") suite = unittest.TestSuite() suite.addTest(unittest.TestLoader().loadTestsFromTestCase(TestCtrlMSC)) res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) |