diff options
author | Jan-Simon Möller <jsmoeller@linuxfoundation.org> | 2017-03-09 02:50:07 +0100 |
---|---|---|
committer | Jan-Simon Möller <jsmoeller@linuxfoundation.org> | 2017-03-09 02:50:07 +0100 |
commit | 015efa7d10ac488730001eccfa43db64f97e6cd1 (patch) | |
tree | d521790bb323d81ec3d2642e2763f0912016e9d4 /jjb | |
parent | a238dfd8589b52074b987c5d534194585b0e0cbc (diff) |
Add hardware test for release build
Change-Id: I8d57767974ebc00c4fa5014a8e82f7eae099650e
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/common/OLD/include-agl-test-nbd-short.sh (renamed from jjb/common/include-agl-test-nbd-short.sh) | 0 | ||||
-rw-r--r-- | jjb/common/include-agl-header.sh | 5 | ||||
-rw-r--r-- | jjb/common/include-agl-run-test-rsync-changeid.sh | 6 | ||||
-rw-r--r-- | jjb/common/include-agl-run-test-rsync-release.sh | 38 | ||||
-rw-r--r-- | jjb/common/include-agl-run-test-short-release.sh | 129 | ||||
-rw-r--r-- | jjb/release-jjb-chinook-snapshot/release-jjb-chinook-snapshot.yaml | 6 |
6 files changed, 176 insertions, 8 deletions
diff --git a/jjb/common/include-agl-test-nbd-short.sh b/jjb/common/OLD/include-agl-test-nbd-short.sh index ed50503f..ed50503f 100644 --- a/jjb/common/include-agl-test-nbd-short.sh +++ b/jjb/common/OLD/include-agl-test-nbd-short.sh diff --git a/jjb/common/include-agl-header.sh b/jjb/common/include-agl-header.sh index 7268ebce..e6ca163f 100644 --- a/jjb/common/include-agl-header.sh +++ b/jjb/common/include-agl-header.sh @@ -38,6 +38,11 @@ export TARGETIMAGEnogfx="core-image-minimal" export TARGETSDK="populate_sdk" +export TARGETMACHINE=${MACHINE} +if test x"porter-nogfx" = x"${MACHINE}" ; then + export TARGETMACHINE="porter" +fi + # apply GERRIT_* if test -n "${GERRIT_PROJECT}"; then export TARGETPROJECT="${GERRIT_PROJECT}" diff --git a/jjb/common/include-agl-run-test-rsync-changeid.sh b/jjb/common/include-agl-run-test-rsync-changeid.sh index 170c6bf1..64165553 100644 --- a/jjb/common/include-agl-run-test-rsync-changeid.sh +++ b/jjb/common/include-agl-run-test-rsync-changeid.sh @@ -25,12 +25,6 @@ cd output pwd ls -alhR tmp/deploy/images -export TARGETMACHINE=${MACHINE} -if test x"porter-nogfx" = x"${MACHINE}" ; then -export TARGETMACHINE="porter" -fi - - # copy files to $DEST for i in DEVICE_DTB DEVICE_KERNEL DEVICE_INITRAMFS DEVICE_NBDROOT; do eval cp -avL tmp/deploy/images/${TARGETMACHINE}/$(echo "$"${i}) ${DEST}/ diff --git a/jjb/common/include-agl-run-test-rsync-release.sh b/jjb/common/include-agl-run-test-rsync-release.sh new file mode 100644 index 00000000..85605494 --- /dev/null +++ b/jjb/common/include-agl-run-test-rsync-release.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#set -x +set -e + +echo "\n\n\n" +echo "#########################################" +echo "\n\n\n" + + +export RSYNCDST="/srv/download/AGL/upload/ci/${RELEASE_BRANCH}/${RELEASE_VERSION}" +export RSYNCSRC=$(pwd)/UPLOAD/ + +# construct upload folder +mv UPLOAD UPLOAD2 || true +rm -rf UPLOAD2 || true +mkdir -p UPLOAD/${MACHINE} +export DEST=$(pwd)/UPLOAD/${MACHINE} + + +cd $REPODIR + +cd output + +pwd +ls -alhR tmp/deploy/images + +# copy files to $DEST +for i in DEVICE_DTB DEVICE_KERNEL DEVICE_INITRAMFS DEVICE_NBDROOT; do + eval cp -avL tmp/deploy/images/${TARGETMACHINE}/$(echo "$"${i}) ${DEST}/ +done + +tree $DEST +ls -alhR $DEST + +ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 mkdir -p ${RSYNCDST} + +rsync -avr -L -e "ssh -o StrictHostKeyChecking=no" $RSYNCSRC jenkins-slave@10.30.72.8:$RSYNCDST diff --git a/jjb/common/include-agl-run-test-short-release.sh b/jjb/common/include-agl-run-test-short-release.sh new file mode 100644 index 00000000..11cfc5a1 --- /dev/null +++ b/jjb/common/include-agl-run-test-short-release.sh @@ -0,0 +1,129 @@ +# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de +# License GPLv2 + +################################################################################ +## Run SHORT CI test +################################################################################ + + +set -x + +echo "## ${MACHINE} ##" +cd $REPODIR + +echo "default keyring config" +mkdir -p ~/.local/share/python_keyring/ +cat <<EOF > ~/.local/share/python_keyring/keyringrc.cfg +[backend] +default-keyring=keyring.backends.file.PlaintextKeyring +EOF + +cat <<EOF > ~/.local/token +$AGLLAVATOKEN +EOF + +lava-tool auth-add --token-file ~/.local/token https://agl-jenkins-user@porter.automotivelinux.org +rm ~/.local/token + +echo "## $TESTJOBFILE ##" + +if [ -e $TESTJOBFILE ] ; then + echo "Using $TESTJOBFILE ..." + cp $TESTJOBFILE testjob.yaml +else + echo "!! NO TESTJOBFILE - trying to continue with a default !!" +fi + +cat <<EOF > testjob.yaml +# Your first LAVA JOB definition for a $MACHINE board +device_type: @REPLACE_DEVICE_TYPE@ +job_name: AGL-short-smoke + +protocols: + lava-xnbd: + port: auto + +timeouts: + job: + minutes: 30 + action: + minutes: 15 + connection: + minutes: 5 +priority: medium +visibility: public + +# ACTION_BLOCK +actions: +- deploy: + timeout: + minutes: 10 + to: nbd + dtb: + url: '@REPLACE_URL_PREFIX@/@REPLACE_DTB@' + kernel: + url: '@REPLACE_URL_PREFIX@/@REPLACE_KERNEL@' + initrd: + url: '@REPLACE_URL_PREFIX@/@REPLACE_INITRAMFS@' + allow_modify: false + nbdroot: + url: '@REPLACE_URL_PREFIX@/@REPLACE_NBDROOT@' + compression: @REPLACE_NBDROOT_COMPRESSION@ + os: debian + failure_retry: 2 + +# BOOT_BLOCK +- boot: + method: @REPLACE_BOOT_METHOD@ + commands: nbd + type: @REPLACE_BOOT_TYPE@ + prompts: ["root@@REPLACE_MACHINE@:~"] + auto_login: + login_prompt: "login:" + username: root + +EOF + +CHID=${RELEASE_BRANCH}/${RELEASE_VERSION}/${MACHINE} +# REPLACE_DEVICE_TYPE +sed -i -e "s#@REPLACE_DEVICE_TYPE@#${DEVICE_TYPE}#g" testjob.yaml +sed -i -e "s#@REPLACE_DTB@#${CHID}/${DEVICE_DTB}#g" testjob.yaml +sed -i -e "s#@REPLACE_KERNEL@#${CHID}/${DEVICE_KERNEL}#g" testjob.yaml +sed -i -e "s#@REPLACE_INITRAMFS@#${CHID}/${DEVICE_INITRAMFS}#g" testjob.yaml +sed -i -e "s#@REPLACE_NBDROOT@#${CHID}/${DEVICE_NBDROOT}#g" testjob.yaml +sed -i -e "s#@REPLACE_NBDROOT_COMPRESSION@#${DEVICE_NBDROOT_COMPRESSION}#g" testjob.yaml +sed -i -e "s#@REPLACE_BOOT_METHOD@#${DEVICE_BOOT_METHOD}#g" testjob.yaml +sed -i -e "s#@REPLACE_BOOT_TYPE@#${DEVICE_BOOT_TYPE}#g" testjob.yaml +sed -i -e "s#@REPLACE_MACHINE@#${DEVICE_NAME}#g" testjob.yaml +sed -i -e "s#@REPLACE_URL_PREFIX@#${DEVICE_URL_PREFIX}#g" testjob.yaml + +cat testjob.yaml + +lava-tool submit-job --block https://agl-jenkins-user@porter.automotivelinux.org testjob.yaml | tee .myjob + +MYJOB=`cat .myjob | grep "submitted as job" | sed -e "s#submitted as job id: ##g"` + +echo "#### JOBID: $MYJOB #####" + +( lava-tool job-status https://agl-jenkins-user@porter.automotivelinux.org $MYJOB | tee .status ) || true +STATUS=`grep "Job Status:" .status | sed -e "s#Job Status: ##g"` + +if [ x"Complete" = x"$STATUS" ] ; then + echo "YAY! $STATUS" + curl -o plain_output.yaml https://porter.automotivelinux.org/scheduler/job/$MYJOB/log_file/plain + cat plain_output.yaml | grep '"target",' | sed -e 's#- {"dt".*"lvl".*"msg":."##g' -e 's#"}$##g' + + # cleanup + #ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 rm -rf /srv/download/AGL/upload/ci/${CHID}/ + + exit 0 +else + echo "Nooooooooo! $STATUS" + curl -o plain_output.yaml https://porter.automotivelinux.org/scheduler/job/$MYJOB/log_file/plain + cat plain_output.yaml | grep '"target",' | sed -e 's#- {"dt".*"lvl".*"msg":."##g' -e 's#"}$##g' + + # cleanup + #ssh -o StrictHostKeyChecking=no jenkins-slave@10.30.72.8 rm -rf /srv/download/AGL/upload/ci/${CHID}/ + + exit 1 +fi diff --git a/jjb/release-jjb-chinook-snapshot/release-jjb-chinook-snapshot.yaml b/jjb/release-jjb-chinook-snapshot/release-jjb-chinook-snapshot.yaml index ae842c14..262da665 100644 --- a/jjb/release-jjb-chinook-snapshot/release-jjb-chinook-snapshot.yaml +++ b/jjb/release-jjb-chinook-snapshot/release-jjb-chinook-snapshot.yaml @@ -76,12 +76,14 @@ - ../common/include-agl-limit-parallelism.sh - ../common/include-agl-cat-auto-conf.sh - ../common/include-agl-local-conf-archiver.sh -# - ../common/include-agl-local-conf-isafw.sh + - ../common/include-agl-local-conf-isafw.sh - ../common/include-agl-local-conf-fstypes.sh - ../common/include-agl-local-conf-vmdk.sh - ../common/include-agl-bitbake-image.sh - ../common/include-agl-bitbake-sdk.sh - - ../common/include-agl-test-nbd-short.sh + - ../common/include-agl-run-test-prepare.sh + - ../common/include-agl-run-test-rsync-release.sh + - ../common/include-agl-run-test-short-release.sh - shell: !include-raw-escape: include-release-jjb-chinook-snapshot-rsync.sh |