Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21ef3ae3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Skip test for Automotive in Android Q" into android10-tests-dev

parents 3d7e667b 2c25e261
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -18,12 +18,14 @@
#include <gmock/gmock.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <liblp/builder.h>
#include <liblp/builder.h>
#include <android-base/properties.h>


#include "utility.h"
#include "utility.h"


using namespace std;
using namespace std;
using namespace android::fs_mgr;
using namespace android::fs_mgr;
using ::testing::ElementsAre;
using ::testing::ElementsAre;
using android::base::GetProperty;


class Environment : public ::testing::Environment {
class Environment : public ::testing::Environment {
  public:
  public:
@@ -442,6 +444,13 @@ TEST_F(BuilderTest, MetadataTooLarge) {
}
}


TEST_F(BuilderTest, block_device_info) {
TEST_F(BuilderTest, block_device_info) {
    //This test requires dynamic partition which is not mandatory for
    //Automotive in Android Q or lower
    std::string api_level = GetProperty("ro.build.version.sdk","");
    std::string hw_type = GetProperty("ro.hardware.type","");
    if (std::stoi(api_level) <= 29 && hw_type == "automotive") {
      return;
    }
    PartitionOpener opener;
    PartitionOpener opener;


    BlockDeviceInfo device_info;
    BlockDeviceInfo device_info;
+9 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@


#include <android-base/file.h>
#include <android-base/file.h>
#include <android-base/unique_fd.h>
#include <android-base/unique_fd.h>
#include <android-base/properties.h>
#include <fs_mgr.h>
#include <fs_mgr.h>
#include <fstab/fstab.h>
#include <fstab/fstab.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
@@ -35,6 +36,7 @@
using namespace std;
using namespace std;
using namespace android::fs_mgr;
using namespace android::fs_mgr;
using unique_fd = android::base::unique_fd;
using unique_fd = android::base::unique_fd;
using android::base::GetProperty;


// Our tests assume a 128KiB disk with two 512 byte metadata slots.
// Our tests assume a 128KiB disk with two 512 byte metadata slots.
static const size_t kDiskSize = 131072;
static const size_t kDiskSize = 131072;
@@ -706,6 +708,13 @@ TEST(liblp, UpdateNonRetrofit) {
}
}


TEST(liblp, ReadSuperPartition) {
TEST(liblp, ReadSuperPartition) {
    //This test requires dynamic partition which is not mandatory for
    //Automotive in Android Q or lower
    std::string api_level = GetProperty("ro.build.version.sdk","");
    std::string hw_type = GetProperty("ro.hardware.type","");
    if (std::stoi(api_level) <= 29 && hw_type == "automotive") {
      return;
    }
    auto slot_suffix = fs_mgr_get_slot_suffix();
    auto slot_suffix = fs_mgr_get_slot_suffix();
    auto slot_number = SlotNumberForSlotSuffix(slot_suffix);
    auto slot_number = SlotNumberForSlotSuffix(slot_suffix);
    auto super_name = fs_mgr_get_super_partition_name(slot_number);
    auto super_name = fs_mgr_get_super_partition_name(slot_number);