From 04b4a19fe600c904dd9e3531a7b64cc3cfae8dbe Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Thu, 18 Mar 2021 11:05:31 +0000 Subject: [PATCH] Add TestBasicSdkWithBootImage Added to reproduce the conditions that lead to the error reported in the bug so they can be fixed. There were a number of issues that were fixed in previous changes and this test verifies that they have been fixed. Bug: 182992071 Test: m nothing Change-Id: I2197899b284a99973e698db314b15812f602b141 --- sdk/boot_image_sdk_test.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/sdk/boot_image_sdk_test.go b/sdk/boot_image_sdk_test.go index bc09bbc4c..5a03e346e 100644 --- a/sdk/boot_image_sdk_test.go +++ b/sdk/boot_image_sdk_test.go @@ -67,3 +67,39 @@ sdk_snapshot { `), checkAllCopyRules("")) } + +// Test that boot_image works with sdk. +func TestBasicSdkWithBootImage(t *testing.T) { + android.GroupFixturePreparers( + prepareForSdkTestWithApex, + prepareForSdkTestWithJava, + android.FixtureWithRootAndroidBp(` + sdk { + name: "mysdk", + boot_images: ["mybootimage"], + } + + boot_image { + name: "mybootimage", + image_name: "art", + apex_available: ["myapex"], + } + + sdk_snapshot { + name: "mysdk@1", + boot_images: ["mybootimage_mysdk_1"], + } + + prebuilt_boot_image { + name: "mybootimage_mysdk_1", + sdk_member_name: "mybootimage", + prefer: false, + visibility: ["//visibility:public"], + apex_available: [ + "myapex", + ], + image_name: "art", + } + `), + ).RunTest(t) +}