public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: zkabelac@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2/test/shell lvresize-rounding.sh
Date: Wed, 11 Apr 2012 12:53:00 -0000	[thread overview]
Message-ID: <20120411125346.11194.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-04-11 12:53:46

Modified files:
	test/shell     : lvresize-rounding.sh 

Log message:
	Update test

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/lvresize-rounding.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3

--- LVM2/test/shell/lvresize-rounding.sh	2012/03/16 13:00:06	1.2
+++ LVM2/test/shell/lvresize-rounding.sh	2012/04/11 12:53:46	1.3
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2007-2008 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2007-2012 Red Hat, Inc. All rights reserved.
 #
 # This copyrighted material is made available to anyone wishing to use,
 # modify, copy, or redistribute it subject to the terms and conditions
@@ -11,16 +11,80 @@
 
 . lib/test
 
-aux prepare_vg 2
+aux prepare_pvs 3 22
 
-lvcreate -l 10 -n lv -i2 $vg
+vgcreate -s 32K $vg "$dev1" "$dev2" "$dev3"
 
-lvextend -l +1 $vg/lv 2>&1 | tee log
-grep 'down to stripe' log
-lvresize -l +1 $vg/lv 2>&1 | tee log
-grep 'down to stripe' log
-
-lvreduce -f -l -1 $vg/lv 2>&1 | tee log
-grep 'up to stripe' log
-lvresize -f -l -1 $vg/lv 2>&1 | tee log
-grep 'up to stripe' log
+lvcreate -l4 -i3 -I64 $vg
+
+lvcreate -l8 -i2 -I64 $vg
+
+lvcreate -l16 $vg
+
+lvcreate -l32 -i3 -I64 -n $lv1 $vg
+
+lvresize -l+64 -i3 -I64 $vg/$lv1
+
+lvresize -l+64 -i3 -I128 $vg/$lv1
+
+#lvcreate -l100%FREE -i3 -I64 --alloc anywhere $vg
+
+dmsetup table
+
+vgcfgbackup -f /tmp/vg $vg
+vgremove -f $vg
+
+# 15 extents
+aux prepare_vg 3 22
+
+# Block some extents
+lvcreate -l4 -i3 $vg
+lvcreate -l1 $vg
+
+lvcreate -l100%FREE -n $lv1 -i3 $vg
+check vg_field $vg vg_free_count 2
+lvremove -f $vg/$lv1
+
+lvcreate -l1 -n $lv1 -i3 $vg
+lvextend -l+100%FREE -i3 $vg/$lv1
+check vg_field $vg vg_free_count 2
+
+lvreduce -f -l50%LV $vg/$lv1
+vgremove -f $vg
+
+
+vgcreate -s 4M $vg "$dev1" "$dev2" "$dev3"
+
+# Expect to play with 15 extents
+check vg_field $vg vg_free_count 15
+
+# Should be rounded to 12 extents
+lvcreate -l10 -n lv -i3 $vg
+check vg_field $vg vg_free_count 3
+
+# Should want 16 extents
+not lvextend -l+4 $vg/lv
+
+# Round up to whole free space
+lvextend -l+100%FREE $vg/lv
+check vg_field $vg vg_free_count 0
+
+# Rounds up and should reduce just by 3 extents
+lvreduce -f -l-4 $vg/lv
+check vg_field $vg vg_free_count 3
+
+# Should round up to 15 extents
+lvextend -f -l+1 $vg/lv
+check vg_field $vg vg_free_count 0
+
+lvreduce -f -l-4 $vg/lv
+check vg_field $vg vg_free_count 3
+
+lvextend -l90%VG $vg/lv
+check vg_field $vg vg_free_count 0
+
+lvreduce -f -l-10%LV $vg/lv
+check vg_field $vg vg_free_count 0
+
+lvreduce -f -l-20%LV $vg/lv
+check vg_field $vg vg_free_count 3


             reply	other threads:[~2012-04-11 12:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11 12:53 zkabelac [this message]
2012-04-24 12:17 zkabelac

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=20120411125346.11194.qmail@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).