All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - tests: update test
Date: Tue, 22 Sep 2020 21:46:51 +0000 (GMT)	[thread overview]
Message-ID: <20200922214651.96FE1385780B@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=adead83dc2763a12f2f0e711793b5fd8c446b3f9
Commit:        adead83dc2763a12f2f0e711793b5fd8c446b3f9
Parent:        cbed63eeb9d06958a42721dcd2093ff80582f47d
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Tue Sep 22 23:26:28 2020 +0200
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Sep 22 23:28:43 2020 +0200

tests: update test

Shorten running time of the test.
Fix some issues in invoked resizing script to it returns
correct return code and dmeventd can be a little bit quicker
in this test.
---
 test/shell/vdo-autoumount-dmeventd.sh | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/test/shell/vdo-autoumount-dmeventd.sh b/test/shell/vdo-autoumount-dmeventd.sh
index 0d0747a32..e0449ffe8 100644
--- a/test/shell/vdo-autoumount-dmeventd.sh
+++ b/test/shell/vdo-autoumount-dmeventd.sh
@@ -42,19 +42,21 @@ export MKE2FS_CONFIG="$TESTDIR/lib/mke2fs.conf"
 aux have_vdo 6 2 0 || skip
 
 # Simple implementation of umount when lvextend fails
+# Script enforces failin exit, so dmeventd tries several times
+# repeatedly to invoke this for given percentage
 cat <<- EOF >testcmd.sh
 #!/bin/sh
 
 echo "VDO Pool: \$DMEVENTD_VDO_POOL"
 
 "$TESTDIR/lib/lvextend" --use-policies \$1 || {
-	umount "$mntdir"  || true
-	return 0
+	umount "$mntdir" && exit 0
+	touch $PWD/TRIED_UMOUNT
 }
 test "\$($TESTDIR/lib/lvs -o selected -S "data_percent>=$PERCENT" --noheadings \$1)" -eq 0 || {
-	umount "$mntdir"  || true
-	return 0
+	echo "Percentage still above $PERCENT"
 }
+exit 1
 EOF
 chmod +x testcmd.sh
 # Show prepared script
@@ -63,7 +65,7 @@ cat testcmd.sh
 # Use autoextend percent 0 - so extension fails and triggers umount...
 aux lvmconf "activation/vdo_pool_autoextend_percent = 0" \
 	    "activation/vdo_pool_autoextend_threshold = $PERCENT" \
-	    "dmeventd/vdo_command = \"/$PWD/testcmd.sh\"" \
+	    "dmeventd/vdo_command = \"$PWD/testcmd.sh\"" \
             "allocation/vdo_slab_size_mb = 128"
 
 aux prepare_dmeventd
@@ -92,7 +94,7 @@ PID_SLEEP=$!
 
 lvs -a $vg
 # Fill pool above 95%  (to cause 'forced lazy umount)
-dd if=/dev/urandom of="$mntdir/file$$" bs=256K count=200 conv=fdatasync
+dd if=/dev/urandom of="$mntdir/file$$" bs=256K count=200 oflag=direct
 
 lvs -a $vg
 
@@ -100,9 +102,11 @@ lvs -a $vg
 # In the worst case check only happens every 10 seconds :(
 for i in $(seq 1 12) ; do
 	is_lv_opened_ "$vg/$lv1" || break
+	test ! -f "TRIED_UMOUNT" || continue  # finish loop quickly
 	sleep 1
 done
 
+rm -f "TRIED_UMOUNT"
 test "$i" -eq 12 || die "$mntdir should NOT have been unmounted by dmeventd!"
 
 lvs -a $vg
@@ -119,3 +123,5 @@ for i in $(seq 1 12) ; do
 	test "$i" -lt 12 || die "$mntdir should have been unmounted by dmeventd!"
 	sleep 1
 done
+
+# vgremove is managed through cleanup_mounted_and_teardown()



             reply	other threads:[~2020-09-22 21:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 21:46 Zdenek Kabelac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-12-23 12:16 master - tests: update test Zdenek Kabelac
2016-02-12  9:22 Zdenek Kabelac
2014-02-04 13:51 Zdenek Kabelac
2013-06-04 13:58 Zdenek Kabelac

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=20200922214651.96FE1385780B@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.