diff --git a/test_scripts/Defects/4_5/1881_OnDriverDistraction_After_changing_HMIlevel_from_NONE.lua b/test_scripts/Defects/4_5/1881_OnDriverDistraction_After_changing_HMIlevel_from_NONE.lua index 9535a3ba2f..9e576df6cd 100644 --- a/test_scripts/Defects/4_5/1881_OnDriverDistraction_After_changing_HMIlevel_from_NONE.lua +++ b/test_scripts/Defects/4_5/1881_OnDriverDistraction_After_changing_HMIlevel_from_NONE.lua @@ -13,6 +13,18 @@ config.application2.registerAppInterfaceParams.isMediaApplication = false config.application2.registerAppInterfaceParams.appHMIType = {"DEFAULT"} --[[ Local Functions ]] +-- Prepare policy table for policy table update +-- @tparam table tbl table to update +local function ptUpdateFunc(pTbl) + -- make sure that OnDriverDistraction is disallowed in HMILevel NONE + pTbl.policy_table.functional_groupings["Base-4"].rpcs["OnDriverDistraction"].hmi_levels = { + "FULL", + "LIMITED", + "BACKGROUND" + } +end + + --! @OnDDinNONE: Processing OnDriverDistraction notification with expectations 0 times --! @parameters: --! id - id of session, @@ -157,7 +169,7 @@ runner.Step("Clean environment", commonDefects.preconditions) -- Start SDL and HMI, establish connection between SDL and HMI, open mobile connection via TCP and create mobile session runner.Step("Start SDL, HMI, connect Mobile, start Session", commonDefects.start) -- Register application, perform PTU -runner.Step("RAI, PTU", commonDefects.rai_ptu) +runner.Step("RAI, PTU", commonDefects.rai_ptu, {ptUpdateFunc}) runner.Title("Test") -- Absence of OnDriverDistraction notification on mobile app in NONE HMI level @@ -167,9 +179,9 @@ runner.Step("OnDriverDistraction_in_FULL", ActivationAppWithOnDD, {{state = "DD_ runner.Step("UnregisterRegisterApp", commonDefects.unregisterApp, {1}) -- Register first application -runner.Step("RAI_first_app", commonDefects.rai_n, {1}) +runner.Step("RAI_first_app", commonDefects.rai_n, {1, false}) -- Register second application -runner.Step("RAI_second_app", commonDefects.rai_ptu_n, {2}) +runner.Step("RAI_second_app", commonDefects.rai_ptu_n, {2, ptUpdateFunc}) -- Activate first application runner.Step("Activate_first_app", commonDefects.activate_app) -- Receiving OnDriverDistraction notification on mobile app with FULL HMI level diff --git a/test_scripts/Defects/4_5/commonDefects.lua b/test_scripts/Defects/4_5/commonDefects.lua index 9b106fd952..85223e7dfc 100644 --- a/test_scripts/Defects/4_5/commonDefects.lua +++ b/test_scripts/Defects/4_5/commonDefects.lua @@ -410,9 +410,10 @@ end --! self - test object --! @return: none --]] -function commonDefect.rai_n(id, self) - self, id = commonDefect.getSelfAndParams(id, self) +function commonDefect.rai_n(id, expect_dd, self) + self, id, expect_dd = commonDefect.getSelfAndParams(id, expect_dd, self) if not id then id = 1 end + if expect_dd == nil then expect_dd = true end self["mobileSession" .. id] = mobile_session.MobileSession(self, self.mobileConnection) self["mobileSession" .. id]:StartService(7) :Do(function() @@ -429,6 +430,11 @@ function commonDefect.rai_n(id, self) { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) :Times(AtLeast(1)) self["mobileSession" .. id]:ExpectNotification("OnPermissionsChange") + if expect_dd then + self["mobileSession" .. id]:ExpectNotification("OnDriverDistraction", { state = "DD_OFF" }) + else + self["mobileSession" .. id]:ExpectNotification("OnDriverDistraction"):Times(0) + end end) end) end diff --git a/test_scripts/Defects/commonDefects.lua b/test_scripts/Defects/commonDefects.lua index 6962abe0bf..5a28bec51d 100644 --- a/test_scripts/Defects/commonDefects.lua +++ b/test_scripts/Defects/commonDefects.lua @@ -430,6 +430,7 @@ function commonDefect.rai_n(id, self) { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) :Times(AtLeast(1)) self["mobileSession" .. id]:ExpectNotification("OnPermissionsChange") + self["mobileSession" .. id]:ExpectNotification("OnDriverDistraction", { state = "DD_OFF" }) end) end) end diff --git a/test_scripts/RC/commonRC.lua b/test_scripts/RC/commonRC.lua index 55edd4157c..3526622f57 100644 --- a/test_scripts/RC/commonRC.lua +++ b/test_scripts/RC/commonRC.lua @@ -233,6 +233,7 @@ function commonRC.rai_n(id, self) self["mobileSession" .. id]:ExpectNotification("OnHMIStatus", { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) :Times(AtLeast(1)) -- issue with SDL --> notification is sent twice self["mobileSession" .. id]:ExpectNotification("OnPermissionsChange") + self["mobileSession" .. id]:ExpectNotification("OnDriverDistraction", { state = "DD_OFF" }) end) end) end diff --git a/test_scripts/Smoke/commonSmoke.lua b/test_scripts/Smoke/commonSmoke.lua index fcfa798b48..b8b690ef58 100644 --- a/test_scripts/Smoke/commonSmoke.lua +++ b/test_scripts/Smoke/commonSmoke.lua @@ -280,6 +280,7 @@ function commonSmoke.registerApp(pAppId, self) mobSession:ExpectNotification("OnHMIStatus", { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) mobSession:ExpectNotification("OnPermissionsChange") + mobSession:ExpectNotification("OnDriverDistraction", { state = "DD_OFF" }) end) end) end