Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct scripts for Low Voltage #2261

Merged
merged 1 commit into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ local function checkAppId(pAppId, pData)
return true
end

local function sendWakeUpSignal()
common.sendWakeUpSignal()
common.getHMIConnection():SendNotification("BasicCommunication.OnEventChanged", {
isActive = false, eventName = "EMERGENCY_EVENT" })
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
Expand All @@ -111,7 +117,7 @@ runner.Step("Send LOW_VOLTAGE signal", common.sendLowVoltageSignal)
runner.Step("Check SDL Ignores RPCs from Mobile side", checkSDLIgnoresRPCFromMobileSide)
runner.Step("Check SDL Ignores RPCs from HMI side", checkSDLIgnoresRPCFromHMISide)
runner.Step("Close mobile connection", common.cleanSessions)
runner.Step("Send WAKE_UP signal", common.sendWakeUpSignal)
runner.Step("Send WAKE_UP signal", sendWakeUpSignal)
runner.Step("Re-connect Mobile", common.connectMobile)
for i = 1, numOfApps do
runner.Step("Re-register App " .. i .. ", check resumption data and HMI level", common.reRegisterApp, {
Expand Down
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