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

[SDL 0293] Scripts for Enable OEM exclusive apps support feature #100

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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,30 @@
---------------------------------------------------------------------------------------------------
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0293-vehicle-type-filter.md
---------------------------------------------------------------------------------------------------
-- Description: Check that SDL is able to provide all vehicle type data in StartServiceAck right after receiving
-- BC.GetSystemInfo and VI.GetVehicleType responses with all parameters
--
-- Steps:
-- 1. HMI provides all vehicle type data in BC.GetSystemInfo(ccpu_version, systemHardwareVersion)
-- and VI.GetVehicleType(make, model, modelYear, trim) responses
-- 2. App requests StartService(RPC) via 5th protocol
-- SDL does:
-- - Provide the vehicle type info with all parameter values received from HMI in StartServiceAck to the app
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require("test_scripts/Protocol/commonProtocol")

--[[ Local Variables ]]
local hmiCap = common.setHMIcap(common.vehicleTypeInfoParams.default)
local rpcServiceAckParams = common.getRpcServiceAckParams(hmiCap)

--[[ Scenario ]]
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start, { hmiCap })

common.Title("Test")
common.Step("Start RPC Service, Vehicle type data in StartServiceAck", common.startRpcService, { rpcServiceAckParams })

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---------------------------------------------------------------------------------------------------
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0293-vehicle-type-filter.md
---------------------------------------------------------------------------------------------------
-- Description: Check that SDL is able to provide some part of the vehicle type data in StartServiceAck right after
-- receiving both GetVehicleType and GetSystemInfo responses
--
-- Steps:
-- 1. HMI provides some part of vehicle type data in BC.GetSystemInfo and VI.GetVehicleType responses:
-- - BC.GetSystemInfo(ccpu_version) and VI.GetVehicleType(make, model, modelYear, trim)
-- - BC.GetSystemInfo(ccpu_version, systemHardwareVersion) and VI.GetVehicleType(make, model, modelYear)
-- - BC.GetSystemInfo(ccpu_version, systemHardwareVersion) and VI.GetVehicleType(make, model, trim)
-- - BC.GetSystemInfo(ccpu_version, systemHardwareVersion) and VI.GetVehicleType(make, modelYear, trim)
-- - BC.GetSystemInfo(ccpu_version, systemHardwareVersion) and VI.GetVehicleType(model, modelYear, trim)
-- 2. App requests StartService(RPC) via 5th protocol
-- SDL does:
-- - Provide the vehicle type info with parameter values received from HMI in StartServiceAck to the app
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require("test_scripts/Protocol/commonProtocol")

--[[ Local Variables ]]
local tcs = {
[01] = "make",
[02] = "model",
[03] = "modelYear",
[04] = "trim",
[05] = "systemHardwareVersion"
}

--[[ Local Functions ]]
local function setHMICap(pParamToExclude)
local defaultVehicleTypeInfoParam = common.cloneTable(common.vehicleTypeInfoParams.default)
defaultVehicleTypeInfoParam[pParamToExclude] = nil
local out = common.setHMIcap(defaultVehicleTypeInfoParam)
return out
end

local function startRpcService(pAckParams, pNotExpected)
common.startRpcService(pAckParams)
:ValidIf(function(_, data)
local errorMessages = ""
local actPayload = common.bson_to_table(data.binaryData)
for Key, _ in pairs(actPayload) do
if Key == pNotExpected then
errorMessages = errorMessages .. "BinaryData contains unexpected " .. pNotExpected .. " parameter\n"
end
end
if string.len(errorMessages) > 0 then
return false, errorMessages
else
return true
end
end)
end

--[[ Scenario ]]
for tc, data in common.spairs(tcs) do
common.Title("TC[" .. string.format("%03d", tc) .. "]")
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
local hmiCap = setHMICap(data)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start, { hmiCap })

common.Title("Test")
common.Step("Vehicle type data without " .. data .. " in StartServiceAck", startRpcService,
{ common.getRpcServiceAckParams(hmiCap), data })

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---------------------------------------------------------------------------------------------------
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0293-vehicle-type-filter.md
---------------------------------------------------------------------------------------------------
-- Description: Check that SDL is able to provide some part of the vehicle type data in StartServiceAck right after
-- receiving both GetVehicleType and GetSystemInfo responses only with mandatory parameters
--
-- Steps:
-- 1. HMI provides only mandatory parameters of vehicle type data in BC.GetSystemInfo and VI.GetVehicleType responses:
-- - BC.GetSystemInfo(ccpu_version) and VI.GetVehicleType(without parameters)
-- 2. App requests StartService(RPC) via 5th protocol
-- SDL does:
-- - Provide the vehicle type info with parameter values received from HMI in StartServiceAck to the app
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require("test_scripts/Protocol/commonProtocol")

--[[ Local Variables ]]
local vehicleTypeData = {
ccpu_version = common.vehicleTypeInfoParams.default["ccpu_version"]
}

--[[ Local Functions ]]
local function startRpcService(pAckParams)
local excludedParams = { "make","model", "modelYear", "trim", "systemHardwareVersion" }
common.startRpcService(pAckParams)
:ValidIf(function(_, data)
local errorMessages = ""
local actPayload = common.bson_to_table(data.binaryData)
for _, param in pairs(excludedParams) do
for Key, _ in pairs(actPayload) do
if Key == param then
errorMessages = errorMessages .. "BinaryData contains unexpected " .. param .. " parameter\n"
end
end
end
if string.len(errorMessages) > 0 then
return false, errorMessages
end
return true
end)
end

--[[ Scenario ]]
common.Title("Test with excluding all not mandatory parameters")
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
local hmiCap = common.setHMIcap(vehicleTypeData)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start, { hmiCap })

common.Title("Test")
common.Step("Vehicle type data without all not mandatory params in StartServiceAck", startRpcService,
{ common.getRpcServiceAckParams(hmiCap) })

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---------------------------------------------------------------------------------------------------
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0293-vehicle-type-filter.md
---------------------------------------------------------------------------------------------------
-- Description: SDL is able to stop RPC service successfully in case the mobile app does not support
-- the vehicle type data received from SDL and requests EndService after StartServiceAck
--
-- Steps:
-- 1. HMI provides all vehicle type data in BC.GetSystemInfo(ccpu_version, systemHardwareVersion)
-- and VI.GetVehicleType(make, model, modelYear, trim) responses
-- 2. App requests StartService(RPC) via 5th protocol
-- SDL does:
-- - Provide the vehicle type info with all parameter values received from HMI in StartServiceAck to the app
-- 3. App does not support the data from received vehicle type info and requests EndService
-- SDL does:
-- - End RPC service successfully and sends EndServiceAck to the app
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require("test_scripts/Protocol/commonProtocol")

--[[ Local Variables ]]
local hmiCap = common.setHMIcap(common.vehicleTypeInfoParams.default)
local rpcServiceAckParams = common.getRpcServiceAckParams(hmiCap)

--[[ Scenario ]]
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start, { hmiCap })

common.Title("Test")
common.Step("Start RPC Service, Vehicle type data in StartServiceAck", common.startRpcService, { rpcServiceAckParams })
common.Step("EndService", common.endRPCService)

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---------------------------------------------------------------------------------------------------
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0293-vehicle-type-filter.md
---------------------------------------------------------------------------------------------------
-- Description: Check that SDL is able to provide all vehicle type data RAI response after receiving
-- BC.GetSystemInfo and VI.GetVehicleType responses with all parameters
--
-- Steps:
-- 1. HMI provides all vehicle type data in BC.GetSystemInfo(ccpu_version, systemHardwareVersion)
-- and VI.GetVehicleType(make, model, modelYear, trim) responses
-- 2. App requests StartService(RPC) via 5th protocol
-- SDL does:
-- - Provide the vehicle type info with all parameter values received from HMI in StartServiceAck to the app
-- 3. App sends RAI request via 5th protocol
-- SDL does:
-- - Provide the vehicle type info with all parameter values received from HMI in RAI response to the app
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require("test_scripts/Protocol/commonProtocol")

--[[ Local Variables ]]
local hmiCap = common.setHMIcap(common.vehicleTypeInfoParams.default)
local rpcServiceAckParams = common.getRpcServiceAckParams(hmiCap)

--[[ Scenario ]]
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start, { hmiCap })

common.Title("Test")
common.Step("Start RPC Service, Vehicle type data in StartServiceAck", common.startRpcService, { rpcServiceAckParams })
common.Step("Vehicle type data in RAI response", common.registerAppEx, { common.vehicleTypeInfoParams.default })

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---------------------------------------------------------------------------------------------------
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0293-vehicle-type-filter.md
---------------------------------------------------------------------------------------------------
-- Description: Check that SDL is able to provide some part of the vehicle type data in RAI response after
-- receiving both GetVehicleType and GetSystemInfo responses
--
-- Steps:
-- 1. HMI provides some part of vehicle type data in BC.GetSystemInfo and VI.GetVehicleType responses:
-- - BC.GetSystemInfo(ccpu_version) and VI.GetVehicleType(make, model, modelYear, trim)
-- - BC.GetSystemInfo(ccpu_version, systemHardwareVersion) and VI.GetVehicleType(make, model, modelYear)
-- - BC.GetSystemInfo(ccpu_version, systemHardwareVersion) and VI.GetVehicleType(make, model, trim)
-- - BC.GetSystemInfo(ccpu_version, systemHardwareVersion) and VI.GetVehicleType(make, modelYear, trim)
-- - BC.GetSystemInfo(ccpu_version, systemHardwareVersion) and VI.GetVehicleType(model, modelYear, trim)
-- 2. App requests StartService(RPC) via 5th protocol
-- SDL does:
-- - Provide the vehicle type info with parameter values received from HMI in StartServiceAck to the app
-- 3. App sends RAI request via 5th protocol
-- SDL does:
-- - Provide the vehicle type info with parameter values received from HMI in RAI response to the app
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require("test_scripts/Protocol/commonProtocol")

