linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: cli-tests: Convert non-raid filesystem to raid
@ 2017-01-29 14:44 Lakshmipathi.G
  2017-03-13 17:47 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Lakshmipathi.G @ 2017-01-29 14:44 UTC (permalink / raw)
  To: linux-btrfs

Simple script to verify non-raid filesystem conversion.

Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in>
---
 tests/cli-tests/005-convert-btrfs-to-raid/test.sh | 32 +++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100755 tests/cli-tests/005-convert-btrfs-to-raid/test.sh

diff --git a/tests/cli-tests/005-convert-btrfs-to-raid/test.sh b/tests/cli-tests/005-convert-btrfs-to-raid/test.sh
new file mode 100755
index 0000000..96772de
--- /dev/null
+++ b/tests/cli-tests/005-convert-btrfs-to-raid/test.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# convert non-raid btrfs to raid
+
+source $TOP/tests/common
+
+check_prereq mkfs.btrfs
+check_prereq btrfs
+
+setup_root_helper
+prepare_test_dev 1g
+run_check truncate -s1g img
+
+run_check $TOP/mkfs.btrfs -f $IMAGE
+run_check_mount_test_dev
+
+loopdev=$(run_check_stdout $SUDO_HELPER losetup --partscan --find --show img)
+
+run_check $SUDO_HELPER $TOP/btrfs device add $loopdev $TEST_MNT
+run_check $SUDO_HELPER $TOP/btrfs balance start -dconvert=raid1 -mconvert=raid1 $TEST_MNT
+
+run_check_stdout $SUDO_HELPER $TOP/btrfs filesystem show $loopdev | grep "Total devices 2" -q
+if [ $? -ne 0 ]; then
+	run_check $SUDO_HELPER losetup -d $loopdev
+	rm -f img
+        _fail "Conversion from non-raid filesystem to raid failed."
+fi
+run_check_umount_test_dev
+
+# cleanup
+run_check $SUDO_HELPER losetup -d $loopdev
+rm -f img
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs-progs: cli-tests: Convert non-raid filesystem to raid
  2017-01-29 14:44 [PATCH] btrfs-progs: cli-tests: Convert non-raid filesystem to raid Lakshmipathi.G
@ 2017-03-13 17:47 ` David Sterba
  2017-04-15 11:16   ` Lakshmipathi.G
  0 siblings, 1 reply; 3+ messages in thread
From: David Sterba @ 2017-03-13 17:47 UTC (permalink / raw)
  To: Lakshmipathi.G; +Cc: linux-btrfs

On Sun, Jan 29, 2017 at 08:14:55PM +0530, Lakshmipathi.G wrote:
> Simple script to verify non-raid filesystem conversion.

The cli (command line interface) tests are supposed to cover the common
usecases from the point of option combinations etc, not really verifying
the result. It would be good if you add more than just one simple test,
especially for the balance filters. Adding the helpers to prepare the
filesystem (number of devices, raid profiles) would be a good start.
Some code for that is in the mkfs tests, but this belongs to the common
scripts so we could easily use that.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs-progs: cli-tests: Convert non-raid filesystem to raid
  2017-03-13 17:47 ` David Sterba
@ 2017-04-15 11:16   ` Lakshmipathi.G
  0 siblings, 0 replies; 3+ messages in thread
From: Lakshmipathi.G @ 2017-04-15 11:16 UTC (permalink / raw)
  To: dsterba, linux-btrfs

On Mon, Mar 13, 2017 at 06:47:50PM +0100, David Sterba wrote:
> On Sun, Jan 29, 2017 at 08:14:55PM +0530, Lakshmipathi.G wrote:
> > Simple script to verify non-raid filesystem conversion.
> 
> The cli (command line interface) tests are supposed to cover the common
> usecases from the point of option combinations etc, not really verifying
> the result. It would be good if you add more than just one simple test,
> especially for the balance filters. Adding the helpers to prepare the
> filesystem (number of devices, raid profiles) would be a good start.
> Some code for that is in the mkfs tests, but this belongs to the common
> scripts so we could easily use that.

Ok. I'll try to add helpers to common. So that option like this can
be re-used easily.

Cheers.
Lakshmipathi.G

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-15 11:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-29 14:44 [PATCH] btrfs-progs: cli-tests: Convert non-raid filesystem to raid Lakshmipathi.G
2017-03-13 17:47 ` David Sterba
2017-04-15 11:16   ` Lakshmipathi.G

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).