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

[CCB-3175/3176] Add test scripts to check defect 3175/3176 #2450

Merged
merged 3 commits into from
Oct 30, 2020
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,39 @@
---------------------------------------------------------------------------------------------------
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3175
--
-- Description: SDL should successfully process VR.ChangeLanguage during PTU
--
-- Pre-conditions:
-- 1. Start SDL, HMI, connect Mobile device
-- 2. Register application which is new for SDL to trigger PTU
--
-- Steps:
-- 1. HMI sends VR.OnLanguageChange before receiving of URLs during PTU processing
-- SDL does:
-- - send OnLanguageChange notification to App
-- - send OnAppInterfaceUnregistered(reason = "LANGUAGE_CHANGE") notification to App
-- - send BasicCommunication.OnAppUnregistered(unexpectedDisconnect = false) to HMI
---------------------------------------------------------------------------------------------------

--[[ Required Shared libraries ]]
local common = require('test_scripts/Defects/7_0/3175/common_3175')

--[[ Local Functions ]]
local function performPTUWithVrOnLanguageChange()
local requestId = common.getHmiConnection():SendRequest("SDL.GetPolicyConfigurationData",
{ policyType = "module_config", property = "endpoints" })
common.getHmiConnection():ExpectResponse(requestId)
common.checkVrOnLanguageChangeProcessing()
end

--[[ Scenario ]]
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
common.Step("Register App", common.registerApp)

common.Title("Test")
common.Step("VR.OnLanguageChange before receiving of URLs during PTU processing", performPTUWithVrOnLanguageChange)

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---------------------------------------------------------------------------------------------------
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3175
--
-- Description: SDL should successfully process VR.ChangeLanguage during PTU
--
-- Pre-conditions:
-- 1. Start SDL, HMI, connect Mobile device
-- 2. Register application which is new for SDL to trigger PTU
--
-- Steps:
-- 1. HMI sends VR.OnLanguageChange after receiving of URLs during PTU processing
-- SDL does:
-- - send OnLanguageChange notification to App
-- - send OnAppInterfaceUnregistered(reason = "LANGUAGE_CHANGE") notification to App
-- - send BasicCommunication.OnAppUnregistered(unexpectedDisconnect = false) to HMI
---------------------------------------------------------------------------------------------------

--[[ Required Shared libraries ]]
local common = require('test_scripts/Defects/7_0/3175/common_3175')

--[[ Local Functions ]]
local function performPTUWithVrOnLanguageChange()
local requestId = common.getHmiConnection():SendRequest("SDL.GetPolicyConfigurationData",
{ policyType = "module_config", property = "endpoints" })
common.getHmiConnection():ExpectResponse(requestId)
:Do(function()
common.checkVrOnLanguageChangeProcessing()
end)
end

--[[ Scenario ]]
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
common.Step("Register App", common.registerApp)

common.Title("Test")
common.Step("VR.OnLanguageChange after receiving of URLs during PTU processing", performPTUWithVrOnLanguageChange)

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---------------------------------------------------------------------------------------------------
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3175
--
-- Description: SDL should successfully process VR.ChangeLanguage during PTU
--
-- Pre-conditions:
-- 1. Start SDL, HMI, connect Mobile device
-- 2. Register application which is new for SDL to trigger PTU
--
-- Steps:
-- 1. HMI sends VR.OnLanguageChange after sending of BC.OnSystemRequest during PTU processing
-- SDL does:
-- - send OnLanguageChange notification to App
-- - send OnAppInterfaceUnregistered(reason = "LANGUAGE_CHANGE") notification to App
-- - send BasicCommunication.OnAppUnregistered(unexpectedDisconnect = false) to HMI
---------------------------------------------------------------------------------------------------

--[[ Required Shared libraries ]]
local common = require('test_scripts/Defects/7_0/3175/common_3175')

--[[ Local Functions ]]
local function performPTUWithVrOnLanguageChange()
local hmi = common.getHmiConnection()
local requestId = hmi:SendRequest("SDL.GetPolicyConfigurationData",
{ policyType = "module_config", property = "endpoints" })
hmi:ExpectResponse(requestId)
:Do(function()
hmi:SendNotification("BasicCommunication.OnSystemRequest",
{ requestType = "PROPRIETARY", fileName = common.getPTSFilePath() })
common.checkVrOnLanguageChangeProcessing()
end)
end

--[[ Scenario ]]
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
common.Step("Register App", common.registerApp)

