[Qemu-devel] [PATCH v2 2/2] iotests: add LUKS payload overhead to 178 qemu-img measure test

Stefan Hajnoczi posted 2 patches 6 years, 9 months ago
Maintainers: Max Reitz <mreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>
There is a newer version of this series
[Qemu-devel] [PATCH v2 2/2] iotests: add LUKS payload overhead to 178 qemu-img measure test
Posted by Stefan Hajnoczi 6 years, 9 months ago
The previous patch includes the LUKS payload overhead into the qemu-img
measure calculation for qcow2.  Update qemu-iotests 178 to exercise this
new code path.

Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tests/qemu-iotests/178           |  8 ++++++++
 tests/qemu-iotests/178.out.qcow2 | 24 ++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/tests/qemu-iotests/178 b/tests/qemu-iotests/178
index 3f4b4a4564..23eb017ea1 100755
--- a/tests/qemu-iotests/178
+++ b/tests/qemu-iotests/178
@@ -142,6 +142,14 @@ for ofmt in human json; do
             # The backing file doesn't need to exist :)
             $QEMU_IMG measure --output=$ofmt -o backing_file=x \
                               -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
+
+            echo
+            echo "== $fmt input image and LUKS encryption =="
+            echo
+            $QEMU_IMG measure --output=$ofmt \
+                              --object secret,id=sec0,data=base \
+                              -o encrypt.format=luks,encrypt.key-secret=sec0 \
+                              -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
         fi
 
         echo
diff --git a/tests/qemu-iotests/178.out.qcow2 b/tests/qemu-iotests/178.out.qcow2
index d42d4a4597..55a8dc926f 100644
--- a/tests/qemu-iotests/178.out.qcow2
+++ b/tests/qemu-iotests/178.out.qcow2
@@ -68,6 +68,11 @@ converted image file size in bytes: 458752
 required size: 1074135040
 fully allocated size: 1074135040
 
+== qcow2 input image and LUKS encryption ==
+
+required size: 2686976
+fully allocated size: 1076232192
+
 == qcow2 input image and preallocation (human) ==
 
 required size: 1074135040
@@ -114,6 +119,11 @@ converted image file size in bytes: 524288
 required size: 1074135040
 fully allocated size: 1074135040
 
+== raw input image and LUKS encryption ==
+
+required size: 2686976
+fully allocated size: 1076232192
+
 == raw input image and preallocation (human) ==
 
 required size: 1074135040
@@ -205,6 +215,13 @@ converted image file size in bytes: 458752
     "fully-allocated": 1074135040
 }
 
+== qcow2 input image and LUKS encryption ==
+
+{
+    "required": 2686976,
+    "fully-allocated": 1076232192
+}
+
 == qcow2 input image and preallocation (json) ==
 
 {
@@ -263,6 +280,13 @@ converted image file size in bytes: 524288
     "fully-allocated": 1074135040
 }
 
+== raw input image and LUKS encryption ==
+
+{
+    "required": 2686976,
+    "fully-allocated": 1076232192
+}
+
 == raw input image and preallocation (json) ==
 
 {
-- 
2.20.1


Re: [Qemu-devel] [PATCH v2 2/2] iotests: add LUKS payload overhead to 178 qemu-img measure test
Posted by Max Reitz 6 years, 8 months ago
On 23.01.19 11:33, Stefan Hajnoczi wrote:
> The previous patch includes the LUKS payload overhead into the qemu-img
> measure calculation for qcow2.  Update qemu-iotests 178 to exercise this
> new code path.
> 
> Reviewed-by: Max Reitz <mreitz@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  tests/qemu-iotests/178           |  8 ++++++++
>  tests/qemu-iotests/178.out.qcow2 | 24 ++++++++++++++++++++++++
>  2 files changed, 32 insertions(+)
> 
> diff --git a/tests/qemu-iotests/178 b/tests/qemu-iotests/178
> index 3f4b4a4564..23eb017ea1 100755
> --- a/tests/qemu-iotests/178
> +++ b/tests/qemu-iotests/178
> @@ -142,6 +142,14 @@ for ofmt in human json; do
>              # The backing file doesn't need to exist :)
>              $QEMU_IMG measure --output=$ofmt -o backing_file=x \
>                                -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
> +
> +            echo
> +            echo "== $fmt input image and LUKS encryption =="
> +            echo
> +            $QEMU_IMG measure --output=$ofmt \
> +                              --object secret,id=sec0,data=base \
> +                              -o encrypt.format=luks,encrypt.key-secret=sec0 \
> +                              -f "$fmt" -O "$IMGFMT" "$TEST_IMG"

With the change in patch 1, it would be possible to set
encrypt.iter-time=10, for example (default for the LUKS tests).  For me,
that decreases the test's runtime from 24 to 15 seconds.

Pretty please? :-)

Max

>          fi
>  
>          echo

Re: [Qemu-devel] [PATCH v2 2/2] iotests: add LUKS payload overhead to 178 qemu-img measure test
Posted by Stefan Hajnoczi 6 years, 8 months ago
On Fri, Feb 15, 2019 at 08:14:59PM +0100, Max Reitz wrote:
> On 23.01.19 11:33, Stefan Hajnoczi wrote:
> > diff --git a/tests/qemu-iotests/178 b/tests/qemu-iotests/178
> > index 3f4b4a4564..23eb017ea1 100755
> > --- a/tests/qemu-iotests/178
> > +++ b/tests/qemu-iotests/178
> > @@ -142,6 +142,14 @@ for ofmt in human json; do
> >              # The backing file doesn't need to exist :)
> >              $QEMU_IMG measure --output=$ofmt -o backing_file=x \
> >                                -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
> > +
> > +            echo
> > +            echo "== $fmt input image and LUKS encryption =="
> > +            echo
> > +            $QEMU_IMG measure --output=$ofmt \
> > +                              --object secret,id=sec0,data=base \
> > +                              -o encrypt.format=luks,encrypt.key-secret=sec0 \
> > +                              -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
> 
> With the change in patch 1, it would be possible to set
> encrypt.iter-time=10, for example (default for the LUKS tests).  For me,
> that decreases the test's runtime from 24 to 15 seconds.
> 
> Pretty please? :-)

Will fix in v3.

Stefan