1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

45 Commits

Author SHA1 Message Date
Zdenek Kabelac
5a96ca4a7f tests: update pool uuid handling
Pools now preserve meta LV UUID with swapmetadata operation
to make the usage of lvmlockd easier.

Update test to reflect this change.
2023-08-16 15:14:29 +02:00
Zdenek Kabelac
935813457f tests: update thin 2023-07-10 17:13:33 +02:00
David Teigland
aa34da6ecc Revert "tests: enable tests for lvmlockd"
This reverts commit 99b6173f10.

These tests are disabled with lvmlockd because they use
snapshots without an origin which is not permitted in a
shared vg.
2021-02-24 10:30:51 -06:00
Zdenek Kabelac
19ddad12ca tests: update thin and cache checked messages
Slightly changed messages for allocation of pool metadata.
2021-02-01 12:13:49 +01:00
Zdenek Kabelac
99b6173f10 tests: enable tests for lvmlockd 2020-10-02 22:27:00 +02:00
Zdenek Kabelac
e653f43732 tests: simplify some var settings
scan_lvs now automatically comes with extend_filter_LVMTEST
2019-08-09 12:57:21 +02:00
David Teigland
fedeab28c3 tests: set scan_lvs=1 in tests that stack PVs on LVs 2019-02-20 13:52:35 -06:00
Zdenek Kabelac
5dd53943c9 tests: update checked message 2017-08-02 00:04:35 +02:00
Zdenek Kabelac
160cb1e713 tests: replace cat usage 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
e55bae2b2c tests: use bash 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
b6945b8510 tests: no longer allowed too big thin-pools for small chunks 2017-06-09 13:03:42 +02:00
Zdenek Kabelac
56704383bf tests: test for new supported commands
New tests for:

lvconvert --regionsize | --swapmetadata | --startpoll |
          --mergesnapshot | mergethin
2017-04-12 21:34:08 +02:00
Zdenek Kabelac
f8034e14e6 tests: restore some test changes
Restore existing tests and separate new tests
for new options later.

Keep coverage for existing syntax

Reverts bits from commits:

a801b92b2c.
d71aaca07b
fa2a728a39
1e2420bca8
46abc28a48
0e3e611a13
2017-04-12 21:34:08 +02:00
David Teigland
0e3e611a13 lvconvert: use command defs for thin/cache/pool creation
Everything related to thin and cache.
2017-02-13 08:20:10 -06:00
David Teigland
1e2420bca8 commands: new method for defining commands
. Define a prototype for every lvm command.
. Match every user command with one definition.
. Generate help text and man pages from them.

The new file command-lines.in defines a prototype for every
unique lvm command.  A unique lvm command is a unique
combination of: command name + required option args +
required positional args.  Each of these prototypes also
includes the optional option args and optional positional
args that the command will accept, a description, and a
unique string ID for the definition.  Any valid command
will match one of the prototypes.

Here's an example of the lvresize command definitions from
command-lines.in, there are three unique lvresize commands:

lvresize --size SizeMB LV
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync, --reportformat String, --resizefs,
--stripes Number, --stripesize SizeKB, --poolmetadatasize SizeMB
OP: PV ...
ID: lvresize_by_size
DESC: Resize an LV by a specified size.

lvresize LV PV ...
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync,
--reportformat String, --resizefs, --stripes Number, --stripesize SizeKB
ID: lvresize_by_pv
DESC: Resize an LV by specified PV extents.
FLAGS: SECONDARY_SYNTAX

lvresize --poolmetadatasize SizeMB LV_thinpool
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync,
--reportformat String, --stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvresize_pool_metadata_by_size
DESC: Resize a pool metadata SubLV by a specified size.

The three commands have separate definitions because they have
different required parameters.  Required parameters are specified
on the first line of the definition.  Optional options are
listed after OO, and optional positional args are listed after OP.

This data is used to generate corresponding command definition
structures for lvm in command-lines.h.  usage/help output is also
auto generated, so it is always in sync with the definitions.

Every user-entered command is compared against the set of
command structures, and matched with one.  An error is
reported if an entered command does not have the required
parameters for any definition.  The closest match is printed
as a suggestion, and running lvresize --help will display
the usage for each possible lvresize command.

The prototype syntax used for help/man output includes
required --option and positional args on the first line,
and optional --option and positional args enclosed in [ ]
on subsequent lines.

  command_name <required_opt_args> <required_pos_args>
          [ <optional_opt_args> ]
          [ <optional_pos_args> ]

