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

Commit e82bfda9 authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

Merge "storaged: skip disk_stats test if not supported." am: c232e0af am:...

Merge "storaged: skip disk_stats test if not supported." am: c232e0af am: 43373678 am: 32745bb1

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1912710

Change-Id: I2493499f8b726e6f3762fc5b441127c6b61c893c
parents 08803d08 32745bb1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -115,6 +115,9 @@ cc_test {
    static_libs: [
        "libstoraged",
    ],
    test_suites: [
        "general-tests",
    ],
}

// AIDL interface between storaged and framework.jar
+8 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@

#include <gtest/gtest.h>

#include <aidl/android/hardware/health/IHealth.h>
#include <healthhalutils/HealthHalUtils.h>
#include <storaged.h>               // data structures
#include <storaged_utils.h>         // functions to test
@@ -249,6 +250,13 @@ TEST(storaged_test, disk_stats_monitor) {
    // testing if detect() will return the right value
    disk_stats_monitor dsm_detect{healthService};
    ASSERT_TRUE(dsm_detect.enabled());

    // Even if enabled(), healthService may not support disk stats. Check if it is supported.
    std::vector<aidl::android::hardware::health::DiskStats> halStats;
    if (healthService->getDiskStats(&halStats).getExceptionCode() == EX_UNSUPPORTED_OPERATION) {
        GTEST_SKIP();
    }

    // feed monitor with constant perf data for io perf baseline
    // using constant perf is reasonable since the functionality of stream_stats
    // has already been tested