Skip to content

Commit

Permalink
Correct scripts for Low Voltage
Browse files Browse the repository at this point in the history
  • Loading branch information
dboltovskyi committed Sep 16, 2019
1 parent dbdc5d5 commit ccab754
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
-- 4. App closes connection
-- 5. And then SDL get WAKE_UP signal
-- SDL does:
-- 1. not resume FULL HMILevel for app
-- 2. not resume persistent data
-- 1. save resumption data
-- 2. resume FULL HMILevel for app
-- 3. resume persistent data
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require('test_scripts/SDL5_0/LowVoltage/common')
Expand All @@ -22,29 +23,24 @@ local function addCommand()
end

local function checkResumptionData()
common.getHMIConnection():ExpectRequest("VR.AddCommand")
:Times(0)
end

local function checkResumptionHMILevel()
common.getHMIConnection():ExpectRequest("BasicCommunication.ActivateApp")
:Times(0)
common.getMobileSession():ExpectNotification("OnHMIStatus",
{ hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" })
common.rpcCheck.AddCommand(1, 1)
end

local function checkAppId(pAppId, pData)
if pData.params.application.appID == common.getHMIAppId(pAppId) then
return false, "App " .. pAppId .. " is registered with the same HMI App Id"
if pData.params.application.appID ~= common.getHMIAppId(pAppId) then
return false, "App " .. pAppId .. " is registered with not the same HMI App Id"
end
return true
end

local function sendWakeUpSignal()
common.cleanSessions()
common.sendWakeUpSignal()
common.getHMIConnection():ExpectNotification("BasicCommunication.OnAppUnregistered")
:Times(0)
common.getHMIConnection():ExpectNotification("BasicCommunication.OnAppUnregistered", {
unexpectedDisconnect = true,
appID = common.getHMIAppId()
})
RUN_AFTER(function() common.cleanSessions() end, 100)
RUN_AFTER(function() common.sendWakeUpSignal() end, 1000)
common.wait(3000)
end

--[[ Scenario ]]
Expand All @@ -61,7 +57,7 @@ runner.Step("Send LOW_VOLTAGE signal", common.sendLowVoltageSignal)
runner.Step("Send WAKE_UP signal", sendWakeUpSignal)
runner.Step("Re-connect Mobile", common.connectMobile)
runner.Step("Re-register App, check resumption data and HMI level", common.reRegisterApp, {
1, checkAppId, checkResumptionData, checkResumptionHMILevel, "RESUME_FAILED", 11000
1, checkAppId, checkResumptionData, common.checkResumptionHMILevel, "SUCCESS", 1000
})

runner.Title("Postconditions")
Expand Down
4 changes: 2 additions & 2 deletions test_sets/SDL5_0/low_voltage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
./test_scripts/SDL5_0/LowVoltage/019_Low_Voltage_and_Wake_Up_resumption_LIMITED_hmi_level_without_disconnect_before_low_voltage.lua
./test_scripts/SDL5_0/LowVoltage/020_Low_Voltage_and_Ignition_Off_absence_resumption_FULL_hmi_level_in_case_more_30_sec_after_ing_on.lua
./test_scripts/SDL5_0/LowVoltage/021_Low_Voltage_and_Ignition_Off_absence_resumption_LIMITED_hmi_level_in_case_more_30_sec_after_ing_on.lua
./test_scripts/SDL5_0/LowVoltage/022_Low_Voltage_and_Wake_Up_no_timeout_no_resumption.lua
./test_scripts/SDL5_0/LowVoltage/023_Low_Voltage_and_Wake_Up_no_timeout_resumption.lua
./test_scripts/SDL5_0/LowVoltage/022_Low_Voltage_and_Wake_Up_no_timeout_disconnect_before_resumption.lua
./test_scripts/SDL5_0/LowVoltage/023_Low_Voltage_and_Wake_Up_no_timeout_disconnect_after_resumption.lua

0 comments on commit ccab754

Please sign in to comment.