Command definitions that are not to be advertised/suggested
have the flag SECONDARY_SYNTAX.  These commands will not be
printed in the normal help output.

Man page prototypes are also generated from the same original
command definitions, and are always in sync with the code
and help text.

Very early in command execution, a matching command definition
is found.  lvm then knows the operation being done, and that
the provided args conform to the definition.  This will allow
lots of ad hoc checking/validation to be removed throughout
the code.

Each command definition can also be routed to a specific
function to implement it.  The function is associated with
an enum value for the command definition (generated from
the ID string.)  These per-command-definition implementation
functions have not yet been created, so all commands
currently fall back to the existing per-command-name
implementation functions.

Using per-command-definition functions will allow lots of
code to be removed which tries to figure out what the
command is meant to do.  This is currently based on ad hoc
and complicated option analysis.  When using the new
functions, what the command is doing is already known
from the associated command definition.
2017-02-13 08:20:10 -06:00
Zdenek Kabelac
bcf59a1b18 tests: test should clean devices it has created
To be able to detect lvm2 command is not leaking some
'unexpected' device - remove all devices before
test exits by its own command so test teardown
now can check what was 'left' unexpectedly.
2016-12-11 23:24:19 +01:00
David Teigland
f54253d396 tests: add SKIP_WITH_LVMLOCKD
to all tests that don't already used vgcreate $SHARED
2016-02-23 09:28:48 -06:00
Zdenek Kabelac
fcbef05aae doc: change fsf address
Hmm rpmlint suggest fsf is using a different address these days,
so lets keep it up-to-date
2016-01-21 12:11:37 +01:00
Zdenek Kabelac
4159680a0e tests: use more SKIP
Speed-up check_lvmpolld.
2015-10-27 16:00:09 +01:00
Zdenek Kabelac
bfd0689d64 tests: use old snapshot for huge volumes
Avoid stacking thins over thins.
2015-07-07 09:57:32 +02:00
Zdenek Kabelac
caaca15854 tests: thin_restore not needed
Few more test which could live without thin_restore.
2015-05-18 12:45:42 +02:00
Zdenek Kabelac
57a16abe2c tests: do not use |&
Bash 3.2  doesn't understand this syntax (i.e. RHEL5).
And it's even better - reports syntax error and return success.
2015-05-14 10:52:55 +02:00
Ondrej Kozina
e587b0677b lvmpolld: Add standalone polldaemon.
See doc/lvmpolld_overview.txt
2015-05-09 00:59:18 +01:00
Zdenek Kabelac
1e80265c36 lvconvert: earlier detection of conflicting names
Detect same LV names for lvconvert prior opening VG.
i.e. lvconvert --thinpool vg/lvol0  -T lvol0
2014-11-24 14:39:04 +01:00
Zdenek Kabelac
8eb111dfb8 pool: prevent pool conversion with same name
When same name is given for converted volume and pool volume,
stop further command processing.
2014-11-23 00:49:04 +01:00
Zdenek Kabelac
75c4d268e9 tests: check for cache and raid
Skip some tests on systems without cache or raid.
2014-10-07 10:19:33 +02:00
Zdenek Kabelac
742d250cc5 tests: lvconvert thin pool
More tests.
2014-10-06 15:31:44 +02:00
Zdenek Kabelac
653fd7bee3 tests: new lvconvert features 2014-07-22 22:41:41 +02:00
Zdenek Kabelac
d7065f154e tests: updates for new lvconvert 2014-07-11 13:32:52 +02:00
Zdenek Kabelac
5c5177c37c tests: rename test to inittest
We are getting into problem when we use 'test' for commands like
should/not/...

So avoid overloading test name and change it to inittest.
2014-06-10 10:51:27 +02:00
Zdenek Kabelac
7b8133e0b2 tests: fix test compare
Comparing 64T can't use -eq
2014-06-05 23:06:45 +02:00
Zdenek Kabelac
eb7ca96b59 tests: adapt test for newline delimit
content of DEVICES is now delimited by newlines
2014-06-05 23:05:52 +02:00
Zdenek Kabelac
205be24768 tests: update lvconvert test
Split raid test to separate file
Add --yes flag to automated testing
2014-05-20 21:50:29 +02:00
Zdenek Kabelac
fe609141a8 tests: on 32bit test with <16T devs
Add  'can_use_16T' to detect systems where we could
safely use 16T devices without causing system deadlocks.

