1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/test/shell
Jonathan Brassow 96626f64fa cache: Code to allow the create/remove of cache LVs
This patch allows users to create cache LVs with 'lvcreate'.  An origin
or a cache pool LV must be created first.  Then, while supplying the
origin or cache pool to the lvcreate command, the cache can be created.

Ex1:
Here the cache pool is created first, followed by the origin which will
be cached.
~> lvcreate --type cache_pool -L 500M -n cachepool vg /dev/small_n_fast
~> lvcreate --type cache -L 1G -n lv vg/cachepool /dev/large_n_slow

Ex2:
Here the origin is created first, followed by the cache pool - allowing
a cache LV to be created covering the origin.
~> lvcreate -L 1G -n lv vg /dev/large_n_slow
~> lvcreate --type cache -L 500M -n cachepool vg/lv /dev/small_n_fast

The code determines which type of LV was supplied (cache pool or origin)
by checking its type.  It ensures the right argument was given by ensuring
that the origin is larger than the cache pool.

If the user wants to remove just the cache for an LV.  They specify
the LV's associated cache pool when removing:
~> lvremove vg/cachepool

If the user wishes to remove the origin, but leave the cachepool to be
used for another LV, they specify the cache LV.
~> lvremove vg/lv

In order to remove it all, specify both LVs.

