diff options
author | Vyshu <vyshu@google.com> | 2020-09-17 21:37:21 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-24 20:37:32 +0000 |
commit | a81598b5c2d7b74ba46c2daac1558cdcb959cc1b (patch) | |
tree | ca3c1f3af73001e7d217541eded575db1ea32c14 /payload_generator/payload_properties_unittest.cc | |
parent | fbc57355f863b5476ae1739375bb8ce026c8a629 (diff) |
payload_generator: Remove unused attributes
Some attributes are not used by the client. Removed all instances of
of "ignored" and option ttributes from delta generation. Removed
all instances of ImageInfo and moved target and source version
to paygen_payload.
BUG=b:163048638
TEST=FEATURES=test emerge-hatch update_engine
TEST=FEATURES=test emerge update_payload
TEST=./run_pytest lib/paygen/paygen_payload_lib_unittest.py
Change-Id: I9102d37fcf054f2cbeb79e54113925a684de1cfb
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2388163
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Tested-by: Vyshu Khota <vyshu@google.com>
Commit-Queue: Vyshu Khota <vyshu@google.com>
Diffstat (limited to 'payload_generator/payload_properties_unittest.cc')
-rw-r--r-- | payload_generator/payload_properties_unittest.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/payload_generator/payload_properties_unittest.cc b/payload_generator/payload_properties_unittest.cc index db3902ce..a923379e 100644 --- a/payload_generator/payload_properties_unittest.cc +++ b/payload_generator/payload_properties_unittest.cc @@ -57,8 +57,6 @@ class PayloadPropertiesTest : public ::testing::Test { PayloadGenerationConfig config; config.version.major = kBrilloMajorPayloadVersion; config.version.minor = kSourceMinorPayloadVersion; - config.source.image_info.set_version("123.0.0"); - config.target.image_info.set_version("456.7.8"); PayloadFile payload; EXPECT_TRUE(payload.Init(config)); @@ -114,11 +112,9 @@ TEST_F(PayloadPropertiesTest, GetPropertiesAsJsonTestHash) { "{" R"("is_delta":true,)" R"("metadata_signature":"",)" - R"("metadata_size":187,)" - R"("sha256_hex":"Rtrj9v3xXhrAi1741HAojtGxAQEOZ7mDyhzskIF4PJc=",)" - R"("size":233,)" - R"("source_version":"123.0.0",)" - R"("target_version":"456.7.8",)" + R"("metadata_size":165,)" + R"("sha256_hex":"cV7kfZBH3K0B6QJHxxykDh6b6x0WgVOmc63whPLOy7U=",)" + R"("size":211,)" R"("version":2)" "}"; string json; @@ -130,10 +126,10 @@ TEST_F(PayloadPropertiesTest, GetPropertiesAsJsonTestHash) { // Validate the hash of file and metadata are within the output. TEST_F(PayloadPropertiesTest, GetPropertiesAsKeyValueTestHash) { constexpr char kKeyValueProperties[] = - "FILE_HASH=Rtrj9v3xXhrAi1741HAojtGxAQEOZ7mDyhzskIF4PJc=\n" - "FILE_SIZE=233\n" - "METADATA_HASH=kiXTexy/s2aPttf4+r8KRZWYZ6FYvwhU6rJGcnnI+U0=\n" - "METADATA_SIZE=187\n"; + "FILE_HASH=cV7kfZBH3K0B6QJHxxykDh6b6x0WgVOmc63whPLOy7U=\n" + "FILE_SIZE=211\n" + "METADATA_HASH=aEKYyzJt2E8Gz8fzB+gmekN5mriotZCSq6R+kDfdeV4=\n" + "METADATA_SIZE=165\n"; string key_value; EXPECT_TRUE(PayloadProperties{payload_file.path()}.GetPropertiesAsKeyValue( &key_value)); |