diff options
author | Russell Bryant <russell@ovn.org> | 2015-12-17 12:22:31 -0500 |
---|---|---|
committer | Russell Bryant <russell@ovn.org> | 2016-02-22 15:17:23 -0500 |
commit | 64eb96a9af0917a4c7b8e0441d2e49404fd247d5 (patch) | |
tree | 1244e17e726d29c5b37624dbb660becc5fd15fb1 /tests/unixctl-py.at | |
parent | e8fed7d01ca6fb6c7e96faf2b831fcfa4552cb4a (diff) | |
download | openvswitch-64eb96a9af0917a4c7b8e0441d2e49404fd247d5.tar.gz |
tests: Deal with Python output differences.
This test checks the output based on Python's string representation of
an array of two unicode strings. These strings have a "u" prefix in
Python 2, but not Python 3. In Python 3, all strings are unicode.
Use sed on the output to strip the "u" from Python 2 output when
checking for the expected result.
Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'tests/unixctl-py.at')
-rw-r--r-- | tests/unixctl-py.at | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unixctl-py.at b/tests/unixctl-py.at index 4838d2db5..3a561632a 100644 --- a/tests/unixctl-py.at +++ b/tests/unixctl-py.at @@ -115,15 +115,15 @@ AT_CHECK([APPCTL -t test-unixctl.py version], [0], [expout]) AT_CHECK([PYAPPCTL -t test-unixctl.py version], [0], [expout]) AT_CHECK([APPCTL -t test-unixctl.py echo robot ninja], [0], [stdout]) -AT_CHECK([cat stdout], [0], [dnl -[[u'robot', u'ninja']] +AT_CHECK([cat stdout | sed -e "s/u'/'/g"], [0], [dnl +[['robot', 'ninja']] ]) mv stdout expout AT_CHECK([PYAPPCTL -t test-unixctl.py echo robot ninja], [0], [expout]) AT_CHECK([APPCTL -t test-unixctl.py echo_error robot ninja], [2], [], [stderr]) -AT_CHECK([cat stderr], [0], [dnl -[[u'robot', u'ninja']] +AT_CHECK([cat stderr | sed -e "s/u'/'/g"], [0], [dnl +[['robot', 'ninja']] ovs-appctl: test-unixctl.py: server returned an error ]) sed 's/ovs-appctl/appctl.py/' stderr > experr |