Vojtech Trefny
7807672975
lvmdbusd: Add a flag to activate LVs in shared mode to Lv.Activate
2023-04-20 12:09:11 -05:00
Tony Asleson
0c73d3545b
lvmdbustest: Correct env. logic
...
Signed-off-by: Tony Asleson <tasleson@redhat.com>
2023-03-14 09:36:38 -05:00
Tony Asleson
baf99ff974
lvmdbustest: Add notes on error injection testing
...
Not doing this by default for automated build testing as it generates a
lot of output and slows things down by another ~10%.
2023-03-10 12:51:53 -06:00
Tony Asleson
1c550d7124
lvmdbustest: Add env. variable to skip signal testing
...
This is currently need if we are collecting code coverage data as we don't
handle this unit test correctly.
2023-03-10 12:51:53 -06:00
Tony Asleson
f8876290bf
lvmdbustest: Check for needed env. variables
2023-03-10 12:51:53 -06:00
Tony Asleson
568e8c71d7
lvmdbustest: Don't use hard coded /tmp for error inject log
2023-03-10 12:51:53 -06:00
Tony Asleson
9c3b91a513
lvmdbustest: Shutdown cleanly with "exit"
...
Make the error injection wrapper handle the exit case, so that we can
clean up gracefully when instructed to do so.
2023-03-10 12:51:53 -06:00
Tony Asleson
9714f3ec4f
lvmdbustest: Only inject 1 missing key error
...
Previously we were injecting a missing key in the lv, vg, and pv.
Given the order of processing in lvmdbusd, this prevented us from
exercising all the error paths. Change to returning just 1 instead.
2023-03-10 12:51:53 -06:00
Tony Asleson
2359023009
lvmdbustest: Correctly set up env. for error injection
2023-03-10 12:51:53 -06:00
Tony Asleson
70a5ebc052
lvmdbustest: open log file with "a"
...
So we retain the log across fork & exec and lvm shell testing.
2023-03-10 12:51:53 -06:00
Tony Asleson
8e27dfd405
lvmdbustest: Test duplicate VG rename
2023-03-03 11:17:30 -06:00
Tony Asleson
3e616230f2
lvmdbustest: Add more info on asserts
2023-03-02 11:44:16 -06:00
Tony Asleson
95afd315b1
lvmdbustest: Don't hard code to /tmp
...
During lvm testing they use an alternative tmp directory.
2023-03-01 15:59:18 -06:00
Tony Asleson
50e6efafb9
lvmdbustest: Add more output for test_log_file_option
2023-03-01 15:52:23 -06:00
Tony Asleson
80f6655956
lvmdbustest.py: Increase udev timeout
2023-03-01 15:26:37 -06:00
Tony Asleson
e3b7395af4
lvmdbustest.py: Remove use of root_dir in glob
...
This feature has only been in python since 10/2021.
2023-02-27 09:07:37 -06:00
Tony Asleson
993bd2ffc8
lvmdbustest: Check and remove lvm debug collection files
...
In setup/teardown ensure we check for and remove any lvm debug
collection, to prevent FS from filling up.
2023-02-20 12:01:53 -06:00
Tony Asleson
61917fbac2
lvmdbustest: Add test to ensure error collection
...
Recreates https://bugzilla.redhat.com/show_bug.cgi?id=2145114
2022-11-29 12:56:55 -06:00
Tony Asleson
736547e7bb
lvmdbustest: Add test for copy signature
...
Add test to ensure we detect when a PV signature is copied to a block
device.
2022-10-20 15:10:35 -05:00
Tony Asleson
5a6ae2d4d8
lvmdbustest: Add test for wipefs
...
Ensure that if an external program or user calles wipefs on a PV that we
correctly update the state of the daemon.
2022-10-20 15:10:35 -05:00
Tony Asleson
599cbd7dd3
lvmdbusd: Correct env. variable
...
Make this match the unit test expectation and the form we use for
other env. variables.
2022-09-30 11:51:23 -05:00
Tony Asleson
fd05b79aad
lvmdbustest: Add test to stress mode changing
...
Add a test to toggle from fork & exec to lvm shell repeatedly, to stress
test it.
2022-09-22 17:14:10 -05:00
Tony Asleson
897b326ccc
lvmdbustest: Re-work setUp
...
Place the addCleanup at the end as we don't want to go through clean up
if we don't make it through setUp. If we don't do this we can remove VGs
that we didn't create in the unit test.
2022-09-22 17:10:13 -05:00
Tony Asleson
7966f1dd18
lvmdbustest: Refuse to remove a VG we didn't create
...
One of our previous commits introduced the side effect that we could
inadvertently remove a VG we didn't create, and lose data.
2022-09-22 16:19:16 -05:00
Tony Asleson
40018cbf53
lvmdbustest: Make vg name suffix more unique
2022-09-22 16:17:20 -05:00
Tony Asleson
3d3c517b0b
lvmdbustest: Add wrapper for injecting errors
...
Useful for forcing lvmdbusd down error paths.
2022-09-16 10:49:37 -05:00
Tony Asleson
a326e35cda
lvmdbustest: Check for self.pvs
...
If we don't make it through setUp, self.pvs will not exist.
2022-09-16 10:49:37 -05:00
Tony Asleson
ead80d134d
lvmdbustest: Move signals to last
...
When we do the signal testing we default back to fork & exec. Put these
on the end to maximize our lvm shell testing until we fix this proper.
2022-09-16 10:49:37 -05:00
Tony Asleson
b6dc96d8ef
lvmdbustest: Utilize addCleanup in unit test
...
Register the clean up with addCleanup so we ensure clean_up gets run
regardless of what happens in setUp.
2022-09-16 10:49:37 -05:00
Tony Asleson
f5876a1f3f
lvmdbustest: Skip test_nesting if scan_lvs is not enabled
2022-09-16 10:49:37 -05:00
Tony Asleson
f65f7da760
lvmdbustest: Skip test_singleton_daemon running systemd svc.
2022-09-16 10:49:37 -05:00
Tony Asleson
9693709b46
lvmdbustest: Add systemctl daemon start
2022-09-16 10:49:37 -05:00
Tony Asleson
f252e05aae
lvmdbustest: Add test for ensuring only 1 instance of daemon
2022-09-16 10:49:37 -05:00
Tony Asleson
d16c0a3e2b
lvmdbustest: Add test_sigint test
...
Get the daemon busy and send it SIGINT to ensure the daemon exits.
2022-09-16 10:49:37 -05:00
Tony Asleson
52415b5708
lvmdbustest: Add optional option to _create_num_lvs
...
This allows us to create the LVs async., thus queuing them up in daemon.
2022-09-16 10:49:37 -05:00
Tony Asleson
d05d2328e0
lvmdbustest: Factor out tearDown implementation for re-use
2022-09-16 10:49:37 -05:00
Tony Asleson
de0258a600
lvmdbustest: Add DaemonInfo class
...
This class handles identifying daemon, sending signals to it, and starting
it back up again.
2022-09-16 10:49:37 -05:00
Tony Asleson
ec50979b03
lvmdbusd: Correct typos
2022-09-16 10:49:37 -05:00
Tony Asleson
f4cb78a4e1
lvmdbustest: Add test removing incomplete job
...
When you try to remove a job that is incomplete you get a dbus exception.
Test for this error condition.
2022-09-16 10:49:37 -05:00
Tony Asleson
2ca4a2dbf3
lvmdbustest: Add test for external event
...
Ensure that when we trigger an external event that we don't incorrectly
handle multiple --config options.
2022-09-16 10:49:37 -05:00
Tony Asleson
4a202c11ff
lvmdbustest: Add test for passing log file in options
2022-09-16 10:49:37 -05:00
Tony Asleson
cef3c75dd4
lvmdbustest: nesting improvements
2022-09-16 10:49:36 -05:00
Tony Asleson
ea45ba753e
lvmdbustest: Remove force exception in _wait_for_job
...
We put this in to test one of the paths in the damon, but unfortunately
if we hit the race condition where the job actually is done we will try
to call j.Wait(1) after the remove. This fails with:
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod:
Method "Wait" with signature "i" on interface "com.redhat.lvmdbus1.Job"
doesn't exist
Which is caused by the dbus object no longer existing. We could handle
this, but the issue is we no longer have the ability to get the result to
return, they have been lost.
A better solution would be to write a specific unit test to force this code
path and handle all the possible outcomes.
2022-09-16 10:49:36 -05:00
Tony Asleson
4b4d431631
lvmdbustest: Include major number 259
...
When you have > 16 partitions for a block device the major number
changes, include them for testing.
2022-09-16 10:49:36 -05:00
Tony Asleson
9ffa1ef884
lvmdbustest: Use updated pyudev syntax
...
Previous syntax has been deprecated.
2022-09-16 10:49:36 -05:00
Tony Asleson
d0f94e763d
lvmdbustest: Add test for property "Get"
...
We typically use "GetAll", so add test for "Get" and check values.
2022-06-30 10:55:16 -05:00
Tony Asleson
73121e3f07
lvmdbustest: Increase number of LVs
...
As storage is getting faster, we need to create more LVs to pass this test.
2022-06-30 10:55:16 -05:00
Tony Asleson
8fa8dfdb8c
lvmdbustest: Correct comment spelling/grammar
2022-06-30 10:55:16 -05:00
Tony Asleson
55059e002a
lvmdbustest: Test job remove path when job not complete
2022-06-30 10:55:16 -05:00
Tony Asleson
b3d7aff6a3
lvmdbusd: Fix env variable LVM_DBUSD_TEST_MODE
...
Make it more logical.
2022-06-30 10:55:16 -05:00