diff options
Diffstat (limited to 'src/build/citest')
-rwxr-xr-x | src/build/citest/autocitest | 64 | ||||
-rwxr-xr-x | src/build/citest/build-script | 185 | ||||
-rwxr-xr-x | src/build/citest/create-sandbox | 4 | ||||
-rwxr-xr-x | src/build/citest/cxxtest-start.sh | 2 | ||||
-rw-r--r-- | src/build/citest/etc/bbuild | 2 | ||||
-rw-r--r-- | src/build/citest/etc/cppcheck | 27 | ||||
-rw-r--r-- | src/build/citest/etc/eecache_prebuilt | 1 | ||||
-rw-r--r-- | src/build/citest/etc/simbuild | 2 | ||||
-rwxr-xr-x | src/build/citest/etc/workarounds.postsimsetup | 7 | ||||
-rwxr-xr-x | src/build/citest/setup-env | 1 |
10 files changed, 223 insertions, 72 deletions
diff --git a/src/build/citest/autocitest b/src/build/citest/autocitest index 0cb8d078f..3e29c414f 100755 --- a/src/build/citest/autocitest +++ b/src/build/citest/autocitest @@ -154,8 +154,11 @@ waitkb timestamp=`date +'%H:%M:%S'` echo "$timestamp Starting autosample test..." -# see simics license usage -tail -n 500 /afs/rch/usr4/dlarson/public/stats/lic_usage.txt | grep hindsight +# see simics license usage. +hindsight_license=$(echo "hindsight_usage-"`date +%Y`-`date +%B`".log") +# show last 4 hours. Gives alittle insight to license usage trends. +#This log file is added to every twenty minutes. There are spaces between each line. 4x2x3=24 lines +tail -n 24 /gsa/ausgsa/projects/s/simics_test/license_logs/$hindsight_license # Run set up in current shell echo "run autosimsetup.." @@ -333,10 +336,11 @@ while [ $(($modsstarted)) -lt 1 -o $(($modsstarted)) -ne $(($modscompleted)) ]; sleep 20 ((loopcount++)) # increment loopcount echo "loopcount = $loopcount" - + date +'%H:%M:%S' echo "modscompleted log command" - echo "autosim $NOWIN --simcmd \"print ((system_cmp0.phys_mem).read 0x$mods_completed_addr 0x08)\" 1> $SBXHOME/modscompleted.log 2> /dev/null" - autosim $NOWIN --simcmd "print ((system_cmp0.phys_mem).read 0x$mods_completed_addr 0x08)" 1> $SBXHOME/modscompleted.log 2> /dev/null + echo "autosim $NOWIN --simcmd \"print ((system_cmp0.phys_mem).read 0x$mods_completed_addr 0x08)\" 1> $SBXHOME/modscompleted.log 2> /dev/null" + autosim $NOWIN --simcmd "print ((system_cmp0.phys_mem).read 0x$mods_completed_addr 0x08)" 1> $SBXHOME/modscompleted.log 2> /dev/null + date +'%H:%M:%S' echo echo "modscompleted command" @@ -344,9 +348,11 @@ while [ $(($modsstarted)) -lt 1 -o $(($modsstarted)) -ne $(($modscompleted)) ]; modscompleted=`cat $SBXHOME/modscompleted.log | awk '/0x/ {print strtonum($1)}'` echo + date +'%H:%M:%S' echo "modsstarted log command" - echo "autosim $NOWIN --simcmd \"print ((system_cmp0.phys_mem).read 0x$mods_started_addr 0x08)\" 1> $SBXHOME/modsstarted.log 2> /dev/null" - autosim $NOWIN --simcmd "print ((system_cmp0.phys_mem).read 0x$mods_started_addr 0x08)" 1> $SBXHOME/modsstarted.log 2> /dev/null + echo "autosim $NOWIN --simcmd \"print ((system_cmp0.phys_mem).read 0x$mods_started_addr 0x08)\" 1> $SBXHOME/modsstarted.log 2> /dev/null" + autosim $NOWIN --simcmd "print ((system_cmp0.phys_mem).read 0x$mods_started_addr 0x08)" 1> $SBXHOME/modsstarted.log 2> /dev/null + date +'%H:%M:%S' echo echo "modsstarted command" @@ -356,18 +362,35 @@ while [ $(($modsstarted)) -lt 1 -o $(($modsstarted)) -ne $(($modscompleted)) ]; echo "ModulesStarted:ModulesCompleted => $modsstarted:$modscompleted" - # @TODO RTC:149210 temporary fix for autosim hangs on real code errors. For some reason - # when we hit an actual bug and simics halts, the autosim commands hang - # causing this loop to take >8 hours. - if [ -z $modsstarted ] && [ -z $modscompleted ]; then - echo "ERROR: autosim hanging on real code errors, temporarily catching early" - echo "See archived hbTracMerg for more info" - exit 1 + # For code coverage, sometimes simics takes a while to respond as it dumps data. + # Allow it to continue if this condition is seen. + if [[ -z "${HOSTBOOT_PROFILE}" ]]; then + # @TODO RTC:149210 temporary fix for autosim hangs on real code errors. For some reason + # when we hit an actual bug and simics halts, the autosim commands hang + # causing this loop to take >8 hours. + if [ -z $modsstarted ] && [ -z $modscompleted ]; then + echo "ERROR: autosim hanging on real code errors, temporarily catching early" + echo "See archived hbTracMerg for more info" + exit 1 + fi + fi + + if [[ -z "${HOSTBOOT_PROFILE}" ]]; then + if [[ "$CHIP" == "AXONE" ]]; then + # 75 minutes for axone + loop_timeout=225 + else + # 50 minutes by default + loop_timeout=150 + fi + else + # Increase timeout to 166 minutes for code coverage + loop_timeout=500 fi - if [ "$loopcount" -ge 150 ]; then + if [ "$loopcount" -ge "$loop_timeout" ]; then timestamp=`date +'%H:%M:%S'` - echo "$timestamp ERROR: timed out after 50 minutes waiting for until test completion" + echo "$timestamp ERROR: timed out waiting for until test completion" autosim $NOWIN --simcmd "hb-Ps with-backtrace" timeout=$(($modsstarted - $modscompleted)) break @@ -467,6 +490,15 @@ if [ $? -ne 0 ] ; then echo "ERROR: Unable to run $?" fi +if [[ ! -z "${HOSTBOOT_PROFILE}" ]]; then + # After simics test are complete, dump data. + echo "====> hb-Gcov..." + autosim $NOWIN --simcmd "hb-Gcov" --timeout 300 + if [ $? -ne 0 ] ; then + echo "ERROR: Unable to run $?" + fi +fi + ######################################################## ## done. Stop the simulation ######################################################## diff --git a/src/build/citest/build-script b/src/build/citest/build-script index 7510d76c9..7198ed5b2 100755 --- a/src/build/citest/build-script +++ b/src/build/citest/build-script @@ -24,10 +24,62 @@ # # IBM_PROLOG_END_TAG +usage=" +$(basename "$0") [-h|--help] [--skipCxxTests] [--skipCopyrightCheck] + +Description: + The original use of this script was for the Hostboot standalone CI job, + so by default it will run a copyright check, then compile hostboot and + populate an ODE sandbox and run the CXX test suite in standalone simics. + + Flags have been added to skip the copyright checks and the cxx tests + for cases where we only want to get a populated sandbox. + +Expectations: + This script is expected to be ran from the top level of the + hostboot directory. (ie src/build/citest/build-script <params>). It will + look at env variables PROJECT_ROOT, WORKSPACE, SANDBOXNAME, SANDBOXROOT, + CHIP, PNOR, CONFIG_FILE, and HOSTBOOT_PROFILE. + +Optional Flags: + -h|--help shows this help text + --skipCxxTests skips the execution of the cxx test suite + --skipCopyrightCheck skips the execution of the copyright check +" + if [ -z $PROJECT_ROOT ]; then source "$WORKSPACE/env.bash" fi +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + --skipCopyrightCheck) + SKIP_CR_CHECK=1 + shift # past argument + ;; + --skipCxxTests) + SKIP_CXX_TESTS=1 + shift # past argument + ;; + -h|--help) + echo "$usage" + exit 0 + ;; + *) + echo " +!!! Invalid argument \"$1\" passed into ${0} !!!!" + echo "$usage" + exit 22 + ;; +esac +done + +echo "SKIP_CR_CHECK = ${SKIP_CR_CHECK}" +echo "SKIP_CXX_TESTS = ${SKIP_CXX_TESTS}" + source "$PROJECT_ROOT/src/build/citest/setup-env" echo "#--------------------------------" echo "SANDBOXROOT=$SANDBOXROOT" @@ -41,32 +93,49 @@ echo "#--------------------------------" # Force simics into Secure Mode export SECURITY_HW_POLICY="1" -# Check copyright. -check-copyright > copyright.log 2>&1 -if [ $? -eq 0 ]; then - echo "----Copyright check succeeded." - cat copyright.log -else - echo "----Copyright check failed." - cat copyright.log - exit -1 +if [ -z "$SKIP_CR_CHECK" ]; then + # Check copyright. + check-copyright > copyright.log 2>&1 + if [ $? -eq 0 ]; then + echo "----Copyright check succeeded." + cat copyright.log + else + echo "----Copyright check failed." + cat copyright.log + exit -1 + fi fi - # Create simics sandbox. create-sandbox > create-sandbox.log 2>&1 & CREATESANDBOX_PID=$! -my_date=$(date) -# Build Hostboot. +# normal build is empty quotes +build_opt="" +# code coverage +if [[ ! -z "${HOSTBOOT_PROFILE}" ]]; then + build_opt="gcov" +# static analysis +elif [[ ! -z "${HOSTBOOT_CPPCHECK}" ]]; then + build_opt="cppcheck" + COMPILE_ONLY=1 +fi +# Build Hostboot +start_time=$(date) echo "#--------------------------------" -printf "\n\n$(date): STARTED running \"make -j32\"\n\n" +printf "\n\n$(date): STARTED running \"make -j32 $build_opt\"\n\n" echo "#--------------------------------" -make -j32 || exit -1 +make -j32 $build_opt || exit -1 +make_rc=$? echo "#--------------------------------" -printf "\n\nrc=$?: $(date): FINISHED running (\"make -j32\" was started at $my_date)\n\n" +printf "\n\nrc=$make_rc: $(date): FINISHED running (\"make -j32 $build_opt\" was started at $start_time)\n\n" echo "#--------------------------------" +if [[ ! -z "${COMPILE_ONLY}" ]]; then + echo "Compile only" + exit $make_rc +fi + # Check sandbox create completion. wait $CREATESANDBOX_PID if [ $? -eq 0 ]; then @@ -79,48 +148,62 @@ else fi # Add Hostboot files to simics sandbox. -my_date=$(date) +start_time=$(date) echo "#--------------------------------" -printf "\n\n$(date): STARTED running populate-sandbox....\n\n" +printf "\n\n$start_time: STARTED running populate-sandbox....\n\n" echo "#--------------------------------" populate-sandbox || exit -1 echo "#--------------------------------" -printf "\n\nrc=$?: $(date): FINISHED running (\"populate-sandbox\" was started at $my_date)\n\n" +printf "\n\nrc=$?: $(date): FINISHED running (\"populate-sandbox\" was started at $start_time)\n\n" echo "#--------------------------------" -if [ "$CHIP" == "FSPBUILD" ]; -then - # Start errl parser building. - my_date=$(date) - printf "\n\n$(date): STARTED running \"build-errl-parsers\"\n\n" - build-errl-parsers > errl-parsers.log 2>&1 & - ERRLPARSERS_PID=$! - - # Check errl parser completion. - wait $ERRLPARSERS_PID - if [ $? -ne 0 ]; then - echo "----Error parsers failed." - cat errl-parsers.log - exit -1 - else - printf "\n\n$(date): FINISHED running (\"build-errl-parsers\" was started at $my_date)\n\n" - fi - - -else - printf "2) CHIP=$CHIP" - echo "CHIP3=$CHIP" - - - # Start CxxTest Simics execution. - my_date=$(date) - echo "#--------------------------------" - printf "\n\n$(date): STARTED running cxxtest-start.sh....\n\n" - echo "#--------------------------------" - cxxtest-start.sh || exit -1 - echo "#--------------------------------" - printf "\n\nrc=$?: $(date): FINISHED running (\"cxxtest-start.sh\" was started at $my_date)\n\n" - echo "#--------------------------------" +if [ -z "$SKIP_CXX_TESTS" ]; then + + if [ "$CHIP" == "FSPBUILD" ]; then + # Start errl parser building. + start_time=$(date) + printf "\n\n$start_time: STARTED running \"build-errl-parsers\"\n\n" + build-errl-parsers > errl-parsers.log 2>&1 & + ERRLPARSERS_PID=$! + + # Check errl parser completion. + wait $ERRLPARSERS_PID + if [ $? -ne 0 ]; then + echo "----Error parsers failed." + cat errl-parsers.log + exit -1 + else + printf "\n\n$(date): FINISHED running (\"build-errl-parsers\" was started at $start_time)\n\n" + fi + + + else + printf "2) CHIP=$CHIP" + echo "CHIP3=$CHIP" + + # Start CxxTest Simics execution. + start_time=$(date) + echo "#--------------------------------" + printf "\n\n$start_time: STARTED running cxxtest-start.sh....\n\n" + echo "#--------------------------------" + cxxtest-start.sh || exit -1 + echo "#--------------------------------" + printf "\n\nrc=$?: $(date): FINISHED running (\"cxxtest-start.sh\" was started at $start_time)\n\n" + echo "#--------------------------------" + + fi fi +if [[ ! -z "${HOSTBOOT_PROFILE}" ]]; then + # Generate the code coverage report. Located obj/gcov_report + # Jenkins will artifact and can display html report + start_time=$(date) + echo "#--------------------------------" + printf "\n\n$start_time: STARTED running \"make lcov\"\n\n" + echo "#--------------------------------" + make lcov || exit -1 + echo "#--------------------------------" + printf "\n\nrc=$?: $(date): FINISHED running (\"make lcov\" was started at $start_time)\n\n" + echo "#--------------------------------" +fi diff --git a/src/build/citest/create-sandbox b/src/build/citest/create-sandbox index 0018e4422..b07158f02 100755 --- a/src/build/citest/create-sandbox +++ b/src/build/citest/create-sandbox @@ -78,11 +78,15 @@ if [ "$MACHINE" != "NIMBUS" ] && [ "$MACHINE" != "CUMULUS" ] && \ [ "$MACHINE" != "CUMULUS_CDIMM" ] && [ "$MACHINE" != "FSPBUILD" ]; then SIMICS_LEVEL=`cat ${PROJECT_ROOT}/src/build/citest/etc/simbuild` + EECACHE_PREBUILT=`cat ${PROJECT_ROOT}/src/build/citest/etc/eecache_prebuilt` echo "mkdir -p ${SANDBOXBASE}/simics" execute_in_sandbox "mkdir -p ${SANDBOXBASE}/simics" "ppc" echo "tar ${SIMICS_LEVEL} -C ${SANDBOXBASE}/simics/" execute_in_sandbox "tar -xf ${SIMICS_LEVEL} -C ${SANDBOXBASE}/simics/" "ppc" + echo "cd ${SANDBOXBASE}/simics/ && ./INSTALL.sh" execute_in_sandbox "cd ${SANDBOXBASE}/simics/ && ./INSTALL.sh" "ppc" + echo "cp ${EECACHE_PREBUILT} ${SANDBOXBASE}/simics/eecache_prebuilt.bin.ecc" + execute_in_sandbox "cp ${EECACHE_PREBUILT} ${SANDBOXBASE}/simics/eecache_prebuilt.bin.ecc" "ppc" else execute_in_sandbox "start_simics -no_start -machine $MACHINE -batch_mode" \ "ppc" || exit -1 diff --git a/src/build/citest/cxxtest-start.sh b/src/build/citest/cxxtest-start.sh index dcb25c201..b34c744d8 100755 --- a/src/build/citest/cxxtest-start.sh +++ b/src/build/citest/cxxtest-start.sh @@ -38,7 +38,7 @@ if [ "$MACHINE" != "NIMBUS" ] && [ "$MACHINE" != "CUMULUS" ] && \ [ "$MACHINE" != "CUMULUS_CDIMM" ] && [ "$MACHINE" != "FSPBUILD" ]; then export PATH=$PATH:$SANDBOXBASE/simics/ - export START_SIMICS_CMD="runsim -m $MACHINE hb_script_to_run=$SANDBOXBASE/obj/ppc/simu/scripts/hbfw/startup.simics pnor_img=$SANDBOXBASE/obj/ppc/hbfw/img/axone.pnor sbe_seeprom_img=$SANDBOXBASE/images/ppc/lab/flash/sbe_seeprom_p9a_10.bin.ecc num_procs=1 vpd_proc=vpd/images/99a8c3fe4e5c74798f5bd4212f3d9a2a" + export START_SIMICS_CMD="runsim -m $MACHINE hb_script_to_run=$SANDBOXBASE/obj/ppc/simu/scripts/hbfw/startup.simics pnor_img=$SANDBOXBASE/obj/ppc/hbfw/img/axone.pnor sbe_seeprom_img=$SANDBOXBASE/images/ppc/lab/flash/sbe_seeprom_p9a_10.bin.ecc num_procs=2 enable_lpc_console=TRUE" fi # Front end to autocitest - script to execute unit tests under simics. diff --git a/src/build/citest/etc/bbuild b/src/build/citest/etc/bbuild index 873e0f4bd..a6ac16e07 100644 --- a/src/build/citest/etc/bbuild +++ b/src/build/citest/etc/bbuild @@ -1 +1 @@ -/esw/fips930/Builds/b0121a_1904.930 +/esw/fips940/Builds/b0516a_1921.940 diff --git a/src/build/citest/etc/cppcheck b/src/build/citest/etc/cppcheck new file mode 100644 index 000000000..f92ac3604 --- /dev/null +++ b/src/build/citest/etc/cppcheck @@ -0,0 +1,27 @@ +#!/bin/bash +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/build/citest/etc/cppcheck $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2019 +# [+] International Business Machines Corp. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG + +export CPPCHECK_COMMIT="4939e0c3086151033bd491bb2df72f7728a4c037" diff --git a/src/build/citest/etc/eecache_prebuilt b/src/build/citest/etc/eecache_prebuilt new file mode 100644 index 000000000..e7ff59666 --- /dev/null +++ b/src/build/citest/etc/eecache_prebuilt @@ -0,0 +1 @@ +/gsa/ausgsa/projects/h/hostboot/eecache_prebuilt/10_02_19_eecache_prebuilt.bin.ecc diff --git a/src/build/citest/etc/simbuild b/src/build/citest/etc/simbuild index 31d4a6f2e..ba464d4c5 100644 --- a/src/build/citest/etc/simbuild +++ b/src/build/citest/etc/simbuild @@ -1 +1 @@ -/gsa/ausgsa/projects/h/hostboot/simbuild/04_08_19_973eb4_simics.tar.gz +/gsa/ausgsa/projects/h/hostboot/simbuild/axone/2019-11-11_f0c353_simics.tar.gz diff --git a/src/build/citest/etc/workarounds.postsimsetup b/src/build/citest/etc/workarounds.postsimsetup index d904f6c3b..26cc2bd03 100755 --- a/src/build/citest/etc/workarounds.postsimsetup +++ b/src/build/citest/etc/workarounds.postsimsetup @@ -6,7 +6,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2011,2019 +# Contributors Listed Below - COPYRIGHT 2011,2020 # [+] International Business Machines Corp. # # @@ -39,5 +39,8 @@ mkdir -p $sb/simu/configs/ grep -v PROC_EC $BACKING_BUILD/src/simu/configs/P9_NIMBUS.config > $sb/simu/configs/P9_NIMBUS.config echo "SETENV PROC_EC 22" >> $sb/simu/configs/P9_NIMBUS.config +# TODO RTC:215621 +# remove when simics gets dimmspd.dat updated +mkdir -p $sb/../simics/import/vpd/ +cp /gsa/ausgsa/projects/h/hostboot/.binary_cache/data/f6f5b778c406883e1b392b311350a1e83583e15a $sb/../simics/import/vpd/dimmspd.dat -########################################################################## diff --git a/src/build/citest/setup-env b/src/build/citest/setup-env index 21133ef67..e82032d8a 100755 --- a/src/build/citest/setup-env +++ b/src/build/citest/setup-env @@ -26,6 +26,7 @@ export CITESTPATH=${PROJECT_ROOT}/src/build/citest export PATH=${CITESTPATH}:${PATH} +export CXXPATH=/opt/rh/devtoolset-3/root/usr/bin # Determine backing build. export BACKING_BUILD=`cat ${CITESTPATH}/etc/bbuild` |