This patch also includes tests to create and remove cache pools and
cache LVs.
2014-02-04 16:50:16 -06:00
..
000-basic.sh Update tests 2012-03-16 13:00:05 +00:00
activate-minor.sh tests: skip if the system already uses tested minor 2013-05-31 21:42:32 +02:00
activate-missing-segment.sh Partial activation working, expect success in tests. 2012-05-17 12:03:30 +00:00
activate-missing.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
activate-partial.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
clvmd-restart.sh test: wait for pid removal 2013-05-03 15:44:15 +02:00
covercmd.sh tests: one LV should be active and one inactive in covercmd test 2013-12-04 09:38:00 +01:00
discards-thin.sh thin: fix forbidden discards checks 2013-02-05 14:38:16 +01:00
dmeventd-restart.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
dumpconfig.sh Add comment about slow startup of dmeventd 2012-03-16 19:13:09 +00:00
fsadm.sh tests: update testing for xfs 2014-01-20 12:02:33 +01:00
inconsistent-metadata.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
listings.sh report: Print UUIDs for missing PVs when possible. 2013-11-17 22:36:13 +01:00
lock-blocking.sh Update tests 2012-03-16 13:00:05 +00:00
lock-parallel.sh tests: check for mkfs 2014-01-28 10:40:08 +01:00
lvchange-mirror.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
lvchange-partial-raid10.sh test: new test new fail 2013-04-23 14:15:04 +02:00
lvchange-partial.sh test: new test new fail 2013-04-23 14:15:04 +02:00
lvchange-raid.sh TEST: Unaccounted possible output causing failure 2013-09-12 13:23:53 -05:00
lvchange-thin.sh tests: testing thin lvchange 2013-11-01 13:05:05 +01:00
lvconvert-mirror-basic-0.sh Update tests 2012-03-16 13:00:05 +00:00
lvconvert-mirror-basic-1.sh Update tests 2012-03-16 13:00:05 +00:00
lvconvert-mirror-basic-2.sh Update tests 2012-03-16 13:00:05 +00:00
lvconvert-mirror-basic-3.sh Update tests 2012-03-16 13:00:05 +00:00
lvconvert-mirror-basic.sh mirror/RAID: Honor mirror_segtype_default when converting from linear 2013-09-25 22:25:43 -05:00
lvconvert-mirror.sh mirror/RAID: Honor mirror_segtype_default when converting from linear 2013-09-25 22:25:43 -05:00
lvconvert-raid10.sh RAID: Make RAID single-machine-exclusive capable in a cluster 2013-09-10 16:33:22 -05:00
lvconvert-raid.sh tests: skip raid test on 3.12.0 2013-11-19 11:49:33 +01:00
lvconvert-repair-dmeventd.sh tests: update test 2014-02-04 14:49:38 +01:00
lvconvert-repair-policy.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
lvconvert-repair-raid.sh TEST: Test was trying to kill 2 devices in RAID5 instead of RAID6 2013-10-18 09:33:37 -05:00
lvconvert-repair-replace.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
lvconvert-repair-snapshot.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
lvconvert-repair-thin.sh tests: fix exporting content of make vars 2013-10-17 11:57:35 +02:00
lvconvert-repair-transient-dmeventd.sh test: Skip tests involving mirror recovery on known bad kernels. 2013-09-03 16:24:32 +02:00
lvconvert-repair-transient.sh test: Skip tests involving mirror recovery on known bad kernels. 2013-09-03 16:24:32 +02:00
lvconvert-repair.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
lvconvert-thin-external.sh tests: validate acceptable external origin size 2014-01-29 14:59:09 +01:00
lvconvert-thin.sh tests: on 32bit test with <16T devs 2013-11-19 10:55:14 +01:00
lvconvert-twostep.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
lvcreate-cache.sh cache: Code to allow the create/remove of cache LVs 2014-02-04 16:50:16 -06:00
lvcreate-large-raid10.sh tests: on 32bit test with <16T devs 2013-11-19 10:55:14 +01:00
lvcreate-large-raid.sh tests: on 32bit test with <16T devs 2013-11-19 10:55:14 +01:00
lvcreate-large.sh tests: on 32bit test with <16T devs 2013-11-19 10:55:14 +01:00
lvcreate-mirror.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
lvcreate-missing.sh lvmetad: Mark PVs visible to lvmetad but not to us as MISSING. 2013-04-03 11:40:29 +02:00
lvcreate-operation.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
lvcreate-pvtags.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
lvcreate-raid10.sh tests: use check for raid test 2013-09-16 11:22:04 +02:00
lvcreate-raid.sh tests: use check for raid test 2013-09-16 11:22:04 +02:00
lvcreate-repair.sh Improve test suite 2012-03-28 11:10:08 +00:00
lvcreate-signature-wiping.sh config: shorten new sig wiping option string 2013-12-09 09:35:47 +00:00
lvcreate-small-snap.sh tests: snapshot needs 3 chunks 2013-05-30 17:56:47 +02:00
lvcreate-striped-mirror.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
lvcreate-thin-external.sh tests: validate acceptable external origin size 2014-01-29 14:59:09 +01:00
lvcreate-thin-power2.sh test: update thin discards testing 2012-12-11 12:05:48 +01:00
lvcreate-thin-snap.sh tests: used -n for fsck 2013-11-15 12:38:37 +01:00
lvcreate-thin.sh tests: used -n for fsck 2013-11-15 12:38:37 +01:00
lvcreate-usage.sh tests: lvcreate and snapshot update 2013-10-14 00:29:03 +02:00
lvextend-percent-extents.sh tests: more test run in cluster mode 2013-06-16 00:07:33 +02:00
lvextend-snapshot-dmeventd.sh tests: more test run in cluster mode 2013-06-16 00:07:33 +02:00
lvextend-snapshot-policy.sh tests: more test run in cluster mode 2013-06-16 00:07:33 +02:00
lvextend-thin-metadata-dmeventd.sh tests: more testing for online thin metadata resize 2014-01-21 13:53:10 +01:00
lvm-init.sh Update tests 2012-03-16 13:00:05 +00:00
lvmcache-exercise.sh test: Correctly trigger inconsistent metadata repair in lvmcache-exercise. 2013-10-09 14:44:15 +02:00
lvmetad-disabled.sh lvmetad: respect LVM_LVMETAD_PIDFILE settings in lvm 2014-01-24 15:59:38 +01:00
lvmetad-dump.sh test: Add lvmetad-dump.sh. 2012-10-11 20:32:25 +02:00
lvmetad-lvm1.sh pvscan --cache: Also read metadata from LVM1 PVs (BZ 863401). 2012-10-10 21:55:24 +02:00
lvmetad-no-cluster.sh lvmetad: Disable and warn when locking_type is 3. 2012-10-25 14:31:08 +02:00
lvmetad-override.sh test: Check that overriding use_lvmetad with --config works. 2012-10-30 09:16:15 +01:00
lvmetad-pvs.sh Update tests 2012-03-16 13:00:05 +00:00
lvmetad-pvscan-cache.sh TEST: Only run the pvscan --cache test with lvmetad active. 2012-10-08 07:23:13 +02:00
lvmetad-pvscan-filter.sh tests: comment about pvscan --cache return value 2013-07-22 15:57:18 +02:00
lvmetad-pvscan-nomda.sh lvmetad: Fix autoactivation for MDA-less PVs. 2012-12-12 13:19:04 +01:00
lvmetad-restart.sh test: Check that lvmetad is refreshed correctly on restart. 2012-10-10 13:54:36 +02:00
lvmetad-test.sh TEST: Add lvmetad-test; checks --test with lvmetad. 2012-07-30 11:21:55 +02:00
lvmetad-warning.sh lvmetad: Fix the fix for 813766 (lvmetad connection warning). 2012-10-12 11:22:47 +02:00
lvresize-mirror.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
lvresize-raid10.sh tests: more test run in cluster mode 2013-06-16 00:07:33 +02:00
lvresize-raid.sh Test/clean-up: Indent clean-up and additional RAID resize test 2013-09-24 21:32:53 -05:00
lvresize-rounding.sh tests: more test run in cluster mode 2013-06-16 00:07:33 +02:00
lvresize-thin-external-origin.sh thin: disable extension of reduced thin with etx.origin 2014-01-28 10:40:08 +01:00
lvresize-thin-metadata.sh tests: more testing for online thin metadata resize 2014-01-21 13:53:10 +01:00
lvresize-usage.sh Update tests 2012-03-16 13:00:05 +00:00
mda-rollback.sh test: Add a test for the failing pv_read optimisation. 2013-11-17 21:41:26 +01:00
mdata-strings.sh tests: fix strings test 2013-06-04 15:57:42 +02:00
metadata-balance.sh tests: test mirrors in clustered way 2013-05-31 21:42:32 +02:00
metadata-dirs.sh Update tests 2012-03-16 13:00:05 +00:00
metadata.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
mirror-names.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
mirror-vgreduce-removemissing.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
name-mangling.sh Update tests 2012-03-16 13:00:05 +00:00
nomda-missing.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
nomda-restoremissing.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
orphan-ondisk.sh TEST: Add a regression test for the ondisk/orphan bug. 2013-07-22 11:57:23 +02:00
pool-labels.sh tests: skip pool-label test for lvmetad 2013-12-17 14:08:54 +01:00
process-each-duplicate-vgnames.sh test: fix process-each-duplicate-vgnames 2013-08-30 11:53:10 -05:00
process-each-lv.sh test: add process-each-vg and process-each-lv 2013-08-23 14:38:48 -05:00
process-each-vg.sh test: add process-each-vg and process-each-lv 2013-08-23 14:38:48 -05:00
profiles.sh tests: add profiles.sh test 2013-08-07 12:17:36 +02:00
pv-duplicate.sh test: Force label-based reporting in pv-duplicate.sh. 2013-11-18 17:53:06 +01:00
pv-min-size.sh Update tests 2012-03-16 13:00:05 +00:00
pv-range-overflow.sh Update tests 2012-03-16 13:00:05 +00:00
pvchange-usage.sh Update tests 2012-03-16 13:00:05 +00:00
pvcreate-ff.sh test: Add a regression test for pvcreate -ff. 2014-01-08 15:24:43 +01:00
pvcreate-metadata0.sh tests: test mirrors in clustered way 2013-05-31 21:42:32 +02:00
pvcreate-operation-md.sh test: Fix fallout from pv_read changes. 2013-11-17 21:41:27 +01:00
pvcreate-operation.sh tests: wipe fs signature manually in pvcreate-operation test 2013-11-28 14:10:55 +01:00
pvcreate-usage.sh report: Convert pv_mda_size to a type "label" field. 2013-11-17 21:43:06 +01:00
pvmove-all-segtypes.sh tests: enhance pvmove testing 2013-09-16 11:22:04 +02:00
pvmove-basic.sh tests: enhance pvmove testing 2013-09-16 11:22:04 +02:00
pvmove-raid-segtypes.sh tests: enhance pvmove testing 2013-09-16 11:22:04 +02:00
pvmove-restart.sh tests: update pvmove-test 2013-12-04 17:10:31 +01:00
pvmove-thin-segtypes.sh tests: drop pointeless test 2013-09-23 12:14:21 +02:00
pvremove-usage.sh tests: test mirrors in clustered way 2013-05-31 21:42:32 +02:00
read-ahead.sh Update tests 2012-03-16 13:00:05 +00:00
snapshot-autoumount-dmeventd.sh tests: more test run in cluster mode 2013-06-16 00:07:33 +02:00
snapshot-lvm1.sh test: update using exclusive activation 2013-02-05 14:39:11 +01:00
snapshot-merge.sh tests: drop extra loop 2013-09-23 12:14:21 +02:00
snapshot-usage.sh tests: on 32bit test with <16T devs 2013-11-19 10:55:14 +01:00
snapshots-of-mirrors.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
tags.sh tests: test mirrors in clustered way 2013-05-31 21:42:32 +02:00
test-partition.sh Update tests 2012-03-16 13:00:05 +00:00
thin-autoumount-dmeventd.sh thin: add support to unmount volumes 2012-10-14 23:19:20 +02:00
thin-defaults.sh tests: update thin testing 2012-11-27 14:10:46 +01:00
thin-merge.sh test: thin snapshot merge 2013-12-04 14:30:26 +01:00
thin-restore.sh tests: update thin testing 2012-11-27 14:10:46 +01:00
topology-support.sh tests: test mirrors in clustered way 2013-05-31 21:42:32 +02:00
unknown-segment.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
unlost-pv.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
vg-name-from-env.sh test: add vg-name-from-env 2013-08-23 14:10:29 -05:00
vgcfgbackup-usage.sh tests: no activate LV 2013-09-16 15:38:42 +02:00
vgchange-many.sh tests: performance testing 2013-06-06 12:14:53 +02:00
vgchange-maxlv.sh tests: test mirrors in clustered way 2013-05-31 21:42:32 +02:00
vgchange-partial.sh TEST: Add lvchange-partial.sh and vgchange-partial.sh to the test suite 2012-10-10 11:47:04 -05:00
vgchange-sysinit.sh tests: test mirrors in clustered way 2013-05-31 21:42:32 +02:00
vgchange-usage.sh Update tests 2012-03-16 13:00:05 +00:00
vgck.sh vgck: Fix #894136, notice on-disk corruption in spite of lvmetad. 2013-08-13 23:25:49 +02:00
vgcreate-usage.sh tests: test mirrors in clustered way 2013-05-31 21:42:32 +02:00
vgextend-restoremissing.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
vgextend-usage.sh Update tests 2012-03-16 13:00:05 +00:00
vgimportclone.sh tests: do not expose duplicate PVs in vgimportclone.sh 2013-06-02 00:50:09 +02:00
vgmerge-operation.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
vgmerge-usage.sh tests: test mirrors in clustered way 2013-05-31 21:42:32 +02:00
vgreduce-removemissing-snapshot.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
vgreduce-usage.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
vgrename-usage.sh tests: vgrename duplicate rename 2013-10-08 13:42:09 +02:00
vgsplit-operation.sh TEST: Be explicit about which mirror segment type to use. 2013-08-07 15:48:31 -05:00
vgsplit-stacked.sh tests: make filter extension more robust 2013-06-02 00:50:09 +02:00
vgsplit-thin.sh thin: vgsplit support for thins 2013-06-13 14:51:00 +02:00
vgsplit-usage.sh Update tests 2012-03-16 13:00:05 +00:00