]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
runUnittests.sh: Save coredumps to proper directory
authorGeorge Joseph <gjoseph@digium.com>
Wed, 2 Nov 2022 14:24:22 +0000 (08:24 -0600)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Wed, 2 Nov 2022 17:01:45 +0000 (12:01 -0500)
Fixed the specification of "outputdir" when calling ast_coredumper
so the txt files are saved in the correct place.

ASTERISK-30282

Change-Id: Ic631cb90c1e4c29d970c982dff45fda5e0eb15b6

tests/CI/runUnittests.sh

index e2d7e45a7ed959adbefeb2b76da62f95087194cd..b929c542b0501e61d2acba02f34a2b43757136a4 100755 (executable)
@@ -52,7 +52,7 @@ run_tests_socket() {
 
 # If DESTDIR is used to install and run asterisk from non standard locations,
 # the directory entries in asterisk.conf need to be munged to prepend DESTDIR.
-ALTERED=$(head -10 ../tmp/DESTDIR/etc/asterisk/asterisk.conf | grep -q "DESTDIR" && echo yes)
+ALTERED=$(head -10 "$ASTETCDIR/asterisk.conf" | grep -q "DESTDIR" && echo yes)
 if [ x"$ALTERED" = x ] ; then
        # In the section that starts with [directories and ends with a blank line,
        # replace "=> " with "=> ${DESTDIR}"
@@ -119,7 +119,7 @@ else
 fi
 
 # Cleanup "just in case"
-sudo killall -qe -ABRT $ASTERISK 
+sudo killall -qe -ABRT $ASTERISK
 
 runner rsync -vaH $DESTDIR/var/log/asterisk/. $OUTPUTDIR
 set +x
@@ -128,11 +128,11 @@ set +x
 
 for core in $(asterisk_corefile_glob)
 do
-       if [ -f $core ]
+       if [ -f "$core" ] && [ "${core##*.}" != "txt" ]
        then
                echo "*** Found a core file ($core) after running unit tests ***"
                set -x
-               sudo OUTPUTDIR=$OUTPUTDIR $DESTDIR/var/lib/asterisk/scripts/ast_coredumper --no-default-search $core
+               sudo $DESTDIR/var/lib/asterisk/scripts/ast_coredumper --outputdir=$OUTPUTDIR --no-default-search $core
        fi
 done