16T size leads on those to endless loops in udevd
- it calls blkid which tries cached read from such device
- this ends in endless loop.

Related problems:
https://bugzilla.redhat.com/show_bug.cgi?id=1015028
2013-11-19 10:55:14 +01:00
Jonathan Brassow
82228acfc9 Mirror/Thin: Disallow thinpools on mirror logical volumes
The same corner cases that exist for snapshots on mirrors exist for
any logical volume layered on top of mirror.  (One example is when
a mirror image fails and a non-repair LVM command is the first to
detect it via label reading.  In this case, the LVM command will hang
and prevent the necessary LVM repair command from running.)  When
a better alternative exists, it makes no sense to allow a new target
to stack on mirrors as a new feature.  Since, RAID is now capable of
running EX in a cluster and thin is not active-active aware, it makes
sense to pair these two rather than mirror+thinpool.

As further background, here are some additional comments that I made
when addressing a bug related to mirror+thinpool:
(https://bugzilla.redhat.com/show_bug.cgi?id=919604#c9)
I am going to disallow thin* on top of mirror logical volumes.
Users will have to use the "raid1" segment type if they want this.

This bug has come down to a choice between:
1) Disallowing thin-LVs from being used as PVs.
2) Disallowing thinpools on top of mirrors.

The problem is that the code in dev_manager.c:device_is_usable() is unable
to tell whether there is a mirror device lower in the stack from the device
being checked.  Pretty much anything layered on top of a mirror will suffer
from this problem.  (Snapshots are a good example of this; and option #1
above has been chosen to deal with them.  This can also be seen in
dev_manager.c:device_is_usable().)  When a mirror failure occurs, the
kernel blocks all I/O to it.  If there is an LVM command that comes along
to do the repair (or a different operation that requires label reading), it
would normally avoid the mirror when it sees that it is blocked.  However,
if there is a snapshot or a thin-LV that is on a mirror, the above code
will not detect the mirror underneath and will issue label reading I/O.
This causes the command to hang.

Choosing #1 would mean that thin-LVs could never be used as PVs - even if
they are stacked on something other than mirrors.

Choosing #2 means that thinpools can never be placed on mirrors.  This is
probably better than we think, since it is preferred that people use the
"raid1" segment type in the first place.  However, RAID* cannot currently
be used in a cluster volume group - even in EX-only mode.  Thus, a complete
solution for option #2 must include the ability to activate RAID logical
volumes (and perform RAID operations) in a cluster volume group.  I've
already begun working on this.
2013-09-11 15:58:44 -05:00
Jonathan Brassow
ea4c0ea34f TEST: Be explicit about which mirror segment type to use.
In those places where mirrors were being created while assuming
a default segment type of "mirror", we include the '--type mirror'
argument to explicitly set the segment type.  This will preserve
the mirror testing that is performed even though the default
mirroring segment type is now "raid1".
2013-08-07 15:48:31 -05:00
Zdenek Kabelac
da5284a500 thin: lvconvert cannot convert pool to mirror
Suggest to use _tdata and _tmeta devices for that.
This fixes regression from too relaxed change in
f1d5f6ae81

Without this patch there are some empty LVs created before
mirror code recognizes it cannot continue.

(in release fix)
2013-07-24 17:17:19 +02:00
Petr Rockai
53fbf2bea3 tests: make filter extension more robust 2013-06-02 00:50:09 +02:00
Zdenek Kabelac
2be940e549 tests: update thin testing 2012-11-27 14:10:46 +01:00
Zdenek Kabelac
a7893ae858 test: testing lvconvert 2012-11-19 14:38:17 +01:00
Zdenek Kabelac
14283662b9 test: use exclusive activation for created mirrors 2012-10-10 21:22:12 +02:00
Zdenek Kabelac
876514eb34 test: drop clustered flag control from thin tests 2012-10-10 21:22:12 +02:00
Zdenek Kabelac
d4eded9fd6 test: move common code for thin init 2012-10-10 21:22:11 +02:00
Petr Rockai
6e523f01d0 test: Skip thin tests if thin support is configured out. 2012-10-10 00:20:22 +02:00
Zdenek Kabelac
439989adab test: more thin tests 2012-10-09 16:38:42 +02:00