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

Commit 15e94597 authored by Erik Kline's avatar Erik Kline
Browse files

tetheroffload VTS: fix stopOffload test conditions

The tetheroffload HAL is somewhat...and over- and under-specified.
A not unreasonable interpretation is that stopOffload() doesn't have
return success unless offload was actually started (via a call to
setUpstreamParameters()), and that after initOffload() and before
setUpstreamParameters() not actual "offload" has been engaged.

Precision in this matter is not required for the test case:

    OffloadControlHidlTestBase.AdditionalInitsWithoutStopReturnFalse

But for the test case:

    OffloadControlHidlTestBase.AdditionalStopsWithInitReturnFalse

we want to ensure the "matching" stopOffload call succeeds. For this
test we add in a call to setUpstreamParameters() for good measure.

Test: as follows
    prompt$ make vts -j30 BUILD_GOOGLE_VTS=true && \
            vts-tradefed run commandAndExit vts \
                --skip-all-system-status-check \
                --primary-abi-only \
                --skip-preconditions \
                --module VtsHalTetherOffloadControlV1_0Target \
                -l DEBUG

Observed:
    10-16 19:17:17 I/ResultReporter: Invocation finished in 1m 2s. PASSED: 38, FAILED: 0, MODULES: 1 of 1

Bug: 65270149
Bug: 65612227
Bug: 65612332
Change-Id: I924d41f5a20f07707e3d6991cb59d9c6b2b02339
parent 213c36d7
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -231,7 +231,6 @@ TEST_F(OffloadControlHidlTestBase, AdditionalInitsWithoutStopReturnFalse) {
    initOffload(false);
    initOffload(false);
    initOffload(false);
    stopOffload(ExpectBoolean::True);  // balance out initOffload(true)
}

// Check that calling stopOffload() without first having called initOffload() returns false.
@@ -244,6 +243,14 @@ TEST_F(OffloadControlHidlTestBase, MultipleStopsWithoutInitReturnFalse) {
// Check that calling stopOffload() after a complete init/stop cycle returns false.
TEST_F(OffloadControlHidlTestBase, AdditionalStopsWithInitReturnFalse) {
    initOffload(true);
    // Call setUpstreamParameters() so that "offload" can be reasonably said
    // to be both requested and operational.
    const hidl_string v4Addr("192.0.0.2");
    const hidl_string v4Gw("192.0.0.1");
    const vector<hidl_string> v6Gws{hidl_string("fe80::db8:1"), hidl_string("fe80::db8:2")};
    const Return<void> upstream =
        control->setUpstreamParameters("rmnet_data0", v4Addr, v4Gw, v6Gws, ASSERT_TRUE_CALLBACK);
    EXPECT_TRUE(upstream.isOk());
    stopOffload(ExpectBoolean::True);  // balance out initOffload(true)
    stopOffload(ExpectBoolean::False);
    stopOffload(ExpectBoolean::False);