summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Djakov <georgi.djakov@linaro.org>2021-04-01 14:03:18 +0300
committerGeorgi Djakov <georgi.djakov@linaro.org>2021-04-01 14:05:22 +0300
commit4f9131d1f1937a18e2931b459ea5e5ad91c03ab8 (patch)
tree295c4d4f2ae467909da19f735b2d617a1a1eb4fe
parentd7eebfc48bc1f56561983696698347e30995dc5c (diff)
pmwg-ci-tuxbuild: Add the pmwg-ci-tuxbuild script
The script is used for building a kernel with tuxbuild and submit workload automation tests with predefined agenda. Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
-rwxr-xr-xpmwg-ci-tuxbuild75
1 files changed, 75 insertions, 0 deletions
diff --git a/pmwg-ci-tuxbuild b/pmwg-ci-tuxbuild
new file mode 100755
index 0000000..d7695ad
--- /dev/null
+++ b/pmwg-ci-tuxbuild
@@ -0,0 +1,75 @@
+#!/bin/bash
+
+# Give the opportunity the caller of the script to specify the directory
+# where the repository is located, otherwise default to the current
+# directory
+REPOPATH=${1:-$PWD}
+
+BRANCH="integ"
+ABBREV="12"
+BOARDS=("db410c" "db845c")
+AGENDA_db410c=("lxc-dragonboard-410c-aep.yaml" "lxc-dragonboard-410c-aep-suspend.yaml")
+AGENDA_db845c=("lxc-dragonboard-845c-aep.yaml" "lxc-dragonboard-845c-aep-suspend.yaml")
+
+# Move into the repo
+cd $REPOPATH
+
+git remote update > /dev/null &&
+git reset --hard origin/${BRANCH} > /dev/null
+GIT_DESCR=$(git describe --abbrev=${ABBREV})
+GIT_SHA=$(git rev-parse HEAD)
+
+pmwg-ci_tuxbuild() {
+
+ git tag | grep -q tuxbuild-$GIT_DESCR && return 1
+ git tag tuxbuild-$GIT_DESCR
+
+ echo "$(date) pmwg-tuxbuild started" >> ~/logs/tuxbuild.log
+ BUILD="$(~/.local/bin/tuxbuild build \
+ --git-repo 'https://git.linaro.org/power/linux.git' --git-sha $GIT_SHA \
+ --target-arch arm64 --kconfig defconfig --toolchain gcc-10 2>&1)"
+
+ if [ $? -ne 0 ]; then
+ echo "$(date) pmwg-tuxbuild: failed with error $?" >> ~/logs/tuxbuild.log
+ git tag -d tuxbuild-$GIT_DESCR >/dev/null
+ return 1
+ fi
+
+ echo "$(date) pmwg-tuxbuild completed" >> ~/logs/tuxbuild.log
+ echo "$BUILD" >> ~/logs/tuxbuild.log
+
+ # If there are any warnings send the log to email for inspection
+ #echo "$BUILD" | grep -q "Pass (0 warnings):" || return 2
+ #URL="$(echo "$BUILD" | grep "Pass (0 warnings):" | cut -f 2 -d @)"
+ URL="$(echo "$BUILD" | grep "Building:" | cut -d @ -f 2)"
+
+ # Update the workload automation scripts and agenda
+ #cd $HOME/wa-tests && git pull -q
+ echo "$(date) URL="$URL >> ~/logs/tuxbuild.log
+
+ # Check if the kernelci build is ready and prepare the image
+ for BOARD in "${BOARDS[@]}"; do
+ cd $HOME/wa-tests/scripts && ./prepare-pmwg-kernel.sh $URL $BOARD >> ~/logs/tuxbuild.log || return 3
+
+ # Add a tag to the tree, so we know that the branch has been tested
+ #cd $REPOPATH && git tag test-$GIT_DESCR
+
+ # Submit jobs for each agenda to workload automation
+ AGENDA=AGENDA_${BOARD}[@]
+ for ENTRY in "${!AGENDA}"; do
+ DEFINITION="$(cat ~/wa-tests/agenda/${ENTRY})" && \
+ curl -o /dev/null --header "Auth-Token: $TOKEN" \
+ --form backend=pmwg.validation.linaro.org \
+ --form definition="$DEFINITION" \
+ https://qa-reports.linaro.org/api/submitjob/pmwg/power-mainline/$GIT_DESCR/$BOARD >/dev/null
+ done
+ done
+
+ echo "New build available for $GIT_DESCR"
+ echo "$BUILD" | grep " warnings):"
+ echo "Test results should be ready soon at https://qa-reports.linaro.org/pmwg/power-mainline/"
+
+ return 0;
+}
+
+pmwg-ci_tuxbuild