aboutsummaryrefslogtreecommitdiff
path: root/openembedded-lkft/submit_for_testing.sh
diff options
context:
space:
mode:
authorDan Rue <dan.rue@linaro.org>2017-12-08 10:51:11 -0600
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-12-20 11:27:19 +0000
commit43d72806230fef184ed8029e15a2614c4e0dbcba (patch)
treeb03dd1b0d115b44ae3125f1681117037667ce81d /openembedded-lkft/submit_for_testing.sh
parent062a6f92bc625e9c8a92deee501b2a555af4748d (diff)
Add yaml parsing and improve local testing script
- Files are parsed and written as yaml, preserving whitespace and comments When testing: - Dump files to filesystem (tmp/) - Loop through each device type - Execute against local sources, rather than cloning remote repo when testing - Reuse submit_for_testing.sh for local tests, too This allows developers to see directly how template changes affect the yaml job definitions. This change introduces a requirement for python library ruamel.yaml. Change-Id: Iefa751f5f29a2690e4e9905e12082f56ea6c9189 Signed-off-by: Dan Rue <dan.rue@linaro.org>
Diffstat (limited to 'openembedded-lkft/submit_for_testing.sh')
-rwxr-xr-xopenembedded-lkft/submit_for_testing.sh60
1 files changed, 37 insertions, 23 deletions
diff --git a/openembedded-lkft/submit_for_testing.sh b/openembedded-lkft/submit_for_testing.sh
index a66f17396a..751949d685 100755
--- a/openembedded-lkft/submit_for_testing.sh
+++ b/openembedded-lkft/submit_for_testing.sh
@@ -6,30 +6,40 @@ set -ex
[ -z "${LAVA_JOB_PRIORITY}" ] && export LAVA_JOB_PRIORITY="low"
[ -z "${SKIP_LAVA}" ] || unset DEVICE_TYPE
+if [ -n "${DRY_RUN}" ]; then
+ export DRY_RUN="--dry-run --template-path lava-job-definitions --testplan-path lava-job-definitions/ --quiet"
+ export BASE_PATH=.
+else
+ export DRY_RUN=""
+ export BASE_PATH=configs/openembedded-lkft/
+fi
+
if [ -z "${DEVICE_TYPE}" ]; then
echo "DEVICE_TYPE not set. Exiting"
exit 0
fi
-case "${QA_SERVER_PROJECT}" in
- linux-mainline-*)
- source /srv/oe/build/lkftmetadata/packages/*/${KERNEL_RECIPE}/metadata
- export KSELFTESTS_URL=${LINUX_GENERIC_MAINLINE_URL}
- export KSELFTESTS_VERSION=${LINUX_GENERIC_MAINLINE_VERSION}
- export KSELFTESTS_REVISION=${KERNEL_COMMIT}
- ;;
- linux-next-*)
- source /srv/oe/build/lkftmetadata/packages/*/${KERNEL_RECIPE}/metadata
- export KSELFTESTS_URL=${LINUX_GENERIC_NEXT_URL}
- export KSELFTESTS_VERSION=${LINUX_GENERIC_NEXT_VERSION}
- export KSELFTESTS_REVISION=${KERNEL_COMMIT}
- ;;
- *)
- export KSELFTESTS_URL=${KSELFTESTS_MAINLINE_URL}
- export KSELFTESTS_VERSION=${KSELFTESTS_MAINLINE_VERSION}
- export KSELFTESTS_REVISION=${KSELFTESTS_MAINLINE_VERSION}
- ;;
-esac
+if [ -z "${DRY_RUN}" ]; then
+ case "${QA_SERVER_PROJECT}" in
+ linux-mainline-*)
+ source /srv/oe/build/lkftmetadata/packages/*/${KERNEL_RECIPE}/metadata
+ export KSELFTESTS_URL=${LINUX_GENERIC_MAINLINE_URL}
+ export KSELFTESTS_VERSION=${LINUX_GENERIC_MAINLINE_VERSION}
+ export KSELFTESTS_REVISION=${KERNEL_COMMIT}
+ ;;
+ linux-next-*)
+ source /srv/oe/build/lkftmetadata/packages/*/${KERNEL_RECIPE}/metadata
+ export KSELFTESTS_URL=${LINUX_GENERIC_NEXT_URL}
+ export KSELFTESTS_VERSION=${LINUX_GENERIC_NEXT_VERSION}
+ export KSELFTESTS_REVISION=${KERNEL_COMMIT}
+ ;;
+ *)
+ export KSELFTESTS_URL=${KSELFTESTS_MAINLINE_URL}
+ export KSELFTESTS_VERSION=${KSELFTESTS_MAINLINE_VERSION}
+ export KSELFTESTS_REVISION=${KSELFTESTS_MAINLINE_VERSION}
+ ;;
+ esac
+fi
if [ ! -z "${KERNEL_DESCRIBE}" ]; then
export QA_BUILD_VERSION=${KERNEL_DESCRIBE}
@@ -37,16 +47,19 @@ else
export QA_BUILD_VERSION=${KERNEL_COMMIT:0:12}
fi
-rm -rf configs
-git clone --depth 1 http://git.linaro.org/ci/job/configs.git
+if [ -z "${DRY_RUN}" ]; then
+ rm -rf configs
+ git clone --depth 1 http://git.linaro.org/ci/job/configs.git
+fi
[ ! -z ${TEST_TEMPLATES} ] && unset TEST_TEMPLATES
+TEMPLATE_PATH=""
-for test in $(ls configs/openembedded-lkft/lava-job-definitions/testplan); do
+for test in $(ls ${BASE_PATH}/lava-job-definitions/testplan/); do
TEST_TEMPLATES="${TEST_TEMPLATES} testplan/${test}"
done
-python configs/openembedded-lkft/submit_for_testing.py \
+python ${BASE_PATH}/submit_for_testing.py \
--device-type ${DEVICE_TYPE} \
--build-number ${BUILD_NUMBER} \
--lava-server ${LAVA_SERVER} \
@@ -54,4 +67,5 @@ python configs/openembedded-lkft/submit_for_testing.py \
--qa-server-team lkft \
--qa-server-project ${QA_SERVER_PROJECT} \
--git-commit ${QA_BUILD_VERSION} \
+ ${DRY_RUN} \
--test-plan ${TEST_TEMPLATES}