summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yuntao Xu <yuntaoxu@google.com> 2021-09-15 21:28:54 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-09-15 21:28:54 +0000
commit3d4c52d6ed90ce7d743c69296ca53e859a00b204 (patch)
tree7947ea802d42d6f62fb41d41456da408117822af
parentdcc78a8f0a14c23a954e70afb7b4a19dbd6bdedd (diff)
parent89c09d9ab90cc639ddf6d105ac11216a6c1bdb81 (diff)
Merge "Add the cts-platform-version check"
-rw-r--r--core/tasks/cts.mk32
1 files changed, 32 insertions, 0 deletions
diff --git a/core/tasks/cts.mk b/core/tasks/cts.mk
index fdd9591768..dccf14f72b 100644
--- a/core/tasks/cts.mk
+++ b/core/tasks/cts.mk
@@ -25,3 +25,35 @@ $(call dist-for-goals, cts, $(compatibility_zip))
.PHONY: cts_v2
cts_v2: cts
+
+# platform version check (b/32056228)
+# ============================================================
+ifneq (,$(wildcard cts/))
+ cts_platform_version_path := cts/tests/tests/os/assets/platform_versions.txt
+ cts_platform_version_string := $(shell cat $(cts_platform_version_path))
+ cts_platform_release_path := cts/tests/tests/os/assets/platform_releases.txt
+ cts_platform_release_string := $(shell cat $(cts_platform_release_path))
+
+ ifeq (,$(findstring $(PLATFORM_VERSION),$(cts_platform_version_string)))
+ define error_msg
+ ============================================================
+ Could not find version "$(PLATFORM_VERSION)" in CTS platform version file:
+ $(cts_platform_version_path)
+ Most likely PLATFORM_VERSION in build/core/version_defaults.mk
+ has changed and a new version must be added to this CTS file.
+ ============================================================
+ endef
+ $(error $(error_msg))
+ endif
+ ifeq (,$(findstring $(PLATFORM_VERSION_LAST_STABLE),$(cts_platform_release_string)))
+ define error_msg
+ ============================================================
+ Could not find version "$(PLATFORM_VERSION_LAST_STABLE)" in CTS platform release file:
+ $(cts_platform_release_path)
+ Most likely PLATFORM_VERSION_LAST_STABLE in build/core/version_defaults.mk
+ has changed and a new version must be added to this CTS file.
+ ============================================================
+ endef
+ $(error $(error_msg))
+ endif
+endif