aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-12-15 10:16:35 -0800
committerOle Trøan <otroan@employees.org>2018-12-20 12:44:26 +0000
commit852f5ef9cf8010a94beeea8a73f308576e442e46 (patch)
tree3ca450d35210614ec400a6610cf9f84b34a46ac9 /test
parentdefde0f87067eb473660794cbd4a2da69fdd191d (diff)
VPP-1508 python3 tests: raw_input
'raw_input' does not exist in python3. Change-Id: I95d916db2834fab83e5e791f35103a4513e610b8 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test')
-rw-r--r--test/framework.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/framework.py b/test/framework.py
index e3cf68d4aa5..aec4a8ebbdf 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -40,6 +40,12 @@ if os.name == 'posix' and sys.version_info[0] < 3:
else:
import subprocess
+# Python2/3 compatible
+try:
+ input = raw_input
+except NameError:
+ pass
+
PASS = 0
FAIL = 1
ERROR = 2
@@ -347,7 +353,7 @@ class VppTestCase(unittest.TestCase):
print("Now is the time to attach a gdb by running the above "
"command and set up breakpoints etc.")
print(single_line_delim)
- raw_input("Press ENTER to continue running the testcase...")
+ input("Press ENTER to continue running the testcase...")
@classmethod
def run_vpp(cls):
@@ -487,8 +493,8 @@ class VppTestCase(unittest.TestCase):
print(double_line_delim)
print("VPP or GDB server is still running")
print(single_line_delim)
- raw_input("When done debugging, press ENTER to kill the "
- "process and finish running the testcase...")
+ input("When done debugging, press ENTER to kill the "
+ "process and finish running the testcase...")
# first signal that we want to stop the pump thread, then wake it up
if hasattr(cls, 'pump_thread_stop_flag'):