All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marian Csontos <mcsontos@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - [WIP] tests: Use python single liner to generate data
Date: Thu, 21 May 2020 13:09:37 +0000 (GMT)	[thread overview]
Message-ID: <20200521130937.32EBC3972C1B@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=02397e337a5d1bb19544be4a1724aa98d1cb0008
Commit:        02397e337a5d1bb19544be4a1724aa98d1cb0008
Parent:        70a45c44e89534b6d5f9adeb04620f43453c67bf
Author:        Marian Csontos <mcsontos@redhat.com>
AuthorDate:    Wed May 6 12:10:50 2020 +0200
Committer:     Marian Csontos <mcsontos@redhat.com>
CommitterDate: Thu May 21 15:05:02 2020 +0200

[WIP] tests: Use python single liner to generate data

---
 test/shell/integrity-dmeventd.sh | 7 ++++---
 test/shell/integrity-large.sh    | 7 ++++---
 test/shell/integrity-misc.sh     | 7 ++++---
 test/shell/integrity.sh          | 7 ++++---
 4 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/test/shell/integrity-dmeventd.sh b/test/shell/integrity-dmeventd.sh
index 58899ca80..665e0e9a2 100644
--- a/test/shell/integrity-dmeventd.sh
+++ b/test/shell/integrity-dmeventd.sh
@@ -22,9 +22,10 @@ mkdir -p $mnt
 
 aux prepare_devs 6 64
 
-for i in `seq 1 16384`; do echo -n "A" >> fileA; done
-for i in `seq 1 16384`; do echo -n "B" >> fileB; done
-for i in `seq 1 16384`; do echo -n "C" >> fileC; done
+PYTHON="$(which python3 python2 python | head -n 1)"
+$PYTHON -c "print 'A'*16384" >> fileA
+$PYTHON -c "print 'B'*16384" >> fileB
+$PYTHON -c "print 'C'*16384" >> fileC
 
 # generate random data
 dd if=/dev/urandom of=randA bs=512K count=2
diff --git a/test/shell/integrity-large.sh b/test/shell/integrity-large.sh
index 0c36e4d54..81fc48ec5 100644
--- a/test/shell/integrity-large.sh
+++ b/test/shell/integrity-large.sh
@@ -25,9 +25,10 @@ mkdir -p $mnt
 # raid1 LV needs to be extended to 512MB to test imeta being exended
 aux prepare_devs 4 600
 
-for i in `seq 1 16384`; do echo -n "A" >> fileA; done
-for i in `seq 1 16384`; do echo -n "B" >> fileB; done
-for i in `seq 1 16384`; do echo -n "C" >> fileC; done
+PYTHON="$(which python3 python2 python | head -n 1)"
+$PYTHON -c "print 'A'*16384" >> fileA
+$PYTHON -c "print 'B'*16384" >> fileB
+$PYTHON -c "print 'C'*16384" >> fileC
 
 # generate random data
 dd if=/dev/urandom of=randA bs=512K count=2
diff --git a/test/shell/integrity-misc.sh b/test/shell/integrity-misc.sh
index 73b0a67d8..0483885ca 100644
--- a/test/shell/integrity-misc.sh
+++ b/test/shell/integrity-misc.sh
@@ -22,9 +22,10 @@ mkdir -p $mnt
 
 aux prepare_devs 5 64
 
-for i in `seq 1 16384`; do echo -n "A" >> fileA; done
-for i in `seq 1 16384`; do echo -n "B" >> fileB; done
-for i in `seq 1 16384`; do echo -n "C" >> fileC; done
+PYTHON="$(which python3 python2 python | head -n 1)"
+$PYTHON -c "print 'A'*16384" >> fileA
+$PYTHON -c "print 'B'*16384" >> fileB
+$PYTHON -c "print 'C'*16384" >> fileC
 
 # generate random data
 dd if=/dev/urandom of=randA bs=512K count=2
diff --git a/test/shell/integrity.sh b/test/shell/integrity.sh
index 7e4f2cb0b..b01920818 100644
--- a/test/shell/integrity.sh
+++ b/test/shell/integrity.sh
@@ -23,9 +23,10 @@ mkdir -p $mnt
 
 aux prepare_devs 5 64
 
-for i in `seq 1 16384`; do echo -n "A" >> fileA; done
-for i in `seq 1 16384`; do echo -n "B" >> fileB; done
-for i in `seq 1 16384`; do echo -n "C" >> fileC; done
+PYTHON="$(which python3 python2 python | head -n 1)"
+$PYTHON -c "print 'A'*16384" >> fileA
+$PYTHON -c "print 'B'*16384" >> fileB
+$PYTHON -c "print 'C'*16384" >> fileC
 
 # generate random data
 dd if=/dev/urandom of=randA bs=512K count=2



                 reply	other threads:[~2020-05-21 13:09 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=20200521130937.32EBC3972C1B@sourceware.org \
    --to=mcsontos@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.