Loading tv/tuner/1.0/vts/functional/LnbTests.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -48,10 +48,11 @@ AssertionResult LnbTests::openLnbById(uint32_t lnbId) { return AssertionResult(status == Result::SUCCESS); } AssertionResult LnbTests::openLnbByName(string lnbName) { AssertionResult LnbTests::openLnbByName(string lnbName, uint32_t& id) { Result status; mService->openLnbByName(lnbName, [&](Result result, uint32_t /*lnbId*/, const sp<ILnb>& lnb) { mService->openLnbByName(lnbName, [&](Result result, uint32_t lnbId, const sp<ILnb>& lnb) { mLnb = lnb; id = lnbId; status = result; }); Loading tv/tuner/1.0/vts/functional/LnbTests.h +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ class LnbTests { AssertionResult getLnbIds(vector<uint32_t>& ids); AssertionResult openLnbById(uint32_t lnbId); AssertionResult openLnbByName(string lnbName); AssertionResult openLnbByName(string lnbName, uint32_t& lnbId); AssertionResult setLnbCallback(); AssertionResult setVoltage(LnbVoltage voltage); AssertionResult setTone(LnbTone tone); Loading tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp +40 −49 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ void TunerFilterHidlTest::configSingleFilterInDemuxTest(FilterConfig filterConf, } void TunerFilterHidlTest::testTimeFilter(TimeFilterConfig filterConf) { if (!filterConf.supportTimeFilter) { if (!timeFilter.support) { return; } uint32_t demuxId; Loading @@ -64,11 +64,8 @@ void TunerFilterHidlTest::testTimeFilter(TimeFilterConfig filterConf) { DemuxCapabilities caps; ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); // TODO: add time filter hardware support checker ASSERT_TRUE(mDemuxTests.getDemuxCaps(caps)); if (!caps.bTimeFilter) { return; } ASSERT_TRUE(caps.bTimeFilter); mFilterTests.setDemux(demux); ASSERT_TRUE(mFilterTests.openTimeFilterInDemux()); ASSERT_TRUE(mFilterTests.setTimeStamp(filterConf.timeStamp)); Loading Loading @@ -116,14 +113,16 @@ void TunerBroadcastHidlTest::broadcastSingleFilterTest(FilterConfig filterConf, void TunerBroadcastHidlTest::broadcastSingleFilterTestWithLnb(FilterConfig filterConf, FrontendConfig frontendConf, LnbConfig lnbConf) { if (lnbConf.name.compare(emptyHardwareId) == 0) { vector<uint32_t> ids; ASSERT_TRUE(mLnbTests.getLnbIds(ids)); if (ids.size() == 0) { return; } ASSERT_TRUE(ids.size() > 0); ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); mLnbId = &ids[0]; } else { mLnbId = (uint32_t*)malloc(sizeof(uint32_t)); ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, *mLnbId)); } ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbConf.tone)); Loading Loading @@ -212,18 +211,23 @@ void TunerRecordHidlTest::recordSingleFilterTest(FilterConfig filterConf, void TunerRecordHidlTest::recordSingleFilterTestWithLnb(FilterConfig filterConf, FrontendConfig frontendConf, DvrConfig dvrConf, LnbConfig lnbConf) { if (lnbConf.name.compare(emptyHardwareId) == 0) { vector<uint32_t> ids; ASSERT_TRUE(mLnbTests.getLnbIds(ids)); if (ids.size() == 0) { return; } ASSERT_TRUE(ids.size() > 0); ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); mLnbId = &ids[0]; } else { mLnbId = (uint32_t*)malloc(sizeof(uint32_t)); ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, *mLnbId)); } ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbConf.tone)); ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbConf.position)); for (auto msgName : lnbRecord.diseqcMsgs) { ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgMap[msgName])); } recordSingleFilterTest(filterConf, frontendConf, dvrConf); ASSERT_TRUE(mLnbTests.closeLnb()); mLnbId = nullptr; Loading Loading @@ -343,37 +347,24 @@ TEST_P(TunerFrontendHidlTest, BlindScanFrontend) { mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_BLIND); } TEST_P(TunerLnbHidlTest, OpenLnbByName) { description("Open and configure an Lnb with name then send a diseqc msg to it."); // TODO: add lnb hardware support checker vector<uint32_t> ids; ASSERT_TRUE(mLnbTests.getLnbIds(ids)); if (ids.size() == 0) { return; } ASSERT_TRUE(mLnbTests.openLnbByName(lnbArray[LNB_EXTERNAL].name)); ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbArray[LNB_EXTERNAL].voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbArray[LNB_EXTERNAL].tone)); ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbArray[LNB_EXTERNAL].position)); ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgArray[DISEQC_POWER_ON])); ASSERT_TRUE(mLnbTests.closeLnb()); } TEST_P(TunerLnbHidlTest, SendDiseqcMessageToLnb) { description("Open and configure an Lnb with specific settings then send a diseqc msg to it."); if (lnbMap[lnbLive.lnbId].name.compare(emptyHardwareId) == 0) { vector<uint32_t> ids; ASSERT_TRUE(mLnbTests.getLnbIds(ids)); if (ids.size() == 0) { return; } ASSERT_TRUE(ids.size() > 0); ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); } else { uint32_t id; ASSERT_TRUE(mLnbTests.openLnbByName(lnbMap[lnbLive.lnbId].name, id)); } ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbArray[LNB0].voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbArray[LNB0].tone)); ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbArray[LNB0].position)); ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgArray[DISEQC_POWER_ON])); ASSERT_TRUE(mLnbTests.setVoltage(lnbMap[lnbLive.lnbId].voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbMap[lnbLive.lnbId].tone)); ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbMap[lnbLive.lnbId].position)); for (auto msgName : lnbLive.diseqcMsgs) { ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgMap[msgName])); } ASSERT_TRUE(mLnbTests.closeLnb()); } Loading Loading @@ -469,7 +460,7 @@ TEST_P(TunerFilterHidlTest, SetFilterLinkage) { TEST_P(TunerFilterHidlTest, testTimeFilter) { description("Open a timer filter in Demux and set time stamp."); // TODO use paramterized tests testTimeFilter(timeFilterArray[TIMER0]); testTimeFilter(timeFilterMap[timeFilter.timeFilterId]); } TEST_P(TunerBroadcastHidlTest, BroadcastDataFlowVideoFilterTest) { Loading Loading @@ -501,7 +492,7 @@ TEST_P(TunerBroadcastHidlTest, LnbBroadcastDataFlowVideoFilterTest) { return; } broadcastSingleFilterTestWithLnb(filterMap[lnbLive.videoFilterId], frontendMap[lnbLive.frontendId], lnbArray[LNB0]); frontendMap[lnbLive.frontendId], lnbMap[lnbLive.lnbId]); } TEST_P(TunerPlaybackHidlTest, PlaybackDataFlowWithTsSectionFilterTest) { Loading Loading @@ -538,7 +529,7 @@ TEST_P(TunerRecordHidlTest, LnbRecordDataFlowWithTsRecordFilterTest) { } recordSingleFilterTestWithLnb(filterMap[lnbRecord.recordFilterId], frontendMap[lnbRecord.frontendId], dvrMap[lnbRecord.dvrRecordId], lnbArray[LNB0]); lnbMap[lnbRecord.lnbId]); } TEST_P(TunerDescramblerHidlTest, CreateDescrambler) { Loading tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,14 +35,14 @@ bool initConfiguration() { initFrontendConfig(); initFilterConfig(); initDvrConfig(); initLnbConfig(); initTimeFilterConfig(); connectHardwaresToTestCases(); if (!validateConnections()) { ALOGW("[vts] failed to validate connections."); return false; } initLnbConfig(); initTimeFilterConfig(); initDescramblerConfig(); return true; Loading tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TestConfigurations.h +42 −62 Original line number Diff line number Diff line Loading @@ -79,46 +79,17 @@ const uint32_t FMQ_SIZE_16M = 0x1000000; " \"track_types\": [ ] " \ "} " typedef enum { TIMER0, TIMER_MAX, } TimeFilter; typedef enum { SOURCE, SINK, LINKAGE_DIR, } Linkage; typedef enum { LNB0, LNB_EXTERNAL, LNB_MAX, } Lnb; typedef enum { DISEQC_POWER_ON, DISEQC_MAX, } Diseqc; typedef enum { DESC_0, DESC_MAX, } Descrambler; struct TimeFilterConfig { bool supportTimeFilter; uint64_t timeStamp; }; struct LnbConfig { bool usingLnb; string name; LnbVoltage voltage; LnbTone tone; LnbPosition position; }; struct DescramblerConfig { uint32_t casSystemId; string provisionStr; Loading @@ -126,9 +97,6 @@ struct DescramblerConfig { }; // TODO: remove all the manual config array after the dynamic config refactoring is done. static LnbConfig lnbArray[LNB_MAX]; static vector<uint8_t> diseqcMsgArray[DISEQC_MAX]; static TimeFilterConfig timeFilterArray[TIMER_MAX]; static DemuxFilterType filterLinkageTypes[LINKAGE_DIR][FILTER_MAIN_TYPE_BIT_COUNT]; static DescramblerConfig descramblerArray[DESC_MAX]; Loading @@ -136,6 +104,9 @@ static DescramblerConfig descramblerArray[DESC_MAX]; static map<string, FrontendConfig> frontendMap; static map<string, FilterConfig> filterMap; static map<string, DvrConfig> dvrMap; static map<string, LnbConfig> lnbMap; static map<string, TimeFilterConfig> timeFilterMap; static map<string, vector<uint8_t>> diseqcMsgMap; // Hardware and test cases connections static LiveBroadcastHardwareConnections live; Loading @@ -145,6 +116,7 @@ static DvrRecordHardwareConnections record; static DescramblingHardwareConnections descrambling; static LnbLiveHardwareConnections lnbLive; static LnbRecordHardwareConnections lnbRecord; static TimeFilterHardwareConnections timeFilter; /** Config all the frontends that would be used in the tests */ inline void initFrontendConfig() { Loading Loading @@ -202,6 +174,19 @@ inline void initDvrConfig() { TunerTestingConfigReader::readDvrConfig1_0(dvrMap); }; /** Config all the lnbs that would be used in the tests */ inline void initLnbConfig() { // Read customized config TunerTestingConfigReader::readLnbConfig1_0(lnbMap); TunerTestingConfigReader::readDiseqcMessages(diseqcMsgMap); }; /** Config all the time filters that would be used in the tests */ inline void initTimeFilterConfig() { // Read customized config TunerTestingConfigReader::readTimeFilterConfig1_0(timeFilterMap); }; /** Read the vendor configurations of which hardware to use for each test cases/data flows */ inline void connectHardwaresToTestCases() { TunerTestingConfigReader::connectLiveBroadcast(live); Loading @@ -211,6 +196,7 @@ inline void connectHardwaresToTestCases() { TunerTestingConfigReader::connectDescrambling(descrambling); TunerTestingConfigReader::connectLnbLive(lnbLive); TunerTestingConfigReader::connectLnbRecord(lnbRecord); TunerTestingConfigReader::connectTimeFilter(timeFilter); }; inline bool validateConnections() { Loading @@ -233,14 +219,12 @@ inline bool validateConnections() { ? dvrMap.find(live.dvrSoftwareFeId) != dvrMap.end() : true; dvrIsValid &= playback.support ? dvrMap.find(playback.dvrId) != dvrMap.end() : true; if (record.support) { if (frontendMap[record.frontendId].isSoftwareFe) { dvrIsValid &= dvrMap.find(record.dvrSoftwareFeId) != dvrMap.end(); } dvrIsValid &= dvrMap.find(record.dvrRecordId) != dvrMap.end(); } if (descrambling.support && frontendMap[descrambling.frontendId].isSoftwareFe) { dvrIsValid &= dvrMap.find(descrambling.dvrSoftwareFeId) != dvrMap.end(); } Loading @@ -252,24 +236,19 @@ inline bool validateConnections() { bool filterIsValid = filterMap.find(live.audioFilterId) != filterMap.end() && filterMap.find(live.videoFilterId) != filterMap.end(); filterIsValid &= playback.support ? (filterMap.find(playback.audioFilterId) != filterMap.end() && filterMap.find(playback.videoFilterId) != filterMap.end()) : true; filterIsValid &= record.support ? filterMap.find(record.recordFilterId) != filterMap.end() : true; filterIsValid &= descrambling.support ? (filterMap.find(descrambling.audioFilterId) != filterMap.end() && filterMap.find(descrambling.videoFilterId) != filterMap.end()) : true; filterIsValid &= lnbLive.support ? (filterMap.find(lnbLive.audioFilterId) != filterMap.end() && filterMap.find(lnbLive.videoFilterId) != filterMap.end()) : true; filterIsValid &= lnbRecord.support ? filterMap.find(lnbRecord.recordFilterId) != filterMap.end() : true; Loading @@ -278,34 +257,35 @@ inline bool validateConnections() { return false; } return true; bool lnbIsValid = lnbLive.support ? lnbMap.find(lnbLive.lnbId) != lnbMap.end() : true; lnbIsValid &= lnbRecord.support ? lnbMap.find(lnbRecord.lnbId) != lnbMap.end() : true; if (!lnbIsValid) { ALOGW("[vts config] dynamic config lnb connection is invalid."); return false; } // TODO: remove all the manual configs after the dynamic config refactoring is done. /** Configuration array for the Lnb test */ inline void initLnbConfig() { lnbArray[LNB0].usingLnb = true; lnbArray[LNB0].voltage = LnbVoltage::VOLTAGE_12V; lnbArray[LNB0].tone = LnbTone::NONE; lnbArray[LNB0].position = LnbPosition::UNDEFINED; lnbArray[LNB_EXTERNAL].usingLnb = true; lnbArray[LNB_EXTERNAL].name = "default_lnb_external"; lnbArray[LNB_EXTERNAL].voltage = LnbVoltage::VOLTAGE_5V; lnbArray[LNB_EXTERNAL].tone = LnbTone::NONE; lnbArray[LNB_EXTERNAL].position = LnbPosition::UNDEFINED; }; bool diseqcMsgIsValid = true; if (lnbLive.support) { for (auto msgName : lnbLive.diseqcMsgs) { diseqcMsgIsValid &= diseqcMsgMap.find(msgName) != diseqcMsgMap.end(); } } if (lnbRecord.support) { for (auto msgName : lnbRecord.diseqcMsgs) { diseqcMsgIsValid &= diseqcMsgMap.find(msgName) != diseqcMsgMap.end(); } } /** Diseqc messages array for the Lnb test */ inline void initDiseqcMsg() { diseqcMsgArray[DISEQC_POWER_ON] = {0xE, 0x0, 0x0, 0x0, 0x0, 0x3}; }; if (!diseqcMsgIsValid) { ALOGW("[vts config] dynamic config diseqcMsg sender is invalid."); return false; } /** Configuration array for the timer filter test */ inline void initTimeFilterConfig() { timeFilterArray[TIMER0].supportTimeFilter = true; timeFilterArray[TIMER0].timeStamp = 1; return true; } // TODO: remove all the manual configs after the dynamic config refactoring is done. /** Configuration array for the descrambler test */ inline void initDescramblerConfig() { descramblerArray[DESC_0].casSystemId = CLEAR_KEY_SYSTEM_ID; Loading Loading
tv/tuner/1.0/vts/functional/LnbTests.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -48,10 +48,11 @@ AssertionResult LnbTests::openLnbById(uint32_t lnbId) { return AssertionResult(status == Result::SUCCESS); } AssertionResult LnbTests::openLnbByName(string lnbName) { AssertionResult LnbTests::openLnbByName(string lnbName, uint32_t& id) { Result status; mService->openLnbByName(lnbName, [&](Result result, uint32_t /*lnbId*/, const sp<ILnb>& lnb) { mService->openLnbByName(lnbName, [&](Result result, uint32_t lnbId, const sp<ILnb>& lnb) { mLnb = lnb; id = lnbId; status = result; }); Loading
tv/tuner/1.0/vts/functional/LnbTests.h +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ class LnbTests { AssertionResult getLnbIds(vector<uint32_t>& ids); AssertionResult openLnbById(uint32_t lnbId); AssertionResult openLnbByName(string lnbName); AssertionResult openLnbByName(string lnbName, uint32_t& lnbId); AssertionResult setLnbCallback(); AssertionResult setVoltage(LnbVoltage voltage); AssertionResult setTone(LnbTone tone); Loading
tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp +40 −49 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ void TunerFilterHidlTest::configSingleFilterInDemuxTest(FilterConfig filterConf, } void TunerFilterHidlTest::testTimeFilter(TimeFilterConfig filterConf) { if (!filterConf.supportTimeFilter) { if (!timeFilter.support) { return; } uint32_t demuxId; Loading @@ -64,11 +64,8 @@ void TunerFilterHidlTest::testTimeFilter(TimeFilterConfig filterConf) { DemuxCapabilities caps; ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); // TODO: add time filter hardware support checker ASSERT_TRUE(mDemuxTests.getDemuxCaps(caps)); if (!caps.bTimeFilter) { return; } ASSERT_TRUE(caps.bTimeFilter); mFilterTests.setDemux(demux); ASSERT_TRUE(mFilterTests.openTimeFilterInDemux()); ASSERT_TRUE(mFilterTests.setTimeStamp(filterConf.timeStamp)); Loading Loading @@ -116,14 +113,16 @@ void TunerBroadcastHidlTest::broadcastSingleFilterTest(FilterConfig filterConf, void TunerBroadcastHidlTest::broadcastSingleFilterTestWithLnb(FilterConfig filterConf, FrontendConfig frontendConf, LnbConfig lnbConf) { if (lnbConf.name.compare(emptyHardwareId) == 0) { vector<uint32_t> ids; ASSERT_TRUE(mLnbTests.getLnbIds(ids)); if (ids.size() == 0) { return; } ASSERT_TRUE(ids.size() > 0); ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); mLnbId = &ids[0]; } else { mLnbId = (uint32_t*)malloc(sizeof(uint32_t)); ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, *mLnbId)); } ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbConf.tone)); Loading Loading @@ -212,18 +211,23 @@ void TunerRecordHidlTest::recordSingleFilterTest(FilterConfig filterConf, void TunerRecordHidlTest::recordSingleFilterTestWithLnb(FilterConfig filterConf, FrontendConfig frontendConf, DvrConfig dvrConf, LnbConfig lnbConf) { if (lnbConf.name.compare(emptyHardwareId) == 0) { vector<uint32_t> ids; ASSERT_TRUE(mLnbTests.getLnbIds(ids)); if (ids.size() == 0) { return; } ASSERT_TRUE(ids.size() > 0); ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); mLnbId = &ids[0]; } else { mLnbId = (uint32_t*)malloc(sizeof(uint32_t)); ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, *mLnbId)); } ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbConf.tone)); ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbConf.position)); for (auto msgName : lnbRecord.diseqcMsgs) { ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgMap[msgName])); } recordSingleFilterTest(filterConf, frontendConf, dvrConf); ASSERT_TRUE(mLnbTests.closeLnb()); mLnbId = nullptr; Loading Loading @@ -343,37 +347,24 @@ TEST_P(TunerFrontendHidlTest, BlindScanFrontend) { mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_BLIND); } TEST_P(TunerLnbHidlTest, OpenLnbByName) { description("Open and configure an Lnb with name then send a diseqc msg to it."); // TODO: add lnb hardware support checker vector<uint32_t> ids; ASSERT_TRUE(mLnbTests.getLnbIds(ids)); if (ids.size() == 0) { return; } ASSERT_TRUE(mLnbTests.openLnbByName(lnbArray[LNB_EXTERNAL].name)); ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbArray[LNB_EXTERNAL].voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbArray[LNB_EXTERNAL].tone)); ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbArray[LNB_EXTERNAL].position)); ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgArray[DISEQC_POWER_ON])); ASSERT_TRUE(mLnbTests.closeLnb()); } TEST_P(TunerLnbHidlTest, SendDiseqcMessageToLnb) { description("Open and configure an Lnb with specific settings then send a diseqc msg to it."); if (lnbMap[lnbLive.lnbId].name.compare(emptyHardwareId) == 0) { vector<uint32_t> ids; ASSERT_TRUE(mLnbTests.getLnbIds(ids)); if (ids.size() == 0) { return; } ASSERT_TRUE(ids.size() > 0); ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); } else { uint32_t id; ASSERT_TRUE(mLnbTests.openLnbByName(lnbMap[lnbLive.lnbId].name, id)); } ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbArray[LNB0].voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbArray[LNB0].tone)); ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbArray[LNB0].position)); ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgArray[DISEQC_POWER_ON])); ASSERT_TRUE(mLnbTests.setVoltage(lnbMap[lnbLive.lnbId].voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbMap[lnbLive.lnbId].tone)); ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbMap[lnbLive.lnbId].position)); for (auto msgName : lnbLive.diseqcMsgs) { ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgMap[msgName])); } ASSERT_TRUE(mLnbTests.closeLnb()); } Loading Loading @@ -469,7 +460,7 @@ TEST_P(TunerFilterHidlTest, SetFilterLinkage) { TEST_P(TunerFilterHidlTest, testTimeFilter) { description("Open a timer filter in Demux and set time stamp."); // TODO use paramterized tests testTimeFilter(timeFilterArray[TIMER0]); testTimeFilter(timeFilterMap[timeFilter.timeFilterId]); } TEST_P(TunerBroadcastHidlTest, BroadcastDataFlowVideoFilterTest) { Loading Loading @@ -501,7 +492,7 @@ TEST_P(TunerBroadcastHidlTest, LnbBroadcastDataFlowVideoFilterTest) { return; } broadcastSingleFilterTestWithLnb(filterMap[lnbLive.videoFilterId], frontendMap[lnbLive.frontendId], lnbArray[LNB0]); frontendMap[lnbLive.frontendId], lnbMap[lnbLive.lnbId]); } TEST_P(TunerPlaybackHidlTest, PlaybackDataFlowWithTsSectionFilterTest) { Loading Loading @@ -538,7 +529,7 @@ TEST_P(TunerRecordHidlTest, LnbRecordDataFlowWithTsRecordFilterTest) { } recordSingleFilterTestWithLnb(filterMap[lnbRecord.recordFilterId], frontendMap[lnbRecord.frontendId], dvrMap[lnbRecord.dvrRecordId], lnbArray[LNB0]); lnbMap[lnbRecord.lnbId]); } TEST_P(TunerDescramblerHidlTest, CreateDescrambler) { Loading
tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,14 +35,14 @@ bool initConfiguration() { initFrontendConfig(); initFilterConfig(); initDvrConfig(); initLnbConfig(); initTimeFilterConfig(); connectHardwaresToTestCases(); if (!validateConnections()) { ALOGW("[vts] failed to validate connections."); return false; } initLnbConfig(); initTimeFilterConfig(); initDescramblerConfig(); return true; Loading
tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TestConfigurations.h +42 −62 Original line number Diff line number Diff line Loading @@ -79,46 +79,17 @@ const uint32_t FMQ_SIZE_16M = 0x1000000; " \"track_types\": [ ] " \ "} " typedef enum { TIMER0, TIMER_MAX, } TimeFilter; typedef enum { SOURCE, SINK, LINKAGE_DIR, } Linkage; typedef enum { LNB0, LNB_EXTERNAL, LNB_MAX, } Lnb; typedef enum { DISEQC_POWER_ON, DISEQC_MAX, } Diseqc; typedef enum { DESC_0, DESC_MAX, } Descrambler; struct TimeFilterConfig { bool supportTimeFilter; uint64_t timeStamp; }; struct LnbConfig { bool usingLnb; string name; LnbVoltage voltage; LnbTone tone; LnbPosition position; }; struct DescramblerConfig { uint32_t casSystemId; string provisionStr; Loading @@ -126,9 +97,6 @@ struct DescramblerConfig { }; // TODO: remove all the manual config array after the dynamic config refactoring is done. static LnbConfig lnbArray[LNB_MAX]; static vector<uint8_t> diseqcMsgArray[DISEQC_MAX]; static TimeFilterConfig timeFilterArray[TIMER_MAX]; static DemuxFilterType filterLinkageTypes[LINKAGE_DIR][FILTER_MAIN_TYPE_BIT_COUNT]; static DescramblerConfig descramblerArray[DESC_MAX]; Loading @@ -136,6 +104,9 @@ static DescramblerConfig descramblerArray[DESC_MAX]; static map<string, FrontendConfig> frontendMap; static map<string, FilterConfig> filterMap; static map<string, DvrConfig> dvrMap; static map<string, LnbConfig> lnbMap; static map<string, TimeFilterConfig> timeFilterMap; static map<string, vector<uint8_t>> diseqcMsgMap; // Hardware and test cases connections static LiveBroadcastHardwareConnections live; Loading @@ -145,6 +116,7 @@ static DvrRecordHardwareConnections record; static DescramblingHardwareConnections descrambling; static LnbLiveHardwareConnections lnbLive; static LnbRecordHardwareConnections lnbRecord; static TimeFilterHardwareConnections timeFilter; /** Config all the frontends that would be used in the tests */ inline void initFrontendConfig() { Loading Loading @@ -202,6 +174,19 @@ inline void initDvrConfig() { TunerTestingConfigReader::readDvrConfig1_0(dvrMap); }; /** Config all the lnbs that would be used in the tests */ inline void initLnbConfig() { // Read customized config TunerTestingConfigReader::readLnbConfig1_0(lnbMap); TunerTestingConfigReader::readDiseqcMessages(diseqcMsgMap); }; /** Config all the time filters that would be used in the tests */ inline void initTimeFilterConfig() { // Read customized config TunerTestingConfigReader::readTimeFilterConfig1_0(timeFilterMap); }; /** Read the vendor configurations of which hardware to use for each test cases/data flows */ inline void connectHardwaresToTestCases() { TunerTestingConfigReader::connectLiveBroadcast(live); Loading @@ -211,6 +196,7 @@ inline void connectHardwaresToTestCases() { TunerTestingConfigReader::connectDescrambling(descrambling); TunerTestingConfigReader::connectLnbLive(lnbLive); TunerTestingConfigReader::connectLnbRecord(lnbRecord); TunerTestingConfigReader::connectTimeFilter(timeFilter); }; inline bool validateConnections() { Loading @@ -233,14 +219,12 @@ inline bool validateConnections() { ? dvrMap.find(live.dvrSoftwareFeId) != dvrMap.end() : true; dvrIsValid &= playback.support ? dvrMap.find(playback.dvrId) != dvrMap.end() : true; if (record.support) { if (frontendMap[record.frontendId].isSoftwareFe) { dvrIsValid &= dvrMap.find(record.dvrSoftwareFeId) != dvrMap.end(); } dvrIsValid &= dvrMap.find(record.dvrRecordId) != dvrMap.end(); } if (descrambling.support && frontendMap[descrambling.frontendId].isSoftwareFe) { dvrIsValid &= dvrMap.find(descrambling.dvrSoftwareFeId) != dvrMap.end(); } Loading @@ -252,24 +236,19 @@ inline bool validateConnections() { bool filterIsValid = filterMap.find(live.audioFilterId) != filterMap.end() && filterMap.find(live.videoFilterId) != filterMap.end(); filterIsValid &= playback.support ? (filterMap.find(playback.audioFilterId) != filterMap.end() && filterMap.find(playback.videoFilterId) != filterMap.end()) : true; filterIsValid &= record.support ? filterMap.find(record.recordFilterId) != filterMap.end() : true; filterIsValid &= descrambling.support ? (filterMap.find(descrambling.audioFilterId) != filterMap.end() && filterMap.find(descrambling.videoFilterId) != filterMap.end()) : true; filterIsValid &= lnbLive.support ? (filterMap.find(lnbLive.audioFilterId) != filterMap.end() && filterMap.find(lnbLive.videoFilterId) != filterMap.end()) : true; filterIsValid &= lnbRecord.support ? filterMap.find(lnbRecord.recordFilterId) != filterMap.end() : true; Loading @@ -278,34 +257,35 @@ inline bool validateConnections() { return false; } return true; bool lnbIsValid = lnbLive.support ? lnbMap.find(lnbLive.lnbId) != lnbMap.end() : true; lnbIsValid &= lnbRecord.support ? lnbMap.find(lnbRecord.lnbId) != lnbMap.end() : true; if (!lnbIsValid) { ALOGW("[vts config] dynamic config lnb connection is invalid."); return false; } // TODO: remove all the manual configs after the dynamic config refactoring is done. /** Configuration array for the Lnb test */ inline void initLnbConfig() { lnbArray[LNB0].usingLnb = true; lnbArray[LNB0].voltage = LnbVoltage::VOLTAGE_12V; lnbArray[LNB0].tone = LnbTone::NONE; lnbArray[LNB0].position = LnbPosition::UNDEFINED; lnbArray[LNB_EXTERNAL].usingLnb = true; lnbArray[LNB_EXTERNAL].name = "default_lnb_external"; lnbArray[LNB_EXTERNAL].voltage = LnbVoltage::VOLTAGE_5V; lnbArray[LNB_EXTERNAL].tone = LnbTone::NONE; lnbArray[LNB_EXTERNAL].position = LnbPosition::UNDEFINED; }; bool diseqcMsgIsValid = true; if (lnbLive.support) { for (auto msgName : lnbLive.diseqcMsgs) { diseqcMsgIsValid &= diseqcMsgMap.find(msgName) != diseqcMsgMap.end(); } } if (lnbRecord.support) { for (auto msgName : lnbRecord.diseqcMsgs) { diseqcMsgIsValid &= diseqcMsgMap.find(msgName) != diseqcMsgMap.end(); } } /** Diseqc messages array for the Lnb test */ inline void initDiseqcMsg() { diseqcMsgArray[DISEQC_POWER_ON] = {0xE, 0x0, 0x0, 0x0, 0x0, 0x3}; }; if (!diseqcMsgIsValid) { ALOGW("[vts config] dynamic config diseqcMsg sender is invalid."); return false; } /** Configuration array for the timer filter test */ inline void initTimeFilterConfig() { timeFilterArray[TIMER0].supportTimeFilter = true; timeFilterArray[TIMER0].timeStamp = 1; return true; } // TODO: remove all the manual configs after the dynamic config refactoring is done. /** Configuration array for the descrambler test */ inline void initDescramblerConfig() { descramblerArray[DESC_0].casSystemId = CLEAR_KEY_SYSTEM_ID; Loading