mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
report: make sure control charcters are encoded in xUnit report
Control characters (such as backspace, used in progress reports by mkfs.ext4, for example) can make Python's XML parsers choke, claiming that it is an invalid XML document. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
+6
-5
@@ -27,11 +27,12 @@ REPORT_ENV_LIST="$REPORT_ENV_LIST OVL_WORK"
|
||||
|
||||
encode_xml()
|
||||
{
|
||||
sed -e 's/&/\&/g' \
|
||||
-e 's/>/\>/g' \
|
||||
-e 's/</\</g' \
|
||||
-e "s/'/\'/g" \
|
||||
-e 's/"/\"/g'
|
||||
cat -v | \
|
||||
sed -e 's/&/\&/g' \
|
||||
-e 's/>/\>/g' \
|
||||
-e 's/</\</g' \
|
||||
-e "s/'/\'/g" \
|
||||
-e 's/"/\"/g'
|
||||
}
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user