<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/9759">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CI: Add optional uninstall step before installing asterisk<br><br>Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7<br>---<br>M tests/CI/gates.jenkinsfile<br>M tests/CI/installAsterisk.sh<br>M tests/CI/periodics-daily.jenkinsfile<br>M tests/CI/ref_debug.jenkinsfile<br>M tests/CI/runTestsuite.sh<br>M tests/CI/unittests.jenkinsfile<br>6 files changed, 11 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/59/9759/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile</span><br><span>index 78a9d24..ab0fd1c 100644</span><br><span>--- a/tests/CI/gates.jenkinsfile</span><br><span>+++ b/tests/CI/gates.jenkinsfile</span><br><span>@@ -153,7 +153,7 @@</span><br><span> img.inside("${dockerOptions} --name ${bt}-${groupName}") {</span><br><span> </span><br><span> lock("${JOB_NAME}.${NODE_NAME}.installer") {</span><br><span style="color: hsl(0, 100%, 40%);">- sh "sudo ./tests/CI/installAsterisk.sh --branch-name=${BRANCH_NAME} --user-group=jenkins:users"</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "sudo ./tests/CI/installAsterisk.sh --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"</span><br><span> }</span><br><span> </span><br><span> sh "sudo rm -rf ${groupDir} || : "</span><br><span>diff --git a/tests/CI/installAsterisk.sh b/tests/CI/installAsterisk.sh</span><br><span>index 74f5651..0806566 100755</span><br><span>--- a/tests/CI/installAsterisk.sh</span><br><span>+++ b/tests/CI/installAsterisk.sh</span><br><span>@@ -1,6 +1,8 @@</span><br><span> #!/usr/bin/env bash</span><br><span> </span><br><span> CIDIR=$(dirname $(readlink -fn $0))</span><br><span style="color: hsl(120, 100%, 40%);">+UNINSTALL=0</span><br><span style="color: hsl(120, 100%, 40%);">+UNINSTALL_ALL=0</span><br><span> source $CIDIR/ci.functions</span><br><span> </span><br><span> MAKE=`which make`</span><br><span>@@ -10,6 +12,9 @@</span><br><span> fi</span><br><span> destdir=${DESTDIR:+DESTDIR=$DESTDIR}</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+[ $UNINSTALL -gt 0 ] && ${MAKE} ${destdir} uninstall</span><br><span style="color: hsl(120, 100%, 40%);">+[ $UNINSTALL_ALL -gt 0 ] && ${MAKE} ${destdir} uninstall-all</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> ${MAKE} ${destdir} install || ${MAKE} ${destdir} NOISY_BUILD=yes install || exit 1</span><br><span> ${MAKE} ${destdir} samples</span><br><span> if [ x"$DESTDIR" != x ] ; then</span><br><span>diff --git a/tests/CI/periodics-daily.jenkinsfile b/tests/CI/periodics-daily.jenkinsfile</span><br><span>index 2d72766..8c97379 100644</span><br><span>--- a/tests/CI/periodics-daily.jenkinsfile</span><br><span>+++ b/tests/CI/periodics-daily.jenkinsfile</span><br><span>@@ -99,7 +99,7 @@</span><br><span> img.inside("${dockerOptions} --name ${bt}-${groupName}") {</span><br><span> </span><br><span> lock("${JOB_NAME}.${NODE_NAME}.installer") {</span><br><span style="color: hsl(0, 100%, 40%);">- sh 'sudo ./tests/CI/installAsterisk.sh --user-group=jenkins:users'</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "sudo ./tests/CI/installAsterisk.sh --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"</span><br><span> }</span><br><span> </span><br><span> sh "sudo rm -rf ${groupDir} || : "</span><br><span>diff --git a/tests/CI/ref_debug.jenkinsfile b/tests/CI/ref_debug.jenkinsfile</span><br><span>index d046a49..1fa8688 100644</span><br><span>--- a/tests/CI/ref_debug.jenkinsfile</span><br><span>+++ b/tests/CI/ref_debug.jenkinsfile</span><br><span>@@ -77,7 +77,7 @@</span><br><span> img.inside("${dockerOptions} --name ${bt}-${groupName}") {</span><br><span> </span><br><span> lock("${JOB_NAME}.${NODE_NAME}.installer") {</span><br><span style="color: hsl(0, 100%, 40%);">- sh "sudo ./tests/CI/installAsterisk.sh --branch-name=${BRANCH_NAME} --user-group=jenkins:users"</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "sudo ./tests/CI/installAsterisk.sh --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"</span><br><span> }</span><br><span> </span><br><span> sh "sudo rm -rf ${groupDir} || : "</span><br><span>diff --git a/tests/CI/runTestsuite.sh b/tests/CI/runTestsuite.sh</span><br><span>index 0778a2b..4849469 100755</span><br><span>--- a/tests/CI/runTestsuite.sh</span><br><span>+++ b/tests/CI/runTestsuite.sh</span><br><span>@@ -12,8 +12,10 @@</span><br><span> $CIDIR/setupRealtime.sh --initialize-db=${INITIALIZE_DB:?0}</span><br><span> fi</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+./cleanup-test-remnants.sh || :</span><br><span> export PYTHONPATH=./lib/python/</span><br><span> echo "Running tests ${TESTSUITE_COMMAND}"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> ./runtests.py --cleanup ${TESTSUITE_COMMAND} | contrib/scripts/pretty_print --no-color --no-timer --term-width=120 --show-errors || :</span><br><span> </span><br><span> if [ $REALTIME -eq 1 ] ; then</span><br><span>diff --git a/tests/CI/unittests.jenkinsfile b/tests/CI/unittests.jenkinsfile</span><br><span>index b019bee..82bafff 100644</span><br><span>--- a/tests/CI/unittests.jenkinsfile</span><br><span>+++ b/tests/CI/unittests.jenkinsfile</span><br><span>@@ -138,7 +138,7 @@</span><br><span> def outputfile = "${outputdir}/unittests-results.xml"</span><br><span> def testcmd = "test execute all"</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- sh "sudo ./tests/CI/installAsterisk.sh --branch-name=${BRANCH_NAME} --user-group=jenkins:users"</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "sudo ./tests/CI/installAsterisk.sh --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"</span><br><span> </span><br><span> sh "tests/CI/runUnittests.sh --user-group=jenkins:users --output-dir='${outputdir}' --output-xml='${outputfile}' --unittest-command='${testcmd}'"</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9759">change 9759</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9759"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7 </div>
<div style="display:none"> Gerrit-Change-Number: 9759 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>