@@ -251,14 +251,11 @@ module VMUpdateSecurebootCertificatesOnBoot = Generic.MakeStateful (struct
251251 let string_of_input_t (state , mark ) =
252252 Printf. sprintf " (%s, mark=%b)" (string_of_state state) mark
253253
254- let string_of_error (code , args ) =
255- Printf. sprintf " %s(%s)" code (String. concat " , " args)
256-
257254 let string_of_output_t = function
258255 | Ok state ->
259256 Printf. sprintf " Ok %s" (string_of_state state)
260- | Error err ->
261- Printf. sprintf " Error %s" (string_of_error err )
257+ | Error ( code , args ) ->
258+ Printf. sprintf " Error %s(%s) " code ( String. concat " , " args )
262259 end
263260
264261 module State = Test_state. XapiDb
@@ -281,14 +278,19 @@ module VMUpdateSecurebootCertificatesOnBoot = Generic.MakeStateful (struct
281278 let tests =
282279 `QuickAndAutoDocumented
283280 [
281+ (* transitions *)
284282 ((`update_available , true ), Ok `update_on_boot )
285283 ; ((`update_on_boot , false ), Ok `update_available )
284+ (* idempotent: already in desired state *)
285+ ; ((`update_on_boot , true ), Ok `update_on_boot )
286+ ; ((`update_available , false ), Ok `update_available )
287+ (* irrelevant state: raises *)
286288 ; ( (`ok , true )
287289 , Error
288290 ( Api_errors. operation_not_allowed
289291 , [
290292 " Cannot set update_on_boot: VM.secureboot_certificates_state \
291- is not update_available "
293+ is not in a valid state "
292294 ]
293295 )
294296 )
@@ -297,7 +299,7 @@ module VMUpdateSecurebootCertificatesOnBoot = Generic.MakeStateful (struct
297299 ( Api_errors. operation_not_allowed
298300 , [
299301 " Cannot clear update_on_boot: VM.secureboot_certificates_state \
300- is not update_on_boot "
302+ is not in a valid state "
301303 ]
302304 )
303305 )
0 commit comments