This actually consists of several parts.
* Added a generic cleanup-scheduling mechanism. Instead of calling
"trap ... EXIT" directly, just call "push_trapfunc ..." instead and
your cleanup function will be called along with any others.
* Converted a few tests to use push_trapfunc.
* Added "push_trapfunc cleanup_lvm" to snapshot.rc to address the
particular problem that's driving this - snapshot tests not calling
cleanup_lvm on their own and leaving bad state for the next test.
Signed-off-by: Jeff Darcy <firstname.lastname@example.org>
Smoke: Gluster Build System <email@example.com>
NetBSD-regression: NetBSD Build System <firstname.lastname@example.org>
CentOS-regression: Gluster Build System <email@example.com>
Reviewed-by: Atin Mukherjee <firstname.lastname@example.org>
Reviewed-by: Rajesh Joseph <email@example.com>