Skip to content

Commit

Permalink
Add test scripts to check defect 3175 (#2450)
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitriy Boltovskiy <dboltovskyi@luxoft.com>
  • Loading branch information
aderiabin and dboltovskyi authored Oct 30, 2020
1 parent dc55b86 commit 01dac98
Show file tree
Hide file tree
Showing 10 changed files with 496 additions and 0 deletions.
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

0 comments on commit 01dac98

Please sign in to comment.