common.Title("Test")
common.Step("VR.OnLanguageChange after sending of BC.OnSystemRequest during PTU processing",
performPTUWithVrOnLanguageChange)

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---------------------------------------------------------------------------------------------------
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3175
--
-- Description: SDL should successfully process VR.ChangeLanguage during PTU
--
-- Pre-conditions:
-- 1. Start SDL, HMI, connect Mobile device
-- 2. Register application which is new for SDL to trigger PTU
--
-- Steps:
-- 1. HMI sends VR.OnLanguageChange after receiving of OnSystemRequest by App during PTU processing
-- SDL does:
-- - send OnLanguageChange notification to App
-- - send OnAppInterfaceUnregistered(reason = "LANGUAGE_CHANGE") notification to App
-- - send BasicCommunication.OnAppUnregistered(unexpectedDisconnect = false) to HMI
---------------------------------------------------------------------------------------------------

--[[ Required Shared libraries ]]
local common = require('test_scripts/Defects/7_0/3175/common_3175')

--[[ Local Functions ]]
local function performPTUWithVrOnLanguageChange()
local hmi = common.getHmiConnection()
local requestId = hmi:SendRequest("SDL.GetPolicyConfigurationData",
{ policyType = "module_config", property = "endpoints" })
hmi:ExpectResponse(requestId)
:Do(function()
hmi:SendNotification("BasicCommunication.OnSystemRequest",
{ requestType = "PROPRIETARY", fileName = common.getPTSFilePath() })
common.getMobileSession():ExpectNotification("OnSystemRequest", { requestType = "PROPRIETARY" })
:Do(function()
common.checkVrOnLanguageChangeProcessing()
end)
end)
end

--[[ Scenario ]]
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
common.Step("Register App", common.registerApp)

common.Title("Test")
common.Step("VR.OnLanguageChange after receiving of OnSystemRequest by App during PTU processing",
performPTUWithVrOnLanguageChange)

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---------------------------------------------------------------------------------------------------
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3175
--
-- Description: SDL should successfully process VR.ChangeLanguage during PTU
--
-- Pre-conditions:
-- 1. Start SDL, HMI, connect Mobile device
-- 2. Register application which is new for SDL to trigger PTU
--
-- Steps:
-- 1. HMI sends VR.OnLanguageChange after receiving of BC.SystemRequest by HMI during PTU processing
-- SDL does:
-- - send OnLanguageChange notification to App
-- - send OnAppInterfaceUnregistered(reason = "LANGUAGE_CHANGE") notification to App
-- - send BasicCommunication.OnAppUnregistered(unexpectedDisconnect = false) to HMI
---------------------------------------------------------------------------------------------------

--[[ Required Shared libraries ]]
local common = require('test_scripts/Defects/7_0/3175/common_3175')

--[[ Local Functions ]]
local function performPTUWithVrOnLanguageChange()
local hmi = common.getHmiConnection()
local mobile = common.getMobileSession()
local ptuFileName = os.tmpname()
local requestId = hmi:SendRequest("SDL.GetPolicyConfigurationData",
{ policyType = "module_config", property = "endpoints" })
hmi:ExpectResponse(requestId)
:Do(function()
local ptuTable = common.getPTUFromPTS()
ptuTable.policy_table.app_policies[common.getPolicyAppId()] = common.getAppDataForPTU()
common.tableToJsonFile(ptuTable, ptuFileName)
hmi:SendNotification("BasicCommunication.OnSystemRequest",
{ requestType = "PROPRIETARY", fileName = common.getPTSFilePath() })
mobile:ExpectNotification("OnSystemRequest", { requestType = "PROPRIETARY" })
:Do(function()
hmi:ExpectRequest("BasicCommunication.SystemRequest")
:Do(function()
common.checkVrOnLanguageChangeProcessing()
end)
mobile:SendRPC("SystemRequest", { requestType = "PROPRIETARY" }, ptuFileName)
os.remove(ptuFileName)
end)
end)
end

--[[ Scenario ]]
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
common.Step("Register App", common.registerApp)

common.Title("Test")
common.Step("VR.OnLanguageChange after receiving of BC.SystemRequest by HMI during PTU processing",
performPTUWithVrOnLanguageChange)

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---------------------------------------------------------------------------------------------------
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3175
--
-- Description: SDL should successfully process VR.ChangeLanguage during PTU
--
-- Pre-conditions:
-- 1. Start SDL, HMI, connect Mobile device
-- 2. Register application which is new for SDL to trigger PTU
--
-- Steps:
-- 1. HMI sends VR.OnLanguageChange after responding to BC.SystemRequest by HMI during PTU processing
-- SDL does:
-- - send OnLanguageChange notification to App
-- - send OnAppInterfaceUnregistered(reason = "LANGUAGE_CHANGE") notification to App
-- - send BasicCommunication.OnAppUnregistered(unexpectedDisconnect = false) to HMI
---------------------------------------------------------------------------------------------------