--[[ Local Variables ]]
local tcs = {
[01] = "make",
[02] = "model",
[03] = "modelYear",
[04] = "trim",
[05] = "systemHardwareVersion"
}

--[[ Local Functions ]]
local function setHMICap(pParamToExclude)
local defaultVehicleTypeInfoParam = common.cloneTable(common.vehicleTypeInfoParams.default)
defaultVehicleTypeInfoParam[pParamToExclude] = nil
local out = common.setHMIcap(defaultVehicleTypeInfoParam)
return out
end

local function registerApp(pParamToExclude)
local defaultVehicleTypeInfoParam = common.cloneTable(common.vehicleTypeInfoParams.default)
defaultVehicleTypeInfoParam[pParamToExclude] = nil
common.registerAppEx(defaultVehicleTypeInfoParam)
end

--[[ Scenario ]]
for tc, data in common.spairs(tcs) do
common.Title("TC[" .. string.format("%03d", tc) .. "]")
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
local hmiCap = setHMICap(data)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start, { hmiCap })

common.Title("Test")
common.Step("Vehicle type data without " .. data .. " in StartServiceAck", common.startRpcService,
{ common.getRpcServiceAckParams(hmiCap) })
common.Step("Vehicle type data without " .. data .. " in RAI response", registerApp, { data })

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---------------------------------------------------------------------------------------------------
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0293-vehicle-type-filter.md
---------------------------------------------------------------------------------------------------
-- Description: Check that SDL is able to provide some part of the vehicle type data in RAI response after
-- receiving both GetVehicleType and GetSystemInfo responses only with mandatory parameters
--
-- Steps:
-- 1. HMI provides only mandatory parameters of vehicle type data in BC.GetSystemInfo and VI.GetVehicleType responses:
-- - BC.GetSystemInfo(ccpu_version) and VI.GetVehicleType(without parameters)
-- 2. App requests StartService(RPC) via 5th protocol
-- SDL does:
-- - Provide the vehicle type data received from HMI in StartServiceAck to the app
-- 3. App sends RAI request via 5th protocol
-- SDL does:
-- - Provide the vehicle type info with parameter values received from HMI in RAI response to the app
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require("test_scripts/Protocol/commonProtocol")

--[[ Local Variables ]]
local vehicleData = {
ccpu_version = common.vehicleTypeInfoParams.default["ccpu_version"]
}

--[[ Scenario ]]
common.Title("Test with excluding all not mandatory parameters")
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
local hmiCap = common.setHMIcap(vehicleData)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start, { hmiCap })

common.Title("Test")
common.Step("Vehicle type data without all not mandatory params in StartServiceAck", common.startRpcService,
{ common.getRpcServiceAckParams(hmiCap) })
common.Step("Vehicle type data without all not mandatory params in RAI response", common.registerAppEx, { vehicleData })

common.Title("Postconditions")
common.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---------------------------------------------------------------------------------------------------
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0293-vehicle-type-filter.md
---------------------------------------------------------------------------------------------------
-- Description: SDL is able to unregister an app and stop RPC service successfully in case the mobile app
-- does not support the vehicle type data received from SDL in RAI response and requests UnregisterAppInterface
-- and EndService after successful registration
--
-- Steps:
-- 1. HMI provides all vehicle type data in BC.GetSystemInfo(ccpu_version, systemHardwareVersion)
-- and VI.GetVehicleType(make, model, modelYear, trim) responses
-- 2. RPC service is opened by app via 5th protocol
-- 3. App sends RAI request via 5th protocol
-- SDL does:
-- - Provide the vehicle type info with all parameter values received from HMI in RAI response to the app
-- 4. App does not support the data from received vehicle type info and requests UnregisterAppInterface RPC
-- SDL does:
-- - Unregister the app successfully and sends UnregisterAppInterface(SUCCESS) response to the app
-- 5. App requests EndService
-- SDL does:
-- - End RPC service successfully and sends EndServiceAck to the app
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require("test_scripts/Protocol/commonProtocol")

--[[ Local Variables ]]
local hmiCap = common.setHMIcap(common.vehicleTypeInfoParams.default)
local rpcServiceAckParams = common.getRpcServiceAckParams(hmiCap)

--[[ Local Functions ]]
local function unregisterAppInterface()
local cid = common.getMobileSession():SendRPC("UnregisterAppInterface",{})
common.getHMIConnection():ExpectNotification("BasicCommunication.OnAppUnregistered", { unexpectedDisconnect = false })
common.getMobileSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS" })
:Do(function()
common.endRPCService()
end)
end

--[[ Scenario ]]
common.Title("Preconditions")
common.Step("Clean environment", common.preconditions)
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start, { hmiCap })

common.Title("Test")
common.Step("Start RPC Service, Vehicle type data in StartServiceAck", common.startRpcService, { rpcServiceAckParams })
common.Step("Vehicle type data in RAI response", common.registerAppEx, { common.vehicleTypeInfoParams.default })
common.Step("UnregisterAppInterface", unregisterAppInterface)

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