[Asterisk-code-review] CI: Look up configured kernel.core pattern sysctl (asterisk[13])
Sean Bright
asteriskteam at digium.com
Wed Oct 3 09:33:42 CDT 2018
Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/10407
Change subject: CI: Look up configured kernel.core_pattern sysctl
......................................................................
CI: Look up configured kernel.core_pattern sysctl
Change-Id: I8246a0147df8d821fbbcabc1db1887104b8bedc4
---
M tests/CI/runUnittests.sh
1 file changed, 16 insertions(+), 2 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/07/10407/1
diff --git a/tests/CI/runUnittests.sh b/tests/CI/runUnittests.sh
index 1d2656b..a3d7a3a 100755
--- a/tests/CI/runUnittests.sh
+++ b/tests/CI/runUnittests.sh
@@ -3,6 +3,18 @@
source $CIDIR/ci.functions
ASTETCDIR=$DESTDIR/etc/asterisk
+asterisk_core_base() {
+ local pattern=$(/sbin/sysctl -n kernel.core_pattern)
+
+ # If core_pattern is a pipe there isn't much we can do
+ if [[ ${pattern:0:1} == "|" ]]
+ then
+ echo "core*"
+ else
+ echo "${pattern%%%*}*"
+ fi
+}
+
cat <<-EOF > "$ASTETCDIR/logger.conf"
[logfiles]
full => notice,warning,error,debug,verbose
@@ -69,8 +81,10 @@
set +x
[ x"$USER_GROUP" != x ] && sudo chown -R $USER_GROUP $OUTPUTDIR
-if [ -f core* ] ; then
+
+corepatt = $(asterisk_core_base)
+if [ -f $corepatt ] ; then
echo "*** Found a core file after running unit tests ***"
- $DESTDIR/var/lib/asterisk/scripts/ast_coredumper --no-default-search core*
+ $DESTDIR/var/lib/asterisk/scripts/ast_coredumper --no-default-search $corepatt
exit 1
fi
--
To view, visit https://gerrit.asterisk.org/10407
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8246a0147df8d821fbbcabc1db1887104b8bedc4
Gerrit-Change-Number: 10407
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181003/ac861990/attachment-0001.html>
More information about the asterisk-code-review
mailing list