Commit 141d1489 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Add test for SPICE parameter list, add missing ones



“_SPICE_ADDITIONAL_PARAMS” is supposed to be the full list of
SPICE-related KVM hypervisor parameters with the exception of
“HV_KVM_SPICE_BIND”. The new test checks if all parameters starting with
“HV_KVM_SPICE_*” are included. Three previously missing parameters are
added to the list.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 07788a0b
......@@ -77,6 +77,9 @@ _SPICE_ADDITIONAL_PARAMS = frozenset([
constants.HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR,
constants.HV_KVM_SPICE_STREAMING_VIDEO_DETECTION,
constants.HV_KVM_SPICE_USE_TLS,
constants.HV_KVM_SPICE_AUDIO_COMPR,
constants.HV_KVM_SPICE_TLS_CIPHERS,
constants.HV_KVM_SPICE_USE_VDAGENT,
])
......
......@@ -258,5 +258,20 @@ class TestVersionChecking(testutils.GanetiTestCase):
self.assertEqual(parse(help_091), ("0.9.1", 0, 9, 1))
class TestSpiceParameterList(unittest.TestCase):
def test(self):
params = \
compat.UniqueFrozenset(getattr(constants, name)
for name in dir(constants)
if name.startswith("HV_KVM_SPICE_"))
# Exclude some parameters
params -= frozenset([
constants.HV_KVM_SPICE_BIND,
])
self.assertEqual(hv_kvm._SPICE_ADDITIONAL_PARAMS, params)
if __name__ == "__main__":
testutils.GanetiTestProgram()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment