tests: Fix the two Python XFAIL tests.
authorBen Pfaff <blp@nicira.com>
Fri, 13 May 2011 21:20:10 +0000 (14:20 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 28 Jul 2011 18:21:59 +0000 (11:21 -0700)
commitff2abab9c550b90f08b3ddb7487edded0c7903e6
tree6c469c702a2c510846eeb7393d57dc4779774da1
parentf3399cd5be32fb67364959d75b973a4c23f2b19a
tests: Fix the two Python XFAIL tests.

OVS has two Python tests that have always failed, for reasons not
understood, since they were added to the tree.  This commit fixes them.

One problem was that Python was assuming that stdout was encoded in ASCII.
Apparently the only way to "fix" this at runtime is to set PYTHONIOENCODING
to utf_8 in the environment, so this change does that.

Second, it appears that Python really doesn't like to print invalid UTF-8,
so this avoids doing that in python/ovs/json.py, instead just printing
the hexadecimal values of the invalid bytes.  For consistency, it makes
the same change to the C version.

Third, the C version of test-ovsdb doesn't check UTF-8 for consistency, it
just sends it blindly to the OVSDB server, but Python does check it and so
it bails out earlier.  This commit changes the Python version of the
"no invalid UTF-8 sequences in strings" to allow for the slight difference
in output that occurs for that reason.

Finally, test-ovsdb.py needs to convert error messages to Unicode
explicitly before printing them in the "parse-atoms" function.  I don't
really understand why, but now it works.
lib/ovsdb-data.c
python/ovs/json.py
tests/atlocal.in
tests/ovsdb-data.at
tests/test-ovsdb.py