--[[ Required Shared libraries ]]
local common = require('test_scripts/Defects/7_0/3175/common_3175')

--[[ Local Functions ]]
local function performPTUWithVrOnLanguageChange()
local hmi = common.getHmiConnection()
local mobile = common.getMobileSession()
local ptuFileName = os.tmpname()
local requestId = hmi:SendRequest("SDL.GetPolicyConfigurationData",
{ policyType = "module_config", property = "endpoints" })
hmi:ExpectResponse(requestId)
:Do(function()
local ptuTable = common.getPTUFromPTS()
ptuTable.policy_table.app_policies[common.getPolicyAppId()] = common.getAppDataForPTU()
common.tableToJsonFile(ptuTable, ptuFileName)
hmi:SendNotification("BasicCommunication.OnSystemRequest",
{ requestType = "PROPRIETARY", fileName = common.getPTSFilePath() })
mobile:ExpectNotification("OnSystemRequest", { requestType = "PROPRIETARY" })
:Do(function()
hmi:ExpectRequest("BasicCommunication.SystemRequest")
:Do(function(_, d3)
hmi:SendResponse(d3.id, "BasicCommunication.SystemRequest", "SUCCESS", { })
common.checkVrOnLanguageChangeProcessing()
end)
mobile:SendRPC("SystemRequest", { requestType = "PROPRIETARY" }, ptuFileName)
os.remove(ptuFileName)
end)
end)
end

--[[ Scenario ]]
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
common.Step("Register App", common.registerApp)

common.Title("Test")
common.Step("VR.OnLanguageChange after responding to BC.SystemRequest by HMI during PTU processing",
performPTUWithVrOnLanguageChange)

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---------------------------------------------------------------------------------------------------
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3175
--
-- Description: SDL should successfully process VR.ChangeLanguage during PTU
--
-- Pre-conditions:
-- 1. Start SDL, HMI, connect Mobile device
-- 2. Register application which is new for SDL to trigger PTU
--
-- Steps:
-- 1. HMI sends VR.OnLanguageChange after sending of SDL.OnReceivedPolicyUpdate by HMI during PTU processing
-- SDL does:
-- - send OnLanguageChange notification to App
-- - send OnAppInterfaceUnregistered(reason = "LANGUAGE_CHANGE") notification to App
-- - send BasicCommunication.OnAppUnregistered(unexpectedDisconnect = false) to HMI
---------------------------------------------------------------------------------------------------

--[[ Required Shared libraries ]]
local common = require('test_scripts/Defects/7_0/3175/common_3175')

--[[ Local Functions ]]
local function performPTUWithVrOnLanguageChange()
local hmi = common.getHmiConnection()
local mobile = common.getMobileSession()
local ptuFileName = os.tmpname()
local requestId = hmi:SendRequest("SDL.GetPolicyConfigurationData",
{ policyType = "module_config", property = "endpoints" })
hmi:ExpectResponse(requestId)
:Do(function()
local ptuTable = common.getPTUFromPTS()
ptuTable.policy_table.app_policies[common.getPolicyAppId()] = common.getAppDataForPTU()
common.tableToJsonFile(ptuTable, ptuFileName)
hmi:SendNotification("BasicCommunication.OnSystemRequest",
{ requestType = "PROPRIETARY", fileName = common.getPTSFilePath() })
mobile:ExpectNotification("OnSystemRequest", { requestType = "PROPRIETARY" })
:Do(function()
hmi:ExpectRequest("BasicCommunication.SystemRequest")
:Do(function(_, d3)
hmi:SendResponse(d3.id, "BasicCommunication.SystemRequest", "SUCCESS", { })
hmi:SendNotification("SDL.OnReceivedPolicyUpdate", { policyfile = d3.params.fileName })
common.checkVrOnLanguageChangeProcessing()
end)
mobile:SendRPC("SystemRequest", { requestType = "PROPRIETARY" }, ptuFileName)
os.remove(ptuFileName)
end)
end)
end

--[[ Scenario ]]
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
common.Step("Register App", common.registerApp)

common.Title("Test")
common.Step("VR.OnLanguageChange after sending of SDL.OnReceivedPolicyUpdate by HMI during PTU processing",
performPTUWithVrOnLanguageChange)

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Loading