Skip to content

Commit

Permalink
Fix pc-sanity/platform_meta_test for sutton 24.04 (bugfix) (#1632)
Browse files Browse the repository at this point in the history
Fix pc-sanity/platform_meta_test for sutton 24.04
  • Loading branch information
pseudocc authored Dec 3, 2024
1 parent 4f7e7d5 commit 0b0d7b0
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions contrib/pc-sanity/bin/get-oem-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ exit 1
}

prepare() {
# For sutton we could get oem info from buildstamp, it's quicker and use less resource.
# Examples:
# pc-sutton-bachman-focal-amd64-X00-20201022-403
# sutton-focal-amd64-X02-20211221-33
# It will return sutton for $oem
if [ -f /etc/buildstamp ]; then
oem=$(tail -n1 /etc/buildstamp | grep -o 'sutton' || true)
fi
local dcd

dcd=$(ubuntu-report show | jq -r '.OEM.DCD')
for project in sutton stella somerville; do
if [[ "$dcd" == *"$project"* ]]; then
oem="$project"
break
fi
done

if [ -z "${oem}" ]; then
oem="$(grep -q stella <(ubuntu-report show | grep DCD) && echo stella)" ||\
oem="$(grep -q somerville <(ubuntu-report show | grep DCD) && echo somerville)" ||\
{ >&2 echo "[ERROR][CODE]got an empty OEM codename in ${FUNCNAME[0]}"; }
>&2 echo "[ERROR][CODE]got an empty OEM codename in ${FUNCNAME[0]}";
return 1
fi

# Since Ubuntu 22.04, there is no group layer anymore
# Use 20.04 & 22.04 instead of focal & jammy since we may need to support N+1 in the future.
release=$(lsb_release -a 2>/dev/null| grep ^Release| awk '{print $2}')
Expand Down

0 comments on commit 0b0d7b0

Please sign in to comment.