$(T): init.sh
@echo "*** $@ ***"; '$(SHELL_PATH_SQ)' \
- $(TESTS_ENVIRONMENT) $@ $(GIT_TEST_OPTS)
+ $(TESTS_ENVIRONMENT) $@ $(LVM_TEST_OPTS)
.bin-dir-stamp: lvm-wrapper
rm -rf bin
lv=lvcreate-usage-$$
+test_expect_success \
+ "lvcreate rejects repeated invocation (run 2 times)" '
+ lvcreate -n $lv -l 4 $vg &&
+ { lvcreate -n $lv -l 4 $vg;
+ status=$?; echo status=$status; test $status = 5 &&
+ lvremove -ff $vg/$lv
+ }
+'
+
test_expect_success \
'lvcreate rejects a negative stripe_size' \
'lvcreate -L 64M -n $lv -i2 --stripesize -4 $vg 2>err;
'
test_expect_success \
- "vgchange disable/enable allocation for pvs with metadatacopies = $mda" '
+ "vgchange disable/enable allocation for pvs with metadatacopies = $mda (bz452982)" '
pvchange $d1 -x n &&
check_pv_field_ $d1 pv_attr -- &&
pvchange $d1 -x y &&
"pvchange rejects uuid change under an active lv" '
lvcreate -l 16 -i 2 -n $lv --alloc anywhere $vg1 &&
vg_validate_pvlv_counts_ $vg1 2 1 0 &&
- pvchange -u $d1;
- status=$?; echo status=$status; test $status = 5 &&
- lvchange -an "$vg1"/"$lv" &&
- pvchange -u $d1
+ { pvchange -u $d1;
+ status=$?; echo status=$status; test $status = 5 &&
+ lvchange -an "$vg1"/"$lv" &&
+ pvchange -u $d1
+ }
'
test_expect_success \
vgremove $vg1
'
+test_expect_success \
+ "pvchange reject --addtag to lvm1 pv" '
+ pvcreate -M1 $d1 &&
+ { pvchange $d1 --addtag test;
+ status=$?; echo status=$status; test $status != 0
+ }
+'
+
test_done
# Local Variables:
# indent-tabs-mode: nil
for mdatype in 1 2
do
+
+test_expect_success \
+ "pvcreate (lvm$mdatype) succeeds when run repeatedly (pv not in a vg)" '
+ pvcreate -M$mdatype $d1 &&
+ pvcreate -M$mdatype $d1 &&
+ pvremove -f $d1
+'
+
test_expect_success \
"pvcreate (lvm$mdatype) fails when PV belongs to VG" \
'pvcreate -M$mdatype $d1 &&
# mdadm --stop /dev/md0 &&
# pvcreate -ff -y -M$mdatype $d1 $d2 &&
# pvremove -f $d1 $d2'
-
done
test_expect_success \