mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Sascha Hauer" <s.hauer@pengutronix.de>
To: "Tobias Waldekranz" <tobias@waldekranz.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH remotes/origin/next 5/5] test: py: lvm: Add basic LV activation test
Date: Wed, 23 Sep 2026 08:04:13 +0000	[thread overview]
Message-ID: <fe0def8b-1c40-471b-92c3-e0d538ae2a29@pengutronix.de> (raw)
In-Reply-To: <20260917074202.3851071-6-tobias@waldekranz.com>

Hi Tobias,

Only some nitpicking inside. Otherwise looks fine.

On 2026-09-17 07:40, Tobias Waldekranz wrote:
> diff --git a/scripts/lvm-pvs.guestfish b/scripts/lvm-pvs.guestfish
> new file mode 100755
> index 0000000000..c8d31385f3
> --- /dev/null
> +++ b/scripts/lvm-pvs.guestfish
> @@ -0,0 +1,53 @@
> +#!/usr/bin/guestfish -f
> +# SPDX-License-Identifier: GPL-2.0-only
> +#
> +# Create a single disk image that holds two LVM PVs. This is used by
> +# the LVM labgrid tests.
> +
> +alloc lvm-pvs.disk 8M
> +launch
> +
> +part-init /dev/sda gpt
> +part-add /dev/sda p 34 8191
> +part-add /dev/sda p 8192 -34

You could use part-set-name to avoid

  WARNING: pvs: Failed to create link from pvs.primary to pvs.1

> +
> +# Keep sizes reasonably small
> +debug sh "lvm pvcreate --metadatasize 4k /dev/sda1"
> +debug sh "lvm pvcreate --metadatasize 4k --pvmetadatacopies 2 /dev/sda2"
> +debug sh "lvm vgcreate -s 4k testvg /dev/sda1 /dev/sda2"
> +
> +# Create an LV with three segments that span both PVs
> +debug sh "lvm lvcreate -y -n testlv -l 8 testvg /dev/sda1:8-15"
> +debug sh "lvm lvextend -l +8 testvg/testlv /dev/sda2:0-7"
> +debug sh "lvm lvextend -l +8 testvg/testlv /dev/sda1:0-7"
> +
> +debug sh "lvm lvs -o lv_name,seg_le_ranges --segments testvg"
> +
> +mkfs vfat /dev/testvg/testlv
> +mount /dev/testvg/testlv /
> +
> +# Generate a test file that:
> +# 1. Is big enough to be spread over all three segments
> +# 2. Contains data that is sensitvie to reordering

s/sensitvie/sensitive/

> +# 3. Compresses well, since we're checking it in
> +debug sh "printf \'0%*s0\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'1%*s1\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'2%*s2\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'3%*s3\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'4%*s4\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'5%*s5\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'6%*s6\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'7%*s7\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'8%*s8\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'9%*s9\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'a%*sa\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'b%*sb\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'c%*sc\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'d%*sd\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'e%*se\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'f%*sf\' 4094 >>/sysroot/bigfile"
> +debug sh "printf \'g%*sg\' 4094 >>/sysroot/bigfile"
> +debug sh "md5sum </sysroot/bigfile >/sysroot/bigfile.md5sum"
> +
> +umount /
> +
> diff --git a/test/py/test_lvm.py b/test/py/test_lvm.py
> new file mode 100644
> index 0000000000..c148571780
> --- /dev/null
> +++ b/test/py/test_lvm.py
> @@ -0,0 +1,76 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +import hashlib

hashlib seems unused.

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




      reply	other threads:[~2026-09-23  8:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17  7:40 [PATCH remotes/origin/next 0/5] dm: lvm: Initial Logical Volume Management support Tobias Waldekranz
2026-09-17  7:40 ` [PATCH remotes/origin/next 1/5] " Tobias Waldekranz
2026-09-17  7:40 ` [PATCH remotes/origin/next 2/5] dm: lvm: Add fuzz testers for metadata parser and binary headers Tobias Waldekranz
2026-09-17  7:40 ` [PATCH remotes/origin/next 3/5] test: self: lvm: Add tests " Tobias Waldekranz
2026-09-17  7:40 ` [PATCH remotes/origin/next 4/5] commands: lvm: inspect VGs, activate LVs Tobias Waldekranz
2026-09-17  7:40 ` [PATCH remotes/origin/next 5/5] test: py: lvm: Add basic LV activation test Tobias Waldekranz
2026-09-23  8:04   ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe0def8b-1c40-471b-92c3-e0d538ae2a29@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=tobias@waldekranz.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox