lib/btrfs_test.pm

set_playground_disk

Returns disk without a partition table for filesystem experiments. Sets the test variable PLAYGROUNDDISK, on first invocation of the function.

snapper_nodbus_setup

In `snapper --no-dbus` test we need DBus to be disabled on SLES12SP3 and Leap 42.3 systemd allows DBus to be disabled. On Tumbleweed this is not possible and the simplest way to get DBus-less environment is to enter rescue.target via systemctl.

snapper_nodbus_restore

Restore environment to default.target. Console root-console has to be reset, because move from rescue to default target, logs us out. Die if DBus is active at this point, it means that DBus got activated somehow, thus invalidated `snapper --no-dbus` testing.

cron_mock_lastrun snapper-0.5 and older is using cron jobs in order to schedule and execute cleanup routines. Script /usr/lib/cron/run-crons looks into /etc/cron.{hourly,daily,weekly,monthly} for jobs to be executed. The info about last run is stored in /var/spool/cron/lastrun By updating the lastrun files timestamps, we make sure those routines won't be executed while tests are running.