diff options
author | Paul Duffin <paulduffin@google.com> | 2022-04-06 13:13:41 +0000 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2022-04-06 15:03:42 +0000 |
commit | 4899f98a91e325ff165eb64ad9b4ac797b344989 (patch) | |
tree | c9b5d416fec8f714d7d9443249a604c33db4a558 /build/mainline_modules_sdks_test.py | |
parent | e7b26ac7e48e838e250d9c1da7407c98ebe5ad14 (diff) | |
download | common-4899f98a91e325ff165eb64ad9b4ac797b344989.tar.gz |
Copy the out/soong/build_number.txt file into sdk snapshots for R
This change adds the build_number.txt file into the sdk snapshot for R
to make it easier to debug issues arising in partner builds caused by
the snapshots.
The file is added to the root of the snapshot and is called:
snapshot-creation-build-number.txt
Bug: 201295663
Test: atest --host mainline_modules_sdks_test
packages/modules/common/build/mainline_modules_sdks.sh --build-release=R
# Check the contents of various snapshots.
Change-Id: I6cabf16754c73fc87ee4e9d00bf6ddb8349809f1
Diffstat (limited to 'build/mainline_modules_sdks_test.py')
-rw-r--r-- | build/mainline_modules_sdks_test.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/build/mainline_modules_sdks_test.py b/build/mainline_modules_sdks_test.py index 6b77e14d..6d06303c 100644 --- a/build/mainline_modules_sdks_test.py +++ b/build/mainline_modules_sdks_test.py @@ -15,6 +15,7 @@ # limitations under the License. """Unit tests for mainline_modules_sdks.py.""" import dataclasses +import pathlib import re import typing from pathlib import Path @@ -112,6 +113,10 @@ class TestProduceDist(unittest.TestCase): return files def test_unbundled_modules(self): + # Create the out/soong/build_number.txt file that is copied into the + # snapshots. + self.create_build_number_file() + modules = [ MAINLINE_MODULES_BY_APEX["com.android.art"], MAINLINE_MODULES_BY_APEX["com.android.ipsec"], @@ -175,11 +180,13 @@ class TestProduceDist(unittest.TestCase): "com.android.ipsec/sdk_library/public/android.net.ipsec.ike-stubs.jar", "com.android.ipsec/sdk_library/public/android.net.ipsec.ike.srcjar", "com.android.ipsec/sdk_library/public/android.net.ipsec.ike.txt", + "com.android.ipsec/snapshot-creation-build-number.txt", google_wifi_android_bp, "com.google.android.wifi/sdk_library/public/framework-wifi-removed.txt", "com.google.android.wifi/sdk_library/public/framework-wifi-stubs.jar", "com.google.android.wifi/sdk_library/public/framework-wifi.srcjar", "com.google.android.wifi/sdk_library/public/framework-wifi.txt", + "com.google.android.wifi/snapshot-creation-build-number.txt", "ipsec-module-sdk-current.zip", "wifi-module-sdk-current.zip", ], sorted(self.list_files_in_dir(r_snaphot_dir))) @@ -263,7 +270,18 @@ class TestProduceDist(unittest.TestCase): ], sorted(self.list_files_in_dir(self.tmp_dist_dir))) + def create_build_number_file(self): + soong_dir = os.path.join(self.tmp_out_dir, "soong") + os.makedirs(soong_dir, exist_ok=True) + build_number_file = os.path.join(soong_dir, "build_number.txt") + with open(build_number_file, "w", encoding="utf8") as f: + f.write("build-number") + def test_snapshot_build_order(self): + # Create the out/soong/build_number.txt file that is copied into the + # snapshots. + self.create_build_number_file() + subprocess_runner = unittest.mock.Mock(mm.SubprocessRunner) snapshot_builder = FakeSnapshotBuilder( tool_path="path/to/mainline_modules_sdks.sh", |