diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2018-02-08 14:36:25 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2018-02-08 14:36:25 +0000 |
commit | 82d551a7a338c5459f39b7135beb784cadbb06d3 (patch) | |
tree | 6529760a61f6b8e590d5ad44950655658193c973 | |
parent | 7ef4e3212b76165aff12b9c8de8855b3d526f649 (diff) |
build-linux.sh: Use new lava-boot.py script.
Change-Id: I4d1bdf10eadf0214b12c6da29360f8654713cec5
-rwxr-xr-x | build-linux.sh | 98 |
1 files changed, 10 insertions, 88 deletions
diff --git a/build-linux.sh b/build-linux.sh index 01293f1..7a75a42 100755 --- a/build-linux.sh +++ b/build-linux.sh @@ -93,24 +93,6 @@ jobs= if $boot ; then # To get LAVA_XXX variables . ${mydir}/.env - export PUBLISH_TOKEN # Needed by linaro-cp.py - - sudo apt-get update - # Install lava-tool if not already present - if ! type lava-tool ; then - sudo apt-get install -y --no-install-recommends lava-tool - fi - - # Clone lci-build-tools if not already done - if [ ! -d lci-build-tools ]; then - git clone --depth 1 https://git.linaro.org/ci/lci-build-tools - fi - - # Get linaro-cp.py if not already present - if [ ! -f linaro-cp.py ]; then - sudo apt-get install -y --no-install-recommends python-requests - wget https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O ./linaro-cp.py - fi fi lava_boot() @@ -136,42 +118,13 @@ lava_boot() ;; esac - # Upload to s.l.o - dry_run_opt="" - #dry_run_opt="--dry-run" - rm -rf out - mkdir out - cp $DTB $KERNEL out/ - BUILDID=${config}-${BUILD_NUMBER} - SNAPSHOTS=components/toolchain/validation/${BUILDID} - upload=0 - - time python ./linaro-cp.py $dry_run_opt --api_version 3 \ - out/ $SNAPSHOTS/ || upload=1 - - # We don't want to exit early if the upload failed, but keep - # iterating on kernel builds at least. - if [ $upload -eq 1 ]; then - return - fi - - DTB_URL=https://snapshots.linaro.org/${SNAPSHOTS}/$(basename ${DTB}) - KERNEL_URL=https://snapshots.linaro.org/${SNAPSHOTS}/zImage - - yaml=custom_lava_job_definition.yaml - sed -e "s|\${DTB_URL}|${DTB_URL}|" \ - -e "s|\${KERNEL_URL}|${KERNEL_URL}|" \ - -e "s|\${DEVICE_TYPE}|${DEVICE_TYPE}|" \ - < ${mydir}/tcwg-linux-lava-job-definition.yaml \ - > ${yaml} - - ./lci-build-tools/yaml-to-json.py "${yaml}" > lava-jobdef.json - rm -f "${yaml}" - - result=$(lava-tool submit-job http://${LAVA_USER}:${LAVA_TOKEN}@${LAVA_SERVER}/RPC2 lava-jobdef.json 2>&1) + # lava_boot.py works only when started from its own dir + pushd ${mydir} + result=$(python3 ./lava-boot.py --board ${DEVICE_TYPE} --linux-image app_linux/linux/$KERNEL --linux-dtb app_linux/linux/$DTB starttest | grep "INFO job") + popd case "$result" in - "submitted as job id: "*) + *"INFO job"*) job=`echo $result | awk '{print $5;}'` ;; *) @@ -228,50 +181,19 @@ if $boot ; then failed_jobs= for job in $jobs do - this_lava_result=FAILED - while true - do - # For the moment we use polling to check if a lava job completed - sleep 60 - lava_status=$(lava-tool job-status http://${LAVA_USER}:${LAVA_TOKEN}@${LAVA_SERVER}/RPC2 ${job} | grep "Job Status:" | awk '{print $3;}') - case ${lava_status} in - Submitted) - # Still pending, keep waiting - ;; - Running) - # Still running, keep waiting - ;; - Complete) - # Job ran, we need to check the actual results - this_lava_result=PASS - break - ;; - Incomplete) - # Job failed to run for some reason - break - ;; - Canceled) - # Job canceled to run for some reason - break - ;; - Canceling) - # Still running, keep waiting - ;; - *) - ;; - esac - done + this_lava_result=0 + python3 ${mydir}/lava-boot.py --job_id ${job} wait || this_lava_result=$? # If the job completed, check that the individual tests were successful - if [ "$this_lava_result" = "PASS" ]; then + if [ "$this_lava_result" = "0" ]; then rm -f csv wget https://${LAVA_SERVER}/results/${job}/csv # linux-linaro-ubuntu-lsb_release fails because lsb_release is not # in the rootfs, so ignore this failure - cat csv | grep -v linux-linaro-ubuntu-lsb_release | awk -F, '{print $3;}' | grep -i fail && this_lava_result=FAILED + cat csv | grep -v linux-linaro-ubuntu-lsb_release | awk -F, '{print $3;}' | grep -i fail && this_lava_result=1 fi - if [ "$this_lava_result" = "FAILED" ]; then + if [ "$this_lava_result" = "1" ]; then global_lava_result=FAILED failed_jobs="${failed_jobs} $job" fi |