From f07c9fd883db75f10b1f9692e6e8476674311f6f Mon Sep 17 00:00:00 2001 From: Dale Henrichs Date: Wed, 21 Oct 2020 12:12:14 -0700 Subject: [PATCH] Issue #295: add -W option to upgradeStone that enables TOPAZWAITFORDEBUG during upgrade to allow remote debugging with DEBUGGEM ... add hooks into tests for this option (env var TOPAZWAITFORDEBUG) for use when running tests interactively --- bin/upgradeStone | 14 +++++++++++--- tests/testTravisCI.sh | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bin/upgradeStone b/bin/upgradeStone index 58a54a1f..5c9a872f 100755 --- a/bin/upgradeStone +++ b/bin/upgradeStone @@ -12,7 +12,7 @@ start_banner usage() { cat <] [-l ] - [-m ] [-U ] [-P ] + [-m ] [-U ] [-P ] [-W] OPTIONS @@ -42,6 +42,8 @@ OPTIONS -P Use as the password for the user specified in -U option. Default password is swordfish. If -U not specified the -P option has no effect. + -W + enable TOPAZWAITFORDEBUG, to allow remote debugging via DEBUGGEM (3.6.x upgrades only) EXAMPLES $(basename $0) -h @@ -72,7 +74,8 @@ hasSnapshotFile="false" tempObjCacheSize="100000" gemstoneUserId="DataCurator" gemstonePassword="swordfish" -while getopts "cfhl:s:um:U:P:" OPT ; do +topazWaitForDebug="" +while getopts "cfhl:s:um:U:P:W" OPT ; do case "$OPT" in h) usage; exit 0;; c) runUpgrade="false";; @@ -86,6 +89,7 @@ while getopts "cfhl:s:um:U:P:" OPT ; do u) createStone="false";; U) gemstoneUserId="${OPTARG}";; P) gemstonePassword="${OPTARG}";; + W) topazWaitForDebug=" -W ";; *) usage; exit_1_banner "Uknown option";; esac done @@ -228,9 +232,13 @@ EOF echo "Seaside Upgrade completed. No errors detected." ;; 3.5.*|3.6.*) + case "$gsvers" in + 3.5.*) remoteDebugFlag="";; # remote debugging flag is not available in 3.5.x + *) remoteDebugFlag="$topazWaitForDebug" ;; + esac set +e upgradeScript=$GEMSTONE/upgrade/createGsDevKit_upgrade.topaz - "$GEMSTONE/seaside/bin/upgradeSeasideImage" -c $tempObjCacheSize -s $targetStoneName -u $gemstoneUserId -p $gemstonePassword -P $upgradeScript >> $upgradeLogDir/topaz.out 2>&1 << EOF + "$GEMSTONE/seaside/bin/upgradeSeasideImage" -c $tempObjCacheSize -s $targetStoneName -u $gemstoneUserId -p $gemstonePassword -P $upgradeScript $remoteDebugFlag >> $upgradeLogDir/topaz.out 2>&1 << EOF EOF status=$? diff --git a/tests/testTravisCI.sh b/tests/testTravisCI.sh index f131daa6..f54ea0db 100755 --- a/tests/testTravisCI.sh +++ b/tests/testTravisCI.sh @@ -97,7 +97,7 @@ case $TEST in createStone $opt ${STONENAME1}_${UPGRADE_FROM} ${UPGRADE_FROM} upgradeStoneName="${STONENAME1}_${GS_VERSION}" set +e - upgradeStone -f ${STONENAME1}_${UPGRADE_FROM} ${STONENAME1}_${GS_VERSION} $GS_VERSION << EOF + upgradeStone -f ${TOPAZWAITFORDEBUG} ${STONENAME1}_${UPGRADE_FROM} ${STONENAME1}_${GS_VERSION} $GS_VERSION << EOF EOF status=$?