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 integrity-dmeventd
Date: Fri, 18 Sep 2020 15:31:14 +0000 (GMT)	[thread overview]
Message-ID: <20200918153114.992293954452@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9fbcba1c40eb5256f262e3442ade42e53dcb88d0
Commit:        9fbcba1c40eb5256f262e3442ade42e53dcb88d0
Parent:        94484762022329d7c9ff64841d26ba1cfe46409e
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Fri Sep 18 16:56:00 2020 +0200
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Fri Sep 18 17:30:45 2020 +0200

tests: update integrity-dmeventd

Use tee.
Switch to more simple generator with awk
(which doesn't produce long debug trace)
Sync before sleep to provoke raid action.
---
 test/shell/integrity-dmeventd.sh | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/test/shell/integrity-dmeventd.sh b/test/shell/integrity-dmeventd.sh
index a8c41803e..043e93371 100644
--- a/test/shell/integrity-dmeventd.sh
+++ b/test/shell/integrity-dmeventd.sh
@@ -22,10 +22,11 @@ mkdir -p $mnt
 
 aux prepare_devs 6 64
 
-printf "%0.sA" {1..16384} >> fileA
-# instead of long debug 'printf' log use 'sed' and just replace A->B|C
-sed -e 's,A,B,g' fileA > fileB
-sed -e 's,A,C,g' fileA > fileC
+# Use awk instead of anoyingly long log out from printf
+#printf "%0.sA" {1..16384} >> fileA
+awk 'BEGIN { while (z++ < 16384) printf "A" }' > fileA
+awk 'BEGIN { while (z++ < 16384) printf "B" }' > fileB
+awk 'BEGIN { while (z++ < 16384) printf "C" }' > fileC
 
 # generate random data
 dd if=/dev/urandom of=randA bs=512K count=2
@@ -143,10 +144,10 @@ aux disable_dev "$dev2"
 
 # wait for dmeventd to call lvconvert --repair which should
 # replace dev2 with dev4
+sync
 sleep 5
 
-lvs -a -o+devices $vg > out
-cat out
+lvs -a -o+devices $vg | tee out
 not grep "$dev2" out
 grep "$dev4" out
 
@@ -155,8 +156,7 @@ _verify_data_on_mnt
 
 aux enable_dev "$dev2"
 
-lvs -a -o+devices $vg > out
-cat out
+lvs -a -o+devices $vg | tee out
 not grep "$dev2" out
 grep "$dev4" out
 grep "$dev1" out
@@ -185,10 +185,10 @@ aux disable_dev "$dev1"
 
 # wait for dmeventd to call lvconvert --repair which should
 # replace dev1 and dev2 with dev4 and dev5
+sync
 sleep 5
 
-lvs -a -o+devices $vg > out
-cat out
+lvs -a -o+devices $vg | tee out
 not grep "$dev1" out
 not grep "$dev2" out
 grep "$dev4" out
@@ -201,8 +201,7 @@ _verify_data_on_mnt
 aux enable_dev "$dev1"
 aux enable_dev "$dev2"
 
-lvs -a -o+devices $vg > out
-cat out
+lvs -a -o+devices $vg | tee out
 not grep "$dev1" out
 not grep "$dev2" out
 grep "$dev4" out
@@ -233,10 +232,10 @@ aux disable_dev "$dev2"
 
 # wait for dmeventd to call lvconvert --repair which should
 # replace dev2 with dev6
+sync
 sleep 5
 
-lvs -a -o+devices $vg > out
-cat out
+lvs -a -o+devices $vg | tee out
 not grep "$dev2" out
 grep "$dev6" out
 
@@ -245,8 +244,7 @@ _verify_data_on_mnt
 
 aux enable_dev "$dev2"
 
-lvs -a -o+devices $vg > out
-cat out
+lvs -a -o+devices $vg | tee out
 not grep "$dev2" out
 grep "$dev6" out
 
@@ -273,10 +271,10 @@ aux disable_dev "$dev1"
 
 # wait for dmeventd to call lvconvert --repair which should
 # replace dev1 with dev5
+sync
 sleep 5
 
-lvs -a -o+devices $vg > out
-cat out
+lvs -a -o+devices $vg | tee out
 not grep "$dev1" out
 grep "$dev5" out
 
@@ -285,8 +283,7 @@ _verify_data_on_mnt
 
 aux enable_dev "$dev1"
 
-lvs -a -o+devices $vg > out
-cat out
+lvs -a -o+devices $vg | tee out
 not grep "$dev1" out
 grep "$dev5" out
 



                 reply	other threads:[~2020-09-18 15:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200918153114.992293954452@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.