Fix OVF tests for Python 3.8
Fix OVF tests for Python 3.8

As of Python 3.8, ElementTree will sort output according to insertion
order[1], leveraging the stable dict sorting available since Python 3.6.
Some of the OVF tests rely on the previous behavior of ElementTree,
which produced stable output by sorting the node attributes. The
function was based off the Python documentation[2].

Add a utility function that will re-order the node attributes so that
the insertion order matches the alphabetical order, producing the same
output for all Python 3 versions. While at it, refactor the tests a bit
to reduce boilerplate code.

[1] https://bugs.python.org/issue34160
[2] https://docs.python.org/3.9/library/xml.etree.elementtree.html

Signed-off-by: Apollon Oikonomopoulos <ed81ed0a45ccd5c8869bda52e38353a6299ee39e@dmesg.gr>

ganeti/ganeti,mbakke/ganeti,ganeti/ganeti,mbakke/ganeti,ganeti/ganeti,mbakke/ganeti