[Asterisk-code-review] CI: Add optional uninstall step before installing asterisk (asterisk[16])

George Joseph asteriskteam at digium.com
Fri Jul 27 13:23:08 CDT 2018


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/9759


Change subject: CI: Add optional uninstall step before installing asterisk
......................................................................

CI: Add optional uninstall step before installing asterisk

Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7
---
M tests/CI/gates.jenkinsfile
M tests/CI/installAsterisk.sh
M tests/CI/periodics-daily.jenkinsfile
M tests/CI/ref_debug.jenkinsfile
M tests/CI/runTestsuite.sh
M tests/CI/unittests.jenkinsfile
6 files changed, 11 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/59/9759/1

diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile
index 78a9d24..ab0fd1c 100644
--- a/tests/CI/gates.jenkinsfile
+++ b/tests/CI/gates.jenkinsfile
@@ -153,7 +153,7 @@
 								img.inside("${dockerOptions} --name ${bt}-${groupName}") {
 
 									lock("${JOB_NAME}.${NODE_NAME}.installer") {
-										sh "sudo ./tests/CI/installAsterisk.sh --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
+										sh "sudo ./tests/CI/installAsterisk.sh --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
 									}
 
 									sh "sudo rm -rf ${groupDir} || : "
diff --git a/tests/CI/installAsterisk.sh b/tests/CI/installAsterisk.sh
index 74f5651..0806566 100755
--- a/tests/CI/installAsterisk.sh
+++ b/tests/CI/installAsterisk.sh
@@ -1,6 +1,8 @@
 #!/usr/bin/env bash
 
 CIDIR=$(dirname $(readlink -fn $0))
+UNINSTALL=0
+UNINSTALL_ALL=0
 source $CIDIR/ci.functions
 
 MAKE=`which make`
@@ -10,6 +12,9 @@
 fi
 destdir=${DESTDIR:+DESTDIR=$DESTDIR}
 
+[ $UNINSTALL -gt 0 ] && ${MAKE} ${destdir} uninstall
+[ $UNINSTALL_ALL -gt 0 ] && ${MAKE} ${destdir} uninstall-all
+
 ${MAKE} ${destdir} install || ${MAKE} ${destdir} NOISY_BUILD=yes install || exit 1
 ${MAKE} ${destdir} samples
 if [ x"$DESTDIR" != x ] ; then
diff --git a/tests/CI/periodics-daily.jenkinsfile b/tests/CI/periodics-daily.jenkinsfile
index 2d72766..8c97379 100644
--- a/tests/CI/periodics-daily.jenkinsfile
+++ b/tests/CI/periodics-daily.jenkinsfile
@@ -99,7 +99,7 @@
 								img.inside("${dockerOptions} --name ${bt}-${groupName}") {
 
 									lock("${JOB_NAME}.${NODE_NAME}.installer") {
-										sh 'sudo ./tests/CI/installAsterisk.sh  --user-group=jenkins:users'
+										sh "sudo ./tests/CI/installAsterisk.sh --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
 									}
 
 									sh "sudo rm -rf ${groupDir} || : "
diff --git a/tests/CI/ref_debug.jenkinsfile b/tests/CI/ref_debug.jenkinsfile
index d046a49..1fa8688 100644
--- a/tests/CI/ref_debug.jenkinsfile
+++ b/tests/CI/ref_debug.jenkinsfile
@@ -77,7 +77,7 @@
 								img.inside("${dockerOptions} --name ${bt}-${groupName}") {
 
 									lock("${JOB_NAME}.${NODE_NAME}.installer") {
-										sh "sudo ./tests/CI/installAsterisk.sh --branch-name=${BRANCH_NAME}  --user-group=jenkins:users"
+										sh "sudo ./tests/CI/installAsterisk.sh  --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
 									}
 
 									sh "sudo rm -rf ${groupDir} || : "
diff --git a/tests/CI/runTestsuite.sh b/tests/CI/runTestsuite.sh
index 0778a2b..4849469 100755
--- a/tests/CI/runTestsuite.sh
+++ b/tests/CI/runTestsuite.sh
@@ -12,8 +12,10 @@
 	$CIDIR/setupRealtime.sh --initialize-db=${INITIALIZE_DB:?0}
 fi
 
+./cleanup-test-remnants.sh || :
 export PYTHONPATH=./lib/python/
 echo "Running tests ${TESTSUITE_COMMAND}"
+
 ./runtests.py --cleanup ${TESTSUITE_COMMAND} | contrib/scripts/pretty_print --no-color --no-timer --term-width=120 --show-errors || :
 
 if [ $REALTIME -eq 1 ] ; then
diff --git a/tests/CI/unittests.jenkinsfile b/tests/CI/unittests.jenkinsfile
index b019bee..82bafff 100644
--- a/tests/CI/unittests.jenkinsfile
+++ b/tests/CI/unittests.jenkinsfile
@@ -138,7 +138,7 @@
 							def outputfile = "${outputdir}/unittests-results.xml"
 							def testcmd = "test execute all"
 
-							sh "sudo ./tests/CI/installAsterisk.sh --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
+							sh "sudo ./tests/CI/installAsterisk.sh --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
 
 							sh "tests/CI/runUnittests.sh --user-group=jenkins:users --output-dir='${outputdir}' --output-xml='${outputfile}' --unittest-command='${testcmd}'"
 

-- 
To view, visit https://gerrit.asterisk.org/9759
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7
Gerrit-Change-Number: 9759
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180727/ef7c66c1/attachment.html>


More information about the asterisk-code-review mailing list