mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-10 05:18:36 +03:00
Clean-up and wording changes; add copyright notices.
* test/Makefile.in (srcdir, top_srcdir): Use @srcdir@, etc. (top_builddir, abs_srcdir, abs_top_builddir, abs_top_srcdir): Likewise. (so_name): Remove definition. (.bin-dir-stamp): No longer create symlink in $(DMDIR) tree. Prompted by suggestions from Alasdair Kergon. * test/t1000-lvcreate-usage.sh (cleanup_): Redirect to a file, rather than to /dev/null. Change wording of some test titles. Suggestions from Alasdair Kergon. * test/Makefile.in: Add a copyright notice. * test/lvm-utils.sh: Likewise. * test/mkdtemp: Likewise. * test/t0000-basic.sh: Likewise. * test/t1000-lvcreate-usage.sh: Likewise. * test/t3000-lvcreate-pvtags.sh: Likewise. * test/t4000-pv-range-overflow.sh: Likewise. * test/test-lib.sh: Likewise. Author: Jim Meyering <jim@meyering.net>
This commit is contained in:
parent
fc455df92c
commit
8d92a5cc14
@ -1,3 +1,15 @@
|
||||
# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This file is part of LVM2.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing to use,
|
||||
# modify, copy, or redistribute it subject to the terms and conditions
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#TEST_OPTS=--verbose --debug
|
||||
SHELL_PATH ?= $(SHELL)
|
||||
TAR ?= $(TAR)
|
||||
@ -5,14 +17,12 @@ RM ?= rm -f
|
||||
|
||||
subdir := $(shell pwd|sed 's,.*/,,')
|
||||
|
||||
srcdir = .
|
||||
top_srcdir = ..
|
||||
top_builddir = ..
|
||||
abs_srcdir := $(shell cd $(srcdir) && pwd)
|
||||
abs_top_builddir := $(shell cd $(top_srcdir) && pwd)
|
||||
abs_top_srcdir = $(abs_top_builddir)
|
||||
# FIXME: for now, we assume top_srcdir == top_builddir,
|
||||
# but to permit non-srcdir builds, that will change.
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
|
||||
all: init.sh
|
||||
init.sh: Makefile.in .bin-dir-stamp
|
||||
@ -43,13 +53,7 @@ $(T): init.sh
|
||||
@echo "*** $@ ***"; '$(SHELL_PATH_SQ)' \
|
||||
$(TESTS_ENVIRONMENT) $@ $(GIT_TEST_OPTS)
|
||||
|
||||
so_name = @DMDIR@/lib/ioctl/libdevmapper.so.1.02
|
||||
|
||||
# Having to create this symlink is an ugly kludge,
|
||||
# and a major argument for including device-mapper in lvm.
|
||||
.bin-dir-stamp: lvm-wrapper
|
||||
test -n "@DMDIR@" \
|
||||
&& ln -fs libdevmapper.so $(so_name)
|
||||
rm -rf bin
|
||||
mkdir bin
|
||||
for i in lvm $$(cat $(top_srcdir)/tools/.commands); do \
|
||||
@ -59,12 +63,12 @@ so_name = @DMDIR@/lib/ioctl/libdevmapper.so.1.02
|
||||
|
||||
lvm-wrapper: Makefile
|
||||
rm -f $@-t $@
|
||||
echo '#!/bin/sh' >> $@-t
|
||||
echo '#!/bin/sh' > $@-t
|
||||
test -n "@DMDIR@" \
|
||||
&& echo 'export LD_LIBRARY_PATH="@DMDIR@/lib/ioctl"' >> $@-t
|
||||
echo 'cmd=$$(echo ./$$0|sed "s,.*/,,")' >> $@-t
|
||||
echo 'test "$$cmd" = lvm &&' >> $@-t
|
||||
echo 'exec "$(abs_top_builddir)/tools/lvm" "$$@"' >> $@-t
|
||||
&& echo 'export LD_LIBRARY_PATH="@DMDIR@/lib/ioctl"' >> $@-t
|
||||
echo 'cmd=$$(echo ./$$0|sed "s,.*/,,")' >> $@-t
|
||||
echo 'test "$$cmd" = lvm &&' >> $@-t
|
||||
echo 'exec "$(abs_top_builddir)/tools/lvm" "$$@"' >> $@-t
|
||||
echo 'exec "$(abs_top_builddir)/tools/lvm" "$$cmd" "$$@"' >> $@-t
|
||||
chmod a-w,a+x $@-t
|
||||
mv $@-t $@
|
||||
|
@ -1,12 +1,21 @@
|
||||
# Put lvm-related utilities here.
|
||||
# This file is sourced from test-lib.sh.
|
||||
|
||||
# Copyright (C) 2007 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
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
export LVM_SUPPRESS_FD_WARNINGS=1
|
||||
|
||||
ME=$(basename "$0")
|
||||
warn() { echo >&2 "$ME: $@"; }
|
||||
|
||||
|
||||
unsafe_losetup_()
|
||||
{
|
||||
f=$1
|
||||
|
13
test/mkdtemp
13
test/mkdtemp
@ -1,5 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Create a temporary directory, sort of like mktemp -d does.
|
||||
|
||||
# Copyright (C) 2007 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
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
# Written by Jim Meyering.
|
||||
|
||||
# Usage: mkdtemp /tmp phoey.XXXXXXXXXX
|
||||
|
||||
# First, try to use the mktemp program.
|
||||
|
@ -1,4 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2007 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
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
test_description='Basics: see if tools are built, etc.'
|
||||
|
||||
|
@ -1,4 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2007 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
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
test_description='Exercise some lvcreate diagnostics'
|
||||
privileges_required_=1
|
||||
@ -11,7 +20,7 @@ cleanup_()
|
||||
vgchange -an "$vg"
|
||||
lvremove -ff "$vg"
|
||||
vgremove "$vg"
|
||||
} > /dev/null
|
||||
} > "$test_dir_/cleanup.log"
|
||||
test -n "$d1" && losetup -d "$d1"
|
||||
test -n "$d2" && losetup -d "$d2"
|
||||
rm -f "$f1" "$f2"
|
||||
@ -28,12 +37,12 @@ test_expect_success \
|
||||
lv=lvcreate-usage-$$
|
||||
|
||||
test_expect_success \
|
||||
'lvcreate w/negative stripesize must fail' \
|
||||
'lvcreate rejects a negative stripesize' \
|
||||
'lvcreate -L 64M -n $lv -i2 --stripesize -4 $vg 2>err; test $? = 3 &&
|
||||
grep "^ Negative stripesize is invalid\$" err'
|
||||
|
||||
test_expect_success \
|
||||
'lvcreate w/too-large stripesize must fail' \
|
||||
'lvcreate rejects a too-large stripesize' \
|
||||
'lvcreate -L 64M -n $lv -i2 --stripesize 4294967291 $vg 2>err; test $? = 3 &&
|
||||
grep "^ Stripe size cannot be larger than 512.00 GB\$" err'
|
||||
|
||||
@ -53,13 +62,13 @@ test_expect_success \
|
||||
lvremove -ff $vg'
|
||||
|
||||
test_expect_success \
|
||||
'lvcreate w/invalid number of stripes must fail' \
|
||||
'lvcreate rejects an invalid number of stripes' \
|
||||
'lvcreate -L 64M -n $lv -i129 $vg 2>err; test $? = 3 &&
|
||||
grep "^ Number of stripes (129) must be between 1 and 128\$" err'
|
||||
|
||||
# The case on lvdisplay output is to verify that the LV was not created.
|
||||
test_expect_success \
|
||||
'lvcreate w/invalid stripe size must fail' \
|
||||
'lvcreate rejects an invalid stripe size' \
|
||||
'lvcreate -L 64M -n $lv -i2 --stripesize 3 $vg 2>err; test $? = 3 &&
|
||||
grep "^ Invalid stripe size 3\.00 KB\$" err &&
|
||||
case "$(lvdisplay $vg)" in "") true ;; *) false ;; esac'
|
||||
|
@ -1,4 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2007 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
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
test_description='Ensure that pvmove diagnoses PE-range values 2^32 and larger.'
|
||||
privileges_required_=1
|
||||
|
@ -1,4 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2007 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
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
test_description='Ensure that pvmove diagnoses PE-range values 2^32 and larger.'
|
||||
privileges_required_=1
|
||||
|
@ -1,5 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Derived from git's t/test-lib.sh, which is Copyright (c) 2005 Junio C Hamano
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing to use,
|
||||
# modify, copy, or redistribute it subject to the terms and conditions
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
# For repeatability, reset the environment to known value.
|
||||
LANG=C
|
||||
|
Loading…
Reference in New Issue
Block a user