diff options
author | Erik Kline | 2017-10-14 04:29:09 -0500 |
---|---|---|
committer | Erik Kline | 2017-10-16 05:19:26 -0500 |
commit | 15e945976b2d8a7047c2a8b87fd639c97423cf51 (patch) | |
tree | 5734ae854fd91754010dbf62d1e12f7ebfeca4c6 | |
parent | 213c36d71d099b53e9846d320968a36d56b12ef3 (diff) | |
download | platform-hardware-interfaces-15e945976b2d8a7047c2a8b87fd639c97423cf51.tar.gz platform-hardware-interfaces-15e945976b2d8a7047c2a8b87fd639c97423cf51.tar.xz platform-hardware-interfaces-15e945976b2d8a7047c2a8b87fd639c97423cf51.zip |
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
-rw-r--r-- | tetheroffload/control/1.0/vts/functional/VtsHalTetheroffloadControlV1_0TargetTest.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tetheroffload/control/1.0/vts/functional/VtsHalTetheroffloadControlV1_0TargetTest.cpp b/tetheroffload/control/1.0/vts/functional/VtsHalTetheroffloadControlV1_0TargetTest.cpp index 52dd026a..c009af5d 100644 --- a/tetheroffload/control/1.0/vts/functional/VtsHalTetheroffloadControlV1_0TargetTest.cpp +++ b/tetheroffload/control/1.0/vts/functional/VtsHalTetheroffloadControlV1_0TargetTest.cpp | |||
@@ -231,7 +231,6 @@ TEST_F(OffloadControlHidlTestBase, AdditionalInitsWithoutStopReturnFalse) { | |||
231 | initOffload(false); | 231 | initOffload(false); |
232 | initOffload(false); | 232 | initOffload(false); |
233 | initOffload(false); | 233 | initOffload(false); |
234 | stopOffload(ExpectBoolean::True); // balance out initOffload(true) | ||
235 | } | 234 | } |
236 | 235 | ||
237 | // Check that calling stopOffload() without first having called initOffload() returns false. | 236 | // Check that calling stopOffload() without first having called initOffload() returns false. |
@@ -244,6 +243,14 @@ TEST_F(OffloadControlHidlTestBase, MultipleStopsWithoutInitReturnFalse) { | |||
244 | // Check that calling stopOffload() after a complete init/stop cycle returns false. | 243 | // Check that calling stopOffload() after a complete init/stop cycle returns false. |
245 | TEST_F(OffloadControlHidlTestBase, AdditionalStopsWithInitReturnFalse) { | 244 | TEST_F(OffloadControlHidlTestBase, AdditionalStopsWithInitReturnFalse) { |
246 | initOffload(true); | 245 | initOffload(true); |
246 | // Call setUpstreamParameters() so that "offload" can be reasonably said | ||
247 | // to be both requested and operational. | ||
248 | const hidl_string v4Addr("192.0.0.2"); | ||
249 | const hidl_string v4Gw("192.0.0.1"); | ||
250 | const vector<hidl_string> v6Gws{hidl_string("fe80::db8:1"), hidl_string("fe80::db8:2")}; | ||
251 | const Return<void> upstream = | ||
252 | control->setUpstreamParameters("rmnet_data0", v4Addr, v4Gw, v6Gws, ASSERT_TRUE_CALLBACK); | ||
253 | EXPECT_TRUE(upstream.isOk()); | ||
247 | stopOffload(ExpectBoolean::True); // balance out initOffload(true) | 254 | stopOffload(ExpectBoolean::True); // balance out initOffload(true) |
248 | stopOffload(ExpectBoolean::False); | 255 | stopOffload(ExpectBoolean::False); |
249 | stopOffload(ExpectBoolean::False); | 256 | stopOffload(ExpectBoolean::False); |