summaryrefslogtreecommitdiff
path: root/test/test-functions
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2016-01-14 08:09:09 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2016-01-14 08:11:17 +0000
commita2fbff31c9c319da51528f85ae97d019f1e61a86 (patch)
treee230757906fdec8c68c93df4805b4f54e15a629c /test/test-functions
parentd9814c76ec35e53a6b6448c0f522da0c71907c81 (diff)
tests: add function for valgrind installation
I used it for d9814c76ec35e53a6b6448c0 Very handy:)
Diffstat (limited to 'test/test-functions')
-rw-r--r--test/test-functions19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test-functions b/test/test-functions
index cf8755acd4..80d048c0d2 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -119,6 +119,25 @@ setup_basic_environment() {
generate_module_dependencies
}
+install_valgrind() {
+ if ! type -p valgrind; then
+ dfatal "Failed to install valgrind"
+ exit 1
+ fi
+
+ local _valgrind_bins=$(strace -e execve valgrind /bin/true 2>&1 >/dev/null | perl -lne 'print $1 if /^execve\("([^"]+)"/')
+ dracut_install $_valgrind_bins
+
+ local _valgrind_libs=$(LD_DEBUG=files valgrind /bin/true 2>&1 >/dev/null | perl -lne 'print $1 if m{calling init: (/.*vgpreload_.*)}')
+ dracut_install $_valgrind_libs
+
+ local _valgrind_dbg_and_supp=$(
+ strace -e open valgrind /bin/true 2>&1 >/dev/null |
+ perl -lne 'if (my ($fname) = /^open\("([^"]+).*= (?!-)\d+/) { print $fname if $fname =~ /debug|\.supp$/ }'
+ )
+ dracut_install $_valgrind_dbg_and_supp
+}
+
install_dmevent() {
instmods dm_crypt =crypto
type -P dmeventd >/dev/null && dracut_install dmeventd