contrib/rh-bkr: add --valgrind flag

Installs valgrind and provides a template for vgdb enabled valgrind-wrapped
service. The test harness is expected to pick this up, finish the setup and
eventually make use of it.
This commit is contained in:
Lubomir Rintel 2016-03-05 00:27:37 +01:00
parent fa7ea3d5a3
commit e804b0614a
2 changed files with 13 additions and 0 deletions

View file

@ -548,6 +548,7 @@ class CmdSubmit(CmdBase):
self.parser.add_argument('--bkr-write-job-id', help='If specified, write the job ID to the specified file.')
self.parser.add_argument('--bkr-wait-completion', action='store_true', help='Whether to wait for completion of the beaker job')
self.parser.add_argument('--bkr-job-results', help='If specified, write the job results to the specified file. Implies --bkr-wait-completion.')
self.parser.add_argument('--valgrind', action='store_true', help='setup the valgrind wrapper')
def _prepare_rpms(self):
@ -846,6 +847,11 @@ class CmdSubmit(CmdBase):
return ''
return None
def _get_var_for_VALGRIND(self, key):
if self._get_var('VALGRIND') is not None or self.options.valgrind:
return 'valgrind'
return ''
DefaultReplacements = {
'WHITEBOARD' : 'Test NetworkManager',
'DISTRO_FAMILY' : 'RedHatEnterpriseLinux7',
@ -871,6 +877,7 @@ class CmdSubmit(CmdBase):
'CONF_DHCP' : 'dhclient',
'CONF_DEBUG' : 'RLIMIT_CORE,fatal-warnings',
'RPM_LIST' : _get_var_for_RPM_LIST,
'VALGRIND' : _get_var_for_VALGRIND,
}
def _process_line_get(self, key, replacements):
if key in replacements:

View file

@ -16,6 +16,7 @@ abrt-tui
abrt-addon-ccpp
libreport-rhel-bugzilla
NetworkManager-wifi
$VALGRIND
%end
%post --log=/dev/console --erroronfail
@ -90,6 +91,11 @@ fi
<param name="CMDS_TO_RUN" value="test -n '$BUILD_ID' || exit 0; wget 'http://cgit.freedesktop.org/NetworkManager/NetworkManager/plain/contrib/rh-bkr/build-from-source.sh?id=automation' -O /tmp/nm-build-from-source.sh &amp;&amp; BUILD_ID='$BUILD_ID' ARCH='$ARCH' sh /tmp/nm-build-from-source.sh"/>
</params>
</task>
<task name="/distribution/command" role="STANDALONE">
<params>
<param name="CMDS_TO_RUN" value="test -n '$VALGRIND' || exit 0; sed &quot;s,\(ExecStart=\)\(.*\),\1/bin/bash -c 'G_SLICE=always-malloc G_DEBUG=gc-friendly LOGNAME=root HOSTNAME=localhost exec -a /usr/sbin/NetworkManager /usr/bin/valgrind --num-callers=100 --vgdb=yes --suppressions=/mnt/tests/NetworkManager/runtime.suppressions --suppressions=$(ls /usr/src/debug/NetworkManager-*/valgrind.suppressions) \2',&quot; /usr/lib/systemd/system/NetworkManager.service &gt; /etc/systemd/system/NetworkManager-valgrind.service" />
</params>
</task>
<task name="/qe/desktop/simpletestharness" role="STANDALONE">
<params>
<param name="GIT_URL" value="$GIT_TEST_REPO"/>