-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'smart/develop' into impl/defect_3175
- Loading branch information
Showing
17 changed files
with
718 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
147 changes: 147 additions & 0 deletions
147
...306_ResetGlobalProperties_does_not_reset_HELPPROMPT_and_VRHELPITEMS_to_default_values.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/1306 | ||
--------------------------------------------------------------------------------------------------- | ||
-- Steps: | ||
-- 1. Send SetGlobalProperties from mobile (helpPrompt, timeoutPrompt, vrHelpTitle, vrHelp) | ||
-- 2. Stop smartDeviceLinkCore in terminal (through ctrl+c) and do not exit from mobile app | ||
-- 3. Start smartDeviceLinkCore and HMI | ||
-- 4. Mobile App is registered and activated | ||
-- 5. Send SetGlobalProperties from mobile (helpPrompt, timeoutPrompt, vrHelpTitle, vrHelp) | ||
-- 6. Send ResetGlobalProperties from mobile (helpPrompt, timeoutPrompt, vrHelpTitle, vrHelp) | ||
-- | ||
-- SDL does: | ||
-- - send to HMI UI.SetGlobalProperties("vrHelpTitle", "vrHelp") with default values | ||
-- - send to HMI TTS.SetGlobalProperties with "helpPrompt" parameter that should be reset to default value | ||
-- (smartDeviceLink.ini file contains default values for "helpPrompt" | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require("user_modules/sequences/actions") | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local requestParams = { | ||
helpPrompt = {{ text = "Help prompt", type = "TEXT" }}, | ||
timeoutPrompt = {{ text = "Timeout prompt", type = "TEXT" }}, | ||
vrHelpTitle = "VR help title", | ||
vrHelp = {{ position = 1, text = "VR help item" }} | ||
} | ||
|
||
local UiParams = { | ||
vrHelpTitle = requestParams.vrHelpTitle, | ||
vrHelp = requestParams.vrHelp, | ||
} | ||
|
||
local TtsParams = { | ||
timeoutPrompt = requestParams.timeoutPrompt, | ||
helpPrompt = requestParams.helpPrompt | ||
} | ||
|
||
local allParams = { | ||
requestParams = requestParams, | ||
UiParams = UiParams, | ||
TtsParams = TtsParams | ||
} | ||
|
||
--[[ Local Functions ]] | ||
local function splitString(pInputStr, pSep) | ||
if pSep == nil then | ||
pSep = "%s" | ||
end | ||
local out, i = {}, 1 | ||
for str in string.gmatch(pInputStr, "([^" .. pSep .. "]+)") do | ||
out[i] = str | ||
i = i + 1 | ||
end | ||
return out | ||
end | ||
|
||
local function getResetGlobalPropertiesParams() | ||
local uiParams = { | ||
vrHelpTitle = common.sdl.getSDLIniParameter("HelpTitle"), | ||
vrHelp = {{ position = 1, text = common.getConfigAppParams().appName }} | ||
} | ||
|
||
local delimiter = common.sdl.getSDLIniParameter("TTSDelimiter") | ||
local paramHP = splitString(common.sdl.getSDLIniParameter("HelpPromt"), delimiter) | ||
local paramTP = splitString(common.sdl.getSDLIniParameter("TimeOutPromt"), delimiter) | ||
local helpPromptArray = {} | ||
local timeoutPromptArray = {} | ||
|
||
if next(paramHP) then | ||
for i = 1, #paramHP do | ||
helpPromptArray[i] = { text = paramHP[i] .. delimiter, type = "TEXT" } | ||
end | ||
end | ||
|
||
if next(paramTP) then | ||
for i = 1, #paramTP do | ||
timeoutPromptArray[i] = { text = paramTP[i] .. delimiter, type = "TEXT" } | ||
end | ||
end | ||
|
||
local ttsParams = { | ||
helpPrompt = helpPromptArray, | ||
timeoutPrompt = timeoutPromptArray | ||
} | ||
return uiParams, ttsParams | ||
end | ||
|
||
local function sendSetGlobalProperties(pParams) | ||
local cid = common.mobile.getSession():SendRPC("SetGlobalProperties", pParams.requestParams) | ||
|
||
pParams.UiParams.appID = common.getHMIAppId() | ||
common.hmi.getConnection():ExpectRequest("UI.SetGlobalProperties", pParams.UiParams) | ||
:Do(function(_,data) | ||
common.hmi.getConnection():SendResponse(data.id, data.method, "SUCCESS", {}) | ||
end) | ||
|
||
pParams.TtsParams.appID = common.getHMIAppId() | ||
common.hmi.getConnection():ExpectRequest("TTS.SetGlobalProperties", pParams.TtsParams) | ||
:Do(function(_,data) | ||
common.hmi.getConnection():SendResponse(data.id, data.method, "SUCCESS", {}) | ||
end) | ||
common.mobile.getSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS"}) | ||
common.mobile.getSession():ExpectNotification("OnHashChange") | ||
end | ||
|
||
local function sendResetGlobalProperties() | ||
local requesUIparams, requesTTSparams = getResetGlobalPropertiesParams() | ||
|
||
local cid = common.mobile.getSession():SendRPC("ResetGlobalProperties", { | ||
properties = { "VRHELPTITLE", "HELPPROMPT", "TIMEOUTPROMPT", "VRHELPITEMS" } | ||
}) | ||
|
||
common.hmi.getConnection():ExpectRequest("UI.SetGlobalProperties", requesUIparams) | ||
:Do(function(_,data) | ||
common.hmi.getConnection():SendResponse(data.id, data.method, "SUCCESS", {}) | ||
end) | ||
|
||
common.hmi.getConnection():ExpectRequest("TTS.SetGlobalProperties", requesTTSparams) | ||
:Do(function(_,data) | ||
common.hmi.getConnection():SendResponse(data.id, data.method, "SUCCESS", {}) | ||
end) | ||
common.mobile.getSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS"}) | ||
common.mobile.getSession():ExpectNotification("OnHashChange") | ||
end | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("RAI, PTU", common.app.register) | ||
runner.Step("Activate App", common.app.activate) | ||
|
||
runner.Title("Test") | ||
runner.Step("Send SetGlobalProperties", sendSetGlobalProperties, { allParams }) | ||
runner.Step("Stop SDL", StopSDL) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("RAI, PTU", common.app.registerNoPTU) | ||
runner.Step("Activate App", common.app.activate) | ||
runner.Step("Send SetGlobalProperties", sendSetGlobalProperties, { allParams }) | ||
runner.Step("Send ResetGlobalProperties", sendResetGlobalProperties) | ||
|
||
runner.Title("Postconditions") | ||
runner.Step("Stop SDL", common.postconditions) |
55 changes: 55 additions & 0 deletions
55
test_scripts/Defects/7_0/3547_1_RetryStrategy_for_start_streaming_Audio_HMI_last_SUCCESS.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3547 | ||
--------------------------------------------------------------------------------------------------- | ||
-- Steps: | ||
-- 1. Navigation app is registered | ||
-- 2. App try to start Audio service | ||
-- SDL does | ||
-- - send `Navi.StartAudioStream` request to HMI | ||
-- 3. HMI responds with 'REJECTED' | ||
-- SDL does: | ||
-- - re-sends `Navi.StartAudioStream` requests to HMI a few times | ||
-- (equal to `StartStreamRetry` .ini parameter) | ||
-- 4. HMI responds with 'SUCCESS' to the last request | ||
-- SDL does: | ||
-- - not send any new requests to HMI | ||
-- - not unregister App | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local common = require('test_scripts/Defects/7_0/common_3547') | ||
|
||
--[[ Local Variables ]] | ||
local expNumOfAttempts = 3 | ||
|
||
--[[ Local Functions ]] | ||
local function startAudioVideoService(pServiceId) | ||
common.mobile.getSession():StartService(pServiceId) | ||
common.hmi.getConnection():ExpectRequest(common.requestNames[pServiceId].start) | ||
:Do(function(exp, data) | ||
if exp.occurences == expNumOfAttempts + 1 then | ||
common.sendSuccessResponse(data, 500) | ||
else | ||
common.sendErrorResponse(data, 500) | ||
end | ||
end) | ||
:Times(expNumOfAttempts + 1) | ||
common.hmi.getConnection():ExpectNotification("BasicCommunication.OnAppUnregistered") | ||
:Times(0) | ||
common.mobile.getSession():ExpectNotification("OnAppInterfaceUnregistered") | ||
:Times(0) | ||
common.run.wait(4000) | ||
end | ||
|
||
--[[ Scenario ]] | ||
common.Title("Preconditions") | ||
common.Step("Clean environment", common.preconditions) | ||
common.Step("SetNewRetryValue", common.setSDLIniParameter, { "StartStreamRetry", expNumOfAttempts .. ", 1000" }) | ||
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
common.Step("RAI, PTU", common.registerApp) | ||
common.Step("Activate App", common.activateApp) | ||
|
||
common.Title("Test") | ||
common.Step("Retry sequence start AUDIO streaming", startAudioVideoService, { 10 }) | ||
|
||
common.Title("Postconditions") | ||
common.Step("Stop SDL", common.postconditions) |
55 changes: 55 additions & 0 deletions
55
test_scripts/Defects/7_0/3547_2_RetryStrategy_for_start_streaming_Video_HMI_last_SUCCESS.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3547 | ||
--------------------------------------------------------------------------------------------------- | ||
-- Steps: | ||
-- 1. Navigation app is registered | ||
-- 2. App try to start Video service | ||
-- SDL does | ||
-- - send `Navi.StartStream` request to HMI | ||
-- 3. HMI responds with 'REJECTED' | ||
-- SDL does: | ||
-- - re-sends `Navi.StartStream` requests to HMI a few times | ||
-- (equal to `StartStreamRetry` .ini parameter) | ||
-- 4. HMI responds with 'SUCCESS' to the last request | ||
-- SDL does: | ||
-- - not send any new requests to HMI | ||
-- - not unregister App | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local common = require('test_scripts/Defects/7_0/common_3547') | ||
|
||
--[[ Local Variables ]] | ||
local expNumOfAttempts = 3 | ||
|
||
--[[ Local Functions ]] | ||
local function startAudioVideoService(pServiceId) | ||
common.mobile.getSession():StartService(pServiceId) | ||
common.hmi.getConnection():ExpectRequest(common.requestNames[pServiceId].start) | ||
:Do(function(exp, data) | ||
if exp.occurences == expNumOfAttempts + 1 then | ||
common.sendSuccessResponse(data, 500) | ||
else | ||
common.sendErrorResponse(data, 500) | ||
end | ||
end) | ||
:Times(expNumOfAttempts + 1) | ||
common.hmi.getConnection():ExpectNotification("BasicCommunication.OnAppUnregistered") | ||
:Times(0) | ||
common.mobile.getSession():ExpectNotification("OnAppInterfaceUnregistered") | ||
:Times(0) | ||
common.run.wait(4000) | ||
end | ||
|
||
--[[ Scenario ]] | ||
common.Title("Preconditions") | ||
common.Step("Clean environment", common.preconditions) | ||
common.Step("SetNewRetryValue", common.setSDLIniParameter, { "StartStreamRetry", expNumOfAttempts .. ", 1000" }) | ||
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
common.Step("RAI, PTU", common.registerApp) | ||
common.Step("Activate App", common.activateApp) | ||
|
||
common.Title("Test") | ||
common.Step("Retry sequence start VIDEO streaming", startAudioVideoService, { 11 }) | ||
|
||
common.Title("Postconditions") | ||
common.Step("Stop SDL", common.postconditions) |
52 changes: 52 additions & 0 deletions
52
test_scripts/Defects/7_0/3547_3_RetryStrategy_for_start_streaming_Audio_HMI_all_REJECTED.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3547 | ||
--------------------------------------------------------------------------------------------------- | ||
-- Steps: | ||
-- 1. Navigation app is registered | ||
-- 2. App try to start Audio service | ||
-- SDL does | ||
-- - send `Navi.StartAudioStream` request to HMI | ||
-- 3. HMI responds with 'REJECTED' | ||
-- SDL does: | ||
-- - re-sends `Navi.StartAudioStream` requests to HMI a few times | ||
-- (equal to `StartStreamRetry` .ini parameter) | ||
-- 4. HMI responds with 'REJECTED' to all requests | ||
-- SDL does: | ||
-- - not send new `Navi.StartAudioStream` requests to HMI | ||
-- - unregister App once last response is received | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local common = require('test_scripts/Defects/7_0/common_3547') | ||
|
||
--[[ Local Variables ]] | ||
local expNumOfAttempts = 3 | ||
|
||
--[[ Local Functions ]] | ||
local function startAudioVideoService(pServiceId) | ||
common.mobile.getSession():StartService(pServiceId) | ||
common.hmi.getConnection():ExpectRequest(common.requestNames[pServiceId].start) | ||
:Do(function(_, data) | ||
common.sendErrorResponse(data, 500) | ||
end) | ||
:Times(expNumOfAttempts + 1) | ||
common.mobile.getSession():ExpectEndService(pServiceId) | ||
common.hmi.getConnection():ExpectRequest(common.requestNames[pServiceId].stop) | ||
common.hmi.getConnection():ExpectNotification("BasicCommunication.OnAppUnregistered") | ||
common.mobile.getSession():ExpectNotification("OnAppInterfaceUnregistered", { reason = "PROTOCOL_VIOLATION" }) | ||
common.run.wait(4000) | ||
end | ||
|
||
--[[ Scenario ]] | ||
common.Title("Preconditions") | ||
common.Step("Clean environment", common.preconditions) | ||
common.Step("SetNewRetryValue", common.setSDLIniParameter, { "StartStreamRetry", expNumOfAttempts .. ", 1000" }) | ||
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
common.Step("RAI, PTU", common.registerApp) | ||
common.Step("Activate App", common.activateApp) | ||
|
||
common.Title("Test") | ||
common.Step("Retry sequence start AUDIO streaming", startAudioVideoService, { 10 }) | ||
|
||
common.Title("Postconditions") | ||
common.Step("Stop SDL", common.postconditions) | ||
|
Oops, something went wrong.