Reviewed-by: Hyman Huang <[email protected]>

Thks, Yong

On Wed, Sep 23, 2026 at 4:23 AM Marc-André Lureau
<[email protected]> wrote:
>
> Signed-off-by: Marc-André Lureau <[email protected]>
> ---
>  tests/qemu-iotests/tests/luks-detached-header | 49 
> +++++++--------------------
>  1 file changed, 13 insertions(+), 36 deletions(-)
>
> diff --git a/tests/qemu-iotests/tests/luks-detached-header 
> b/tests/qemu-iotests/tests/luks-detached-header
> index 58eb3c2cc484..fbf812902832 100755
> --- a/tests/qemu-iotests/tests/luks-detached-header
> +++ b/tests/qemu-iotests/tests/luks-detached-header
> @@ -266,52 +266,29 @@ class TestDetachedLUKSHeader(QMPTestCase):
>          # (Pattern verification will be checked by tearDown())
>
>          # Normal LUKS disk
> -        result = self.vm.qmp_log(
> -            "human-monitor-command",
> -            command_line='qemu-io luks-1-format "write -P 40 0 64k"',
> -        )
> -        self.assert_qmp(result, "return", "")
> +        self.vm.qmp_qemu_io("luks-1-format", "write -P 40 0 64k",
> +                            use_log=True)
>
> -        result = self.vm.qmp_log(
> -            "human-monitor-command",
> -            command_line='qemu-io luks-1-format "read -P 40 0 64k"',
> -        )
> -        self.assert_qmp(result, "return", "")
> +        self.vm.qmp_qemu_io("luks-1-format", "read -P 40 0 64k",
> +                            use_log=True)
>
>          # Detached LUKS header with raw payload
> -        cmd = 'qemu-io luks-2-payload-raw-format "write -P 41 0 64k"'
> -        result = self.vm.qmp(
> -            "human-monitor-command",
> -            command_line=cmd
> -        )
> -        self.assert_qmp(result, "return", "")
> +        self.vm.qmp_qemu_io("luks-2-payload-raw-format",
> +                            "write -P 41 0 64k")
>
> -        cmd = 'qemu-io luks-2-payload-raw-format "read -P 41 0 64k"'
> -        result = self.vm.qmp(
> -            "human-monitor-command",
> -            command_line=cmd
> -        )
> -        self.assert_qmp(result, "return", "")
> +        self.vm.qmp_qemu_io("luks-2-payload-raw-format",
> +                            "read -P 41 0 64k")
>
>          # Detached LUKS header with qcow2 payload
> -        cmd = 'qemu-io luks-3-payload-qcow2-format "write -P 42 0 64k"'
> -        result = self.vm.qmp(
> -            "human-monitor-command",
> -            command_line=cmd
> -        )
> -        self.assert_qmp(result, "return", "")
> +        self.vm.qmp_qemu_io("luks-3-payload-qcow2-format",
> +                            "write -P 42 0 64k")
>
> -        cmd = 'qemu-io luks-3-payload-qcow2-format "read -P 42 0 64k"'
> -        result = self.vm.qmp(
> -            "human-monitor-command",
> -            command_line=cmd
> -        )
> -        self.assert_qmp(result, "return", "")
> +        self.vm.qmp_qemu_io("luks-3-payload-qcow2-format",
> +                            "read -P 42 0 64k")
>
>          self.vm.shutdown()
>
>
>  if __name__ == "__main__":
>      # Test image creation and I/O
> -    iotests.main(supported_fmts=["luks"], supported_protocols=["file"],
> -                 require_hmp=True)
> +    iotests.main(supported_fmts=["luks"], supported_protocols=["file"])
>
> --
> 2.56.0.rc0.29.g47ce80527c56
>

Reply via email to