diff options
| author | PMR <pmr@pmr-lander> | 2017-01-23 09:53:00 +0000 |
|---|---|---|
| committer | PMR <pmr@pmr-lander> | 2017-01-23 09:53:00 +0000 |
| commit | da27f2161991232a519f18109d775a56144c6e7a (patch) | |
| tree | f95dbb15aad919c5c3e17c2cbbd95d2c68949717 | |
| parent | 0d23982f9714b3c3108c09494ade482ae983ad8d (diff) | |
| parent | 314717631b8a6d1cc807dd9ae1fb86df4b71ac9b (diff) | |
Merge #313983 from ~kaihengfeng/oem-qa-checkbox/+git/oem-plainbox:master
| -rwxr-xr-x | bin/dkms_build_exclusive_test | 55 | ||||
| -rw-r--r-- | data/dkms_test_blacklist | 1 | ||||
| -rw-r--r-- | jobs/somerville/somerville.txt.in | 12 | ||||
| -rw-r--r-- | units/somerville-full.pxu | 1 |
4 files changed, 69 insertions, 0 deletions
diff --git a/bin/dkms_build_exclusive_test b/bin/dkms_build_exclusive_test new file mode 100755 index 0000000..2fb7471 --- /dev/null +++ b/bin/dkms_build_exclusive_test @@ -0,0 +1,55 @@ +#!/bin/bash + +blacklist="${PLAINBOX_PROVIDER_DATA}/dkms_test_blacklist" + +function is_in_archive { + repos=$(apt-cache madison $1 | cut -d '|' -f 3) + if [[ "$repos" == "" ]]; then + return 1 + fi + + while IFS= read -r line; do + if ! echo "$line" | grep -q http; then + return 1 + fi + done <<< "$repos" + + return 0 +} + +function is_in_blacklist { + while read ignore; do + if [[ "$1" =~ "$ignore" ]]; then + return 0 + fi + done < "$blacklist" + + return 1 +} + +echo "Beginning DKMS BUILD_EXCLUSIVE Test" 1>&2 + +exit_status=0 + +for dkms in $(dkms status | sed 's/ //g' | \ + cut -d ',' --output-delimiter='-' -f1,2 | sort -u); do + conf="/usr/src/$dkms/dkms.conf" + if [ ! -e "$conf" ]; then + echo "ERROR: $dkms does not have dkms.conf" + exit_status=1 + continue + fi + + package=$(dpkg -S "$conf" | cut -d ':' -f 1) + + if is_in_archive "$package" || is_in_blacklist "$package"; then + continue + fi + + if ! grep -q BUILD_EXCLUSIVE_KERNEL "$conf"; then + echo "ERROR: $package does not have BUILD_EXCLUSIVE" + exit_status=1 + fi +done + +exit $exit_status diff --git a/data/dkms_test_blacklist b/data/dkms_test_blacklist new file mode 100644 index 0000000..862f7ab --- /dev/null +++ b/data/dkms_test_blacklist @@ -0,0 +1 @@ +nvidia diff --git a/jobs/somerville/somerville.txt.in b/jobs/somerville/somerville.txt.in index 7d8c054..f616032 100644 --- a/jobs/somerville/somerville.txt.in +++ b/jobs/somerville/somerville.txt.in @@ -214,3 +214,15 @@ plugin: shell command: platform_meta_test _description: Check if the platform metapackage is installed. + +id: somerville/dkms-build-exclusive-test +category_id: somerville +plugin: user-interact-verify +command: + dkms_build_exclusive_test +_description: + Check if DKMS has BUILD_EXCLUSIVE_KERNEL clause. + STEPS: + 1. Verify and check the output. + VERIFICATION: + No ERROR messages. diff --git a/units/somerville-full.pxu b/units/somerville-full.pxu index 0b5f46c..c06b9ea 100644 --- a/units/somerville-full.pxu +++ b/units/somerville-full.pxu @@ -29,6 +29,7 @@ include: 2013.com.canonical.certification::resource 2013.com.canonical.certification::hardware 2013.com.canonical.certification::hardware/certification + somerville/dkms-build-exclusive-test somerville/recovery somerville/recovery/desktop-disk somerville/phase-sku |
