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

Add script to verify 3406 issue #2504

Merged
merged 2 commits into from
Jan 20, 2021
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
@@ -0,0 +1,70 @@
----------------------------------------------------------------------------------------------------
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3406
----------------------------------------------------------------------------------------------------
-- Description: Check SDL is able to proceed with special characters in 'syncFileName' of 'SetAppIcon'
--
-- Steps:
-- 1. App is registered
-- 2. App uploads some icon with special character(s) in 'syncFileName'
-- 3. App sends 'SetAppIcon' with this file
-- SDL does:
-- - Transfer request to HMI
-- - Upon receive successful response from HMI transfers it to App
----------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local common = require("user_modules/sequences/actions")

--[[ General configuration parameters ]]
runner.testSettings.isSelfIncluded = false

--[[ Local Variables ]]
local fileName = "action !#$&'()*+,:;=?@[].png"
local putFileParams = {
requestParams = {
syncFileName = fileName,
fileType = "GRAPHIC_PNG",
persistentFile = false,
systemFile = false
},
filePath = "files/icon.png"
}

local setAppIconParams = {
syncFileName = fileName
}

--[[ Local Functions ]]
local function sendPutFile(pParams)
local cid = common.getMobileSession():SendRPC("PutFile", pParams.requestParams, pParams.filePath)
common.getMobileSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS" })
end

local function sendSetAppIcon(pParams)
local dataToHMI = {
syncFileName = {
value = common.sdl.getPathToFileInStorage(pParams.syncFileName),
imageType = "DYNAMIC"
},
appID = common.getHMIAppId()
}
local cid = common.getMobileSession():SendRPC("SetAppIcon", pParams)
common.getHMIConnection():ExpectRequest("UI.SetAppIcon", dataToHMI)
:Do(function(_, data)
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {})
end)
common.getMobileSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS" })
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("Register App", common.registerApp)
runner.Step("Upload icon file", sendPutFile, { putFileParams })

runner.Title("Test")
runner.Step("App sends SetAppIcon", sendSetAppIcon, { setAppIconParams })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
1 change: 1 addition & 0 deletions test_sets/Defects/Defects_release_7_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
./test_scripts/Defects/7_1/1597_3_AlertManeuver_Unsupported_Speech_Type.lua
./test_scripts/Defects/7_1/1597_4_PerformAudioPassThru_Unsupported_Speech_Type.lua
./test_scripts/Defects/7_1/2803_Resumption_of_HMI_level_of_2nd_app.lua
./test_scripts/Defects/7_1/3406_SetAppIcon_spec_chars_in_syncFileName.lua