From 24da52eb277c6285dee4d015b4dac54bb07af531 Mon Sep 17 00:00:00 2001 From: IGetmanets Date: Thu, 21 May 2020 18:08:52 +0300 Subject: [PATCH 1/7] Initial scripts for new vehicle data HandsOffSteering --- .../001_GetVD_Success_flow.lua | 38 +++ .../HandsOffSteering/002_GetVD_disallowed.lua | 43 +++ .../003_GetVD_disallowed_after_PTU.lua | 60 ++++ ...4_GetVD_HMI_responds_with_invalid_data.lua | 38 +++ .../005_GetVD_App_sends_invalid_request.lua | 37 +++ .../006_SubscribeVD_Success.lua | 36 +++ .../007_SubscribeVD_disallowed.lua | 44 +++ .../008_SubscribeVD_disallowed_after_PTU.lua | 66 ++++ ...uccess_codes_for_handsOffSteering_data.lua | 61 ++++ ...cribeVD_HMI_responds_with_invalid_data.lua | 44 +++ ..._SubscribeVD_App_sends_invalid_request.lua | 37 +++ .../012_SubscribeVD_for_two_Apps.lua | 55 ++++ .../013_UnsubscribeVD_Success.lua | 40 +++ .../014_UnsubscribeVD_disallowed.lua | 50 ++++ ...015_UnsubscribeVD_disallowed_after_PTU.lua | 70 +++++ ...uccess_codes_for_handsOffSteering_data.lua | 64 ++++ ...cribeVD_HMI_responds_with_invalid_data.lua | 46 +++ ...nsubscribeVD_App_sends_invalid_request.lua | 39 +++ .../019_UnsubscribeVD_for_two_Apps.lua | 61 ++++ .../020_OnVD_notification_Success.lua | 39 +++ .../021_OnVD_notification_disallowed.lua | 52 ++++ .../022_OnVD_disallowed_after_PTU.lua | 62 ++++ ...23_OnVD_notification_with_invalid_data.lua | 37 +++ ...nVD_notification_App_is_not_subscribed.lua | 52 ++++ .../025_OnVD_notification_for_two_Apps.lua | 72 +++++ ...sion_is_greater_than_parameter_version.lua | 63 ++++ ...version_is_less_than_parameter_version.lua | 57 ++++ ...uring_resumption_unexpected_disconnect.lua | 43 +++ ...bscribeVD_during_resumption_IGN_OFF_ON.lua | 44 +++ ...ion_unexpected_disconnect_for_two_Apps.lua | 59 ++++ ...ing_resumption_IGN_OFF_ON_for_two_Apps.lua | 59 ++++ .../VehicleData/HandsOffSteering/common.lua | 283 ++++++++++++++++++ .../new_vehicle_data_hands_off_steering.txt | 31 ++ 33 files changed, 1882 insertions(+) create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/001_GetVD_Success_flow.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/002_GetVD_disallowed.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/003_GetVD_disallowed_after_PTU.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/004_GetVD_HMI_responds_with_invalid_data.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/005_GetVD_App_sends_invalid_request.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/006_SubscribeVD_Success.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/007_SubscribeVD_disallowed.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/008_SubscribeVD_disallowed_after_PTU.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/009_SubscribeVD_not_success_codes_for_handsOffSteering_data.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/010_SubscribeVD_HMI_responds_with_invalid_data.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/011_SubscribeVD_App_sends_invalid_request.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/012_SubscribeVD_for_two_Apps.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/013_UnsubscribeVD_Success.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/014_UnsubscribeVD_disallowed.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/015_UnsubscribeVD_disallowed_after_PTU.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/016_UnsubscribeVD_not_success_codes_for_handsOffSteering_data.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/017_UnsubscribeVD_HMI_responds_with_invalid_data.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/018_UnsubscribeVD_App_sends_invalid_request.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/019_UnsubscribeVD_for_two_Apps.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/020_OnVD_notification_Success.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/021_OnVD_notification_disallowed.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/022_OnVD_disallowed_after_PTU.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/023_OnVD_notification_with_invalid_data.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/024_OnVD_notification_App_is_not_subscribed.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/025_OnVD_notification_for_two_Apps.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/028_SubscribeVD_during_resumption_unexpected_disconnect.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/common.lua create mode 100644 test_sets/new_vehicle_data_hands_off_steering.txt diff --git a/test_scripts/API/VehicleData/HandsOffSteering/001_GetVD_Success_flow.lua b/test_scripts/API/VehicleData/HandsOffSteering/001_GetVD_Success_flow.lua new file mode 100644 index 0000000000..e5907d988d --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/001_GetVD_Success_flow.lua @@ -0,0 +1,38 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL processes GetVehicleData RPC with 'handsOffSteering' parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC GetVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends VehicleInfo.GetVehicleData response with handsOffSteering data to SDL +-- SDL does: +-- - a) send GetVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variable ]] +local handsOffSteeringValues = { true, false } + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for _, value in pairs(handsOffSteeringValues) do + common.Step("RPC GetVehicleData with handsOffSteering " .. tostring(value), common.getVehicleData, { value }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/002_GetVD_disallowed.lua b/test_scripts/API/VehicleData/HandsOffSteering/002_GetVD_disallowed.lua new file mode 100644 index 0000000000..e28ea2d34a --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/002_GetVD_disallowed.lua @@ -0,0 +1,43 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL rejects GetVehicleData request with resultCode "DISALLOWED" if 'handsOffSteering' +-- parameter is not allowed by policy +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) 'handsOffSteering' parameter is Not allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send GetVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +-- [[ Local Variables ]] +local rpc = "GetVehicleData" +local result = "DISALLOWED" +local VDGroup = { + rpcs = { + GetVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "gps" } + } + } +} + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions, { VDGroup }) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +common.Step("RPC GetVehicleData DISALLOWED", common.processRPCFailure, { rpc, result }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/003_GetVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/HandsOffSteering/003_GetVD_disallowed_after_PTU.lua new file mode 100644 index 0000000000..b84bf9a9f5 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/003_GetVD_disallowed_after_PTU.lua @@ -0,0 +1,60 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL rejects GetVehicleData request with resultCode "DISALLOWED" if 'handsOffSteering' +-- parameter is not allowed by policy after PTU +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC GetVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends VehicleInfo.GetVehicleData response with handsOffSteering data to SDL +-- SDL does: +-- - a) send GetVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App +-- 3) PTU is performed with disabling permissions for handsOffSteering parameter +-- 4) App sends valid GetVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send GetVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc = "GetVehicleData" +local result = "DISALLOWED" + +-- [[ Local Function ]] +local function ptUpdate(pt) + local pGroups = { + rpcs = { + GetVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "gps" } + } + } + } + pt.policy_table.functional_groupings["NewTestCaseGroup"] = pGroups + pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } +end + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("RPC GetVehicleData, SUCCESS", common.getVehicleData) + +common.Title("Test") +common.Step("Policy Table Update with disabling permissions for handsOffSteering", + common.policyTableUpdate, { ptUpdate }) +common.Step("RPC GetVehicleData, DISALLOWED after PTU", common.processRPCFailure, { rpc, result }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/004_GetVD_HMI_responds_with_invalid_data.lua b/test_scripts/API/VehicleData/HandsOffSteering/004_GetVD_HMI_responds_with_invalid_data.lua new file mode 100644 index 0000000000..540c150814 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/004_GetVD_HMI_responds_with_invalid_data.lua @@ -0,0 +1,38 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL responds with resultCode "GENERIC_ERROR" to GetVehicleData request if HMI response is +-- invalid +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC GetVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends GetVehicleData response with invalid type of handsOffSteering parameter +-- SDL does: +-- - a) send GetVehicleData response with (success = false, resultCode = "GENERIC_ERROR") to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variable ]] +local rpc = "GetVehicleData" +local handsOffSteeringValue = 123 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +common.Step("RPC GetVehicleData, HMI sends invalid response", common.processRPCgenericError, + { rpc, handsOffSteeringValue }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/005_GetVD_App_sends_invalid_request.lua b/test_scripts/API/VehicleData/HandsOffSteering/005_GetVD_App_sends_invalid_request.lua new file mode 100644 index 0000000000..4cf069d6d7 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/005_GetVD_App_sends_invalid_request.lua @@ -0,0 +1,37 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL responds with resultCode "INVALID_DATA" to GetVehicleData request if App sends request +-- with invalid data +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC GetVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends invalid GetVehicleData(handsOffSteering=123) request to SDL +-- SDL does: +-- - a) send GetVehicleData response with (success = false, resultCode = "INVALID_DATA") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc = "GetVehicleData" +local result = "INVALID_DATA" +local handsOffSteeringValue = 123 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +common.Step("RPC GetVehicleData, invalid request", + common.processRPCFailure, { rpc, result, handsOffSteeringValue }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/006_SubscribeVD_Success.lua b/test_scripts/API/VehicleData/HandsOffSteering/006_SubscribeVD_Success.lua new file mode 100644 index 0000000000..aa8cc5bb00 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/006_SubscribeVD_Success.lua @@ -0,0 +1,36 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL processes SubscribeVehicleData RPC with 'handsOffSteering' parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends VehicleInfo.SubscribeVehicleData response with handsOffSteering data to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variable ]] +local rpc = "SubscribeVehicleData" + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +common.Step("RPC " .. rpc .. " with handsOffSteering parameter", common.processSubscriptionRPC, { rpc }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/007_SubscribeVD_disallowed.lua b/test_scripts/API/VehicleData/HandsOffSteering/007_SubscribeVD_disallowed.lua new file mode 100644 index 0000000000..6b9aadd62a --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/007_SubscribeVD_disallowed.lua @@ -0,0 +1,44 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL rejects SubscribeVehicleData request with resultCode "DISALLOWED" if 'handsOffSteering' +-- parameter is not allowed by policy +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) 'handsOffSteering' parameter is Not allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc = "SubscribeVehicleData" +local result = "DISALLOWED" +local VDGroup = { + rpcs = { + SubscribeVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "gps" } + } + } +} + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions, { VDGroup }) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +common.Step("RPC " .. rpc .. " with handsOffSteering parameter DISALLOWED", + common.processRPCFailure, { rpc, result }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/008_SubscribeVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/HandsOffSteering/008_SubscribeVD_disallowed_after_PTU.lua new file mode 100644 index 0000000000..765dd98c4d --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/008_SubscribeVD_disallowed_after_PTU.lua @@ -0,0 +1,66 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL rejects SubscribeVehicleData request with resultCode "DISALLOWED" if 'handsOffSteering' +-- parameter is not allowed by policy after PTU +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends VehicleInfo.SubscribeVehicleData response with handsOffSteering data to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = true, resultCode = SUCCESS", +-- handsOffSteering = ) to App +-- 3) PTU is performed with disabling permissions for handsOffSteering parameter +-- 4) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc = "SubscribeVehicleData" +local result = "DISALLOWED" + +--[[ Local Function ]] +local function ptUpdate(pt) + local pGroups = { + rpcs = { + SubscribeVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "gps" } + }, + OnVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "handsOffSteering" } + } + } + } + pt.policy_table.functional_groupings["NewTestCaseGroup"] = pGroups + pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } +end + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("RPC " .. rpc .. " with handsOffSteering parameter", + common.processSubscriptionRPC, { rpc }) + +common.Title("Test") +common.Step("Policy Table Update with disabling permissions for handsOffSteering", + common.policyTableUpdate, { ptUpdate }) +common.Step("RPC " .. rpc .. " with handsOffSteering parameter DISALLOWED after PTU", + common.processRPCFailure, { rpc, result }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/009_SubscribeVD_not_success_codes_for_handsOffSteering_data.lua b/test_scripts/API/VehicleData/HandsOffSteering/009_SubscribeVD_not_success_codes_for_handsOffSteering_data.lua new file mode 100644 index 0000000000..35ec043743 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/009_SubscribeVD_not_success_codes_for_handsOffSteering_data.lua @@ -0,0 +1,61 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Processing of SubscribeVehicleData RPC with unsuccessful resultCode for handsOffSteering data +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI. +-- 2) HMI responds with "SUCCESS" result to SubscribeVehicleData request +-- and with not success result for handsOffSteering vehicle data +-- SDL does: +-- - a) respond "SUCCESS", success:true and with unsuccessful resultCode for handsOffSteering data to the mobile app +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local resultCodes = { + "TRUNCATED_DATA", + "DISALLOWED", + "USER_DISALLOWED", + "INVALID_ID", + "VEHICLE_DATA_NOT_AVAILABLE", + "DATA_NOT_SUBSCRIBED", + "IGNORED", + "DATA_ALREADY_SUBSCRIBED" +} + +--[[ Local Variables ]] +local function subscribeToVDwithUnsuccessCodeForVD(pCode) + local handsOffSteeringData = { dataType = "VEHICLEDATA_HANDSOFFSTEERING", resultCode = pCode} + local cid = common.getMobileSession():SendRPC("SubscribeVehicleData", { handsOffSteering = true }) + common.getHMIConnection():ExpectRequest("VehicleInfo.SubscribeVehicleData", { handsOffSteering = true }) + :Do(function(_,data) + common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", + { handsOffSteering = handsOffSteeringData }) + end) + common.getMobileSession():ExpectResponse(cid, + { success = true, resultCode = "SUCCESS", handsOffSteering = handsOffSteeringData }) +end + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for _, code in common.spairs(resultCodes) do + common.Step("SubscribeVehicleData with handsOffSteering resultCode =" .. code, + subscribeToVDwithUnsuccessCodeForVD, { code }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/010_SubscribeVD_HMI_responds_with_invalid_data.lua b/test_scripts/API/VehicleData/HandsOffSteering/010_SubscribeVD_HMI_responds_with_invalid_data.lua new file mode 100644 index 0000000000..ebda48910c --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/010_SubscribeVD_HMI_responds_with_invalid_data.lua @@ -0,0 +1,44 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL responds with resultCode "GENERIC_ERROR" to SubscribeVehicleData request +-- if HMI response is invalid +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends invalid response +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = false, resultCode = "GENERIC_ERROR") to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variable ]] +local rpc = "SubscribeVehicleData" +local invalidData = { + invalidType = 123, + wrongDataType = "VEHICLEDATA_GPS", + invalidDataType = 123 +} + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for caseName, value in common.spairs(invalidData) do + common.Step("RPC SubscribeVehicleData, invalid HMI response " .. caseName, + common.processRPCgenericError, { rpc, value }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/011_SubscribeVD_App_sends_invalid_request.lua b/test_scripts/API/VehicleData/HandsOffSteering/011_SubscribeVD_App_sends_invalid_request.lua new file mode 100644 index 0000000000..a2eb52de3b --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/011_SubscribeVD_App_sends_invalid_request.lua @@ -0,0 +1,37 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL responds with resultCode "INVALID_DATA" to SubscribeVehicleData request if App sends +-- request with invalid data +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends invalid SubscribeVehicleData(handsOffSteering=123) request to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = false, resultCode = "INVALID_DATA") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc = "SubscribeVehicleData" +local result = "INVALID_DATA" +local invalidData = 123 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +common.Step("RPC SubscribeVehicleData, App sends invalid request", + common.processRPCFailure, { rpc, result, invalidData }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/012_SubscribeVD_for_two_Apps.lua b/test_scripts/API/VehicleData/HandsOffSteering/012_SubscribeVD_for_two_Apps.lua new file mode 100644 index 0000000000..7d82e0f17b --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/012_SubscribeVD_for_two_Apps.lua @@ -0,0 +1,55 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL processes SubscribeVehicleData RPC for two Apps with 'handsOffSteering' parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App_1 and App_2 are registered +-- +-- In case: +-- 1) App_1 sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends successful VehicleInfo.SubscribeVehicleData response with handsOffSteering data to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App_1 +-- 3) App_2 sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App_2 +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variable ]] +local rpc = "SubscribeVehicleData" +local appId_1 = 1 +local appId_2 = 2 +local isExpectedSubscribeVDonHMI = true +local isNotExpectedSubscribeVDonHMI = false +local notExpected = 0 +local expected = 1 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App_1", common.registerApp, { appId_1 }) +common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) +common.Step("Absence of OnVehicleData notification for both apps", + common.onVehicleDataTwoApps, { notExpected }) + +common.Title("Test") +common.Step("RPC " .. rpc .. " on handsOffSteering parameter for App_1", + common.processSubscriptionRPC, { rpc, appId_1, isExpectedSubscribeVDonHMI }) +common.Step("RPC " .. rpc .. " on handsOffSteering parameter for App_2", + common.processSubscriptionRPC, { rpc, appId_2, isNotExpectedSubscribeVDonHMI }) +common.Step("OnVehicleData notification for both apps", + common.onVehicleDataTwoApps, { expected }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/013_UnsubscribeVD_Success.lua b/test_scripts/API/VehicleData/HandsOffSteering/013_UnsubscribeVD_Success.lua new file mode 100644 index 0000000000..e8e533bd62 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/013_UnsubscribeVD_Success.lua @@ -0,0 +1,40 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL processes UnsubscribeVehicleData RPC with 'handsOffSteering' parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPCs SubscribeVehicleData, UnsubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- 4) App is subscribed to handsOffSteering parameter +-- +-- In case: +-- 1) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends VehicleInfo.UnsubscribeVehicleData response with handsOffSteering structure to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc_sub = "SubscribeVehicleData" +local rpc_unsub = "UnsubscribeVehicleData" + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) + +common.Title("Test") +common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter", + common.processSubscriptionRPC, { rpc_unsub }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/014_UnsubscribeVD_disallowed.lua b/test_scripts/API/VehicleData/HandsOffSteering/014_UnsubscribeVD_disallowed.lua new file mode 100644 index 0000000000..a1fa028797 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/014_UnsubscribeVD_disallowed.lua @@ -0,0 +1,50 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL rejects UnsubscribeVehicleData request with resultCode "DISALLOWED" if +-- `handsOffSteering` parameter is not allowed by policy +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) `handsOffSteering` parameter is not allowed by policies for UnsubscribeVehicleData RPC +-- 3) App is registered and subscribed to handsOffSteering data +-- +-- In case: +-- 1) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc_sub = "SubscribeVehicleData" +local rpc_unsub = "UnsubscribeVehicleData" +local result = "DISALLOWED" +local VDGroup = { + rpcs = { + SubscribeVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = {"handsOffSteering"} + }, + UnsubscribeVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "gps" } + } + } +} + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions, { VDGroup }) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) + +common.Title("Test") +common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter DISALLOWED", + common.processRPCFailure, { rpc_unsub, result }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/015_UnsubscribeVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/HandsOffSteering/015_UnsubscribeVD_disallowed_after_PTU.lua new file mode 100644 index 0000000000..c637a751d3 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/015_UnsubscribeVD_disallowed_after_PTU.lua @@ -0,0 +1,70 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL rejects UnsubscribeVehicleData request with resultCode "DISALLOWED" if 'handsOffSteering' +-- parameter is not allowed by policy after PTU +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPCs SubscribeVehicleData, UnsubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered and subscribed to handsOffSteering data +-- +-- In case: +-- 1) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends VehicleInfo.UnsubscribeVehicleData response with handsOffSteering data to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App +-- 3) App is subscribed to handsOffSteering data again +-- 4) PTU is performed with disabling permissions for handsOffSteering parameter +-- 5) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc_sub = "SubscribeVehicleData" +local rpc_unsub = "UnsubscribeVehicleData" +local result = "DISALLOWED" + +--[[ Local Function ]] +local function ptUpdate(pt) + local pGroups = { + rpcs = { + UnsubscribeVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "gps" } + }, + OnVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "handsOffSteering" } + } + } + } + pt.policy_table.functional_groupings["NewTestCaseGroup"] = pGroups + pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } +end + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) +common.Step("Check allow " .. rpc_unsub .. " RPC", common.processSubscriptionRPC, { rpc_unsub }) +common.Step("App subscribes to handsOffSteering data again", common.processSubscriptionRPC, { rpc_sub }) + +common.Title("Test") +common.Step("Policy Table Update with disabling permissions for handsOffSteering", + common.policyTableUpdate, { ptUpdate }) +common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter DISALLOWED after PTU", + common.processRPCFailure, { rpc_unsub, result }) +common.Step("Check that App is still subscribed", common.sendOnVehicleData) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/016_UnsubscribeVD_not_success_codes_for_handsOffSteering_data.lua b/test_scripts/API/VehicleData/HandsOffSteering/016_UnsubscribeVD_not_success_codes_for_handsOffSteering_data.lua new file mode 100644 index 0000000000..74e10476cc --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/016_UnsubscribeVD_not_success_codes_for_handsOffSteering_data.lua @@ -0,0 +1,64 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Processing of UnsubscribeVehicleData RPC with unsuccessful resultCode for handsOffSteering data +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPCs SubscribeVehicleData, UnsubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- 4) App is subscribed to handsOffSteering data +-- +-- In case: +-- 1) App sends UnsubscribeVehicleData(handsOffSteering=true) request to the SDL +-- SDL does: +-- a) transfer this request to HMI. +-- 2) HMI responds with "SUCCESS" result to UnsubscribeVehicleData request +-- and with not success result for handsOffSteering vehicle data +-- SDL does: +-- a) respond "SUCCESS", success:true and with unsuccessful resultCode for handsOffSteering data to the mobile app +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc = "SubscribeVehicleData" +local resultCodes = { + "TRUNCATED_DATA", + "DISALLOWED", + "USER_DISALLOWED", + "INVALID_ID", + "VEHICLE_DATA_NOT_AVAILABLE", + "DATA_NOT_SUBSCRIBED", + "IGNORED", + "DATA_ALREADY_SUBSCRIBED" +} + +--[[ Local Functions ]] +local function UnsubscribeVDwithUnsuccessCodeForVD(pCode) + local handsOffSteeringData = { dataType = "VEHICLEDATA_HANDSOFFSTEERING", resultCode = pCode} + local cid = common.getMobileSession():SendRPC("UnsubscribeVehicleData", { handsOffSteering = true }) + common.getHMIConnection():ExpectRequest("VehicleInfo.UnsubscribeVehicleData", { handsOffSteering = true }) + :Do(function(_,data) + common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", + { handsOffSteering = handsOffSteeringData }) + end) + common.getMobileSession():ExpectResponse(cid, + { success = true, resultCode = "SUCCESS", handsOffSteering = handsOffSteeringData }) +end + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc }) + +common.Title("Test") +for _, code in common.spairs(resultCodes) do + common.Step("UnsubscribeVehicleData with handsOffSteering resultCode =" .. code, + UnsubscribeVDwithUnsuccessCodeForVD, { code }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/017_UnsubscribeVD_HMI_responds_with_invalid_data.lua b/test_scripts/API/VehicleData/HandsOffSteering/017_UnsubscribeVD_HMI_responds_with_invalid_data.lua new file mode 100644 index 0000000000..31e3b5581d --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/017_UnsubscribeVD_HMI_responds_with_invalid_data.lua @@ -0,0 +1,46 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL responds with resultCode "GENERIC_ERROR" to UnsubscribeVehicleData request if HMI response +-- is invalid +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPCs UnsubscribeVehicleData, SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered and subscribed to handsOffSteering data +-- +-- In case: +-- 1) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI response is invalid +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "GENERIC_ERROR") to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc_sub = "SubscribeVehicleData" +local rpc_unsub = "UnsubscribeVehicleData" +local invalidData = { + invalidType = 123, + wrongDataType = "VEHICLEDATA_GPS", + invalidDataType = 123 +} + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) + +common.Title("Test") +for caseName, value in common.spairs(invalidData) do + common.Step("RPC UnsubscribeVehicleData, invalid HMI response " .. caseName, + common.processRPCgenericError, { rpc_unsub, value }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/018_UnsubscribeVD_App_sends_invalid_request.lua b/test_scripts/API/VehicleData/HandsOffSteering/018_UnsubscribeVD_App_sends_invalid_request.lua new file mode 100644 index 0000000000..7cb7fb6fe8 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/018_UnsubscribeVD_App_sends_invalid_request.lua @@ -0,0 +1,39 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL responds with resultCode "INVALID_DATA" to UnsubscribeVehicleData request if App sends +-- request with invalid data +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPCs UnsubscribeVehicleData, SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered and subscribed to handsOffSteering parameter +-- +-- In case: +-- 1) App sends invalid UnsubscribeVehicleData(handsOffSteering=123) request to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "INVALID_DATA") to App +-- - c) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc_sub = "SubscribeVehicleData" +local rpc_unsub = "UnsubscribeVehicleData" +local result = "INVALID_DATA" +local invalidData = 123 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) + +common.Title("Test") +common.Step("RPC UnsubscribeVehicleData, App sends invalid request", + common.processRPCFailure, { rpc_unsub, result, invalidData }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/019_UnsubscribeVD_for_two_Apps.lua b/test_scripts/API/VehicleData/HandsOffSteering/019_UnsubscribeVD_for_two_Apps.lua new file mode 100644 index 0000000000..137169292b --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/019_UnsubscribeVD_for_two_Apps.lua @@ -0,0 +1,61 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL processes UnsubscribeVehicleData RPC for two Apps with 'handsOffSteering' parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPCs UnsubscribeVehicleData, SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App_1 and App_2 are registered and subscribed to handsOffSteering data +-- +-- In case: +-- 1) App_1 sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App_1 +-- - c) not transfer this request to HMI +-- 2) App_2 sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 3) HMI sends VehicleInfo.UnsubscribeVehicleData response with handsOffSteering data to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App_2 +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc_sub = "SubscribeVehicleData" +local rpc_unsub = "UnsubscribeVehicleData" +local appId_1 = 1 +local appId_2 = 2 +local isExpectedSubscribeVDonHMI = true +local isNotExpectedSubscribeVDonHMI = false +local notExpected = 0 +local expected = 1 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App_1", common.registerApp, { appId_1 }) +common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) +common.Step("App_1 subscribes to handsOffSteering data", + common.processSubscriptionRPC, { rpc_sub, appId_1, isExpectedSubscribeVDonHMI }) +common.Step("App_2 subscribes to handsOffSteering data", + common.processSubscriptionRPC, { rpc_sub, appId_2, isNotExpectedSubscribeVDonHMI }) +common.Step("OnVehicleData notification for both apps", + common.onVehicleDataTwoApps, { expected }) + +common.Title("Test") +common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter for App_1", + common.processSubscriptionRPC, { rpc_unsub, appId_1, isNotExpectedSubscribeVDonHMI }) +common.Step("Absence of OnVehicleData notification for App_1", common.sendOnVehicleData, { notExpected }) +common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter for App_2", + common.processSubscriptionRPC, { rpc_unsub, appId_2, isExpectedSubscribeVDonHMI }) +common.Step("Absence of OnVehicleData notification for both apps", + common.onVehicleDataTwoApps, { notExpected }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/020_OnVD_notification_Success.lua b/test_scripts/API/VehicleData/HandsOffSteering/020_OnVD_notification_Success.lua new file mode 100644 index 0000000000..df218096ce --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/020_OnVD_notification_Success.lua @@ -0,0 +1,39 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL processes OnVehicleData notification with 'handsOffSteering' parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPCs SubscribeVehicleData, OnVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- 4) App is subscribed to handsOffSteering data +-- +-- In case: +-- 1) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL +-- SDL does: +-- - a) transfer this notification to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local handsOffSteeringValues = { true, false } +local rpc = "SubscribeVehicleData" +local expected = 1 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering parameter", common.processSubscriptionRPC, { rpc }) + +common.Title("Test") +for _, value in pairs(handsOffSteeringValues) do + common.Step("HMI sends OnVehicleData notification with handsOffSteering " .. tostring(value), + common.sendOnVehicleData, { expected, value }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/021_OnVD_notification_disallowed.lua b/test_scripts/API/VehicleData/HandsOffSteering/021_OnVD_notification_disallowed.lua new file mode 100644 index 0000000000..20bc03cdc8 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/021_OnVD_notification_disallowed.lua @@ -0,0 +1,52 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL doesn't transfer OnVehicleData notification to App if 'handsOffSteering' parameter is not +-- allowed by policy +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) 'handsOffSteering' is Not allowed by policies for OnVehicleData RPC +-- 3) App is registered +-- 4) App is subscribed to handsOffSteering parameter +-- +-- In case: +-- 1) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL +-- SDL does: +-- - a) ignored this notification and not transfer it to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local handsOffSteeringValues = { true, false } +local rpc = "SubscribeVehicleData" +local notExpected = 0 +local VDGroup = { + rpcs = { + SubscribeVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = {"handsOffSteering"} + }, + OnVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "gps" } + } + } +} + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions, { VDGroup }) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering parameter", common.processSubscriptionRPC, { rpc }) + +common.Title("Test") +for _, value in pairs(handsOffSteeringValues) do + common.Step("HMI sends OnVehicleData notification not allowed by policy, handsOffSteering-" .. tostring(value), + common.sendOnVehicleData, { notExpected, value }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/022_OnVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/HandsOffSteering/022_OnVD_disallowed_after_PTU.lua new file mode 100644 index 0000000000..380f1395a9 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/022_OnVD_disallowed_after_PTU.lua @@ -0,0 +1,62 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL doesn't transfer OnVehicleData notification to App if 'handsOffSteering' parameter is not +-- allowed by policy after PTU +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPCs SubscribeVehicleData, OnVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered and subscribed to handsOffSteering data +-- +-- In case: +-- 1) HMI sends VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL +-- SDL does: +-- - a) transfer this notification to App +-- 3) PTU is performed with disabling permissions for handsOffSteering parameter +-- 1) HMI sends VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL +-- SDL does: +-- - a) ignored this notification and not transfer it to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc = "SubscribeVehicleData" +local notExpected = 0 +local expected = 1 + +--[[ Local Function ]] +local function ptUpdate(pt) + local pGroups = { + rpcs = { + SubscribeVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "gps" } + }, + OnVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "handsOffSteering" } + } + } + } + pt.policy_table.functional_groupings["NewTestCaseGroup"] = pGroups + pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } +end + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering data", + common.processSubscriptionRPC, { rpc }) +common.Step("OnVehicleData notification with handsOffSteering data", common.sendOnVehicleData, { expected }) + +common.Title("Test") +common.Step("Policy Table Update with disabling permissions for handsOffSteering", + common.policyTableUpdate, { ptUpdate }) +common.Step("Absence OnVehicleData notification with handsOffSteering data", common.sendOnVehicleData, { notExpected }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/023_OnVD_notification_with_invalid_data.lua b/test_scripts/API/VehicleData/HandsOffSteering/023_OnVD_notification_with_invalid_data.lua new file mode 100644 index 0000000000..abff9a9736 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/023_OnVD_notification_with_invalid_data.lua @@ -0,0 +1,37 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL doesn't transfer OnVehicleData notification to App if HMI sends notification with +-- invalid data +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPCs OnVehicleData, SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- 4) App is subscribed to handsOffSteering parameter +-- +-- In case: +-- 1) HMI sends VehicleInfo.OnVehicleData notification with invalid data to SDL +-- SDL does: +-- - a) ignored this notification and not transfer to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variable ]] +local rpc_sub = "SubscribeVehicleData" +local invalidData = 123 +local notExpected = 0 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) + +common.Title("Test") +common.Step("HMI sends OnVD notification with invalid data", common.sendOnVehicleData, { notExpected, invalidData }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/024_OnVD_notification_App_is_not_subscribed.lua b/test_scripts/API/VehicleData/HandsOffSteering/024_OnVD_notification_App_is_not_subscribed.lua new file mode 100644 index 0000000000..2482954282 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/024_OnVD_notification_App_is_not_subscribed.lua @@ -0,0 +1,52 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL doesn't transfer OnVehicleData notification with 'handsOffSteering' parameter to App +-- if an app is not subscribed to 'handsOffSteering' data +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPCs SubscribeVehicleData, UnsubscribeVehicleData, OnVehicleData notification and +-- handsOffSteering parameter are allowed by policies +-- 3) App is registered +-- 4) App is subscribed to handsOffSteering data +-- +-- In case: +-- 1) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL +-- SDL does: +-- - a) transfer this notification to App +-- 2) App unsubscribes from handsOffSteering parameter +-- 3) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL +-- SDL does: +-- - a) not transfer this notification to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local handsOffSteeringValues = { true, false } +local rpc_sub = "SubscribeVehicleData" +local rpc_unsub = "UnsubscribeVehicleData" +local notExpected = 0 +local expected = 1 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) +for _, value in pairs(handsOffSteeringValues) do + common.Step("OnVehicleData notification is transfered to App, handsOffSteering=" .. tostring(value), + common.sendOnVehicleData, { expected, value }) +end + +common.Title("Test") +common.Step("App subscribes from handsOffSteering data", common.processSubscriptionRPC, { rpc_unsub }) +for _, value in pairs(handsOffSteeringValues) do + common.Step("OnVehicleData notification is not transfered to App, handsOffSteering=" .. tostring(value), + common.sendOnVehicleData, { notExpected, value }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/025_OnVD_notification_for_two_Apps.lua b/test_scripts/API/VehicleData/HandsOffSteering/025_OnVD_notification_for_two_Apps.lua new file mode 100644 index 0000000000..2bf551e94c --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/025_OnVD_notification_for_two_Apps.lua @@ -0,0 +1,72 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL processes OnVehicleData notification with 'handsOffSteering' parameter for two Apps +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPCs OnVehicleData, SubscribeVehicleData notification and handsOffSteering parameter are allowed by policies +-- 3) App_1 and App_2 are registered +-- +-- In case: +-- 1) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL +-- SDL does: +-- - a) not transfer this notification to both apps +-- 1) App_1 subscribes to handsOffSteering data +-- 2) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL +-- SDL does: +-- - a) transfer this notification only to App_1 +-- 3) App_2 subscribes to handsOffSteering data +-- 4) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL +-- SDL does: +-- - a) transfer this notification to App_1 and App_2 +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local value = { true, false } +local rpc_sub = "SubscribeVehicleData" +local appId_1 = 1 +local appId_2 = 2 +local isExpectedSubscribeVDonHMI = true +local isNotExpectedSubscribeVDonHMI = false +local expected = 1 +local notExpected = 0 + +--[[ Local Functions ]] +local function onVehicleDataForTwoApps(pHandsOffSteering, pExpTimesApp1, pExpTimesApp2) + common.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", { handsOffSteering = pHandsOffSteering }) + common.getMobileSession(appId_1):ExpectNotification("OnVehicleData", { handsOffSteering = pHandsOffSteering }) + :Times(pExpTimesApp1) + common.getMobileSession(appId_2):ExpectNotification("OnVehicleData", { handsOffSteering = pHandsOffSteering }) + :Times(pExpTimesApp2) +end + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App_1", common.registerApp, { appId_1 }) +common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) + +common.Title("Test") +for _, v in pairs(value) do + common.Step("Absence OnVehicleData notification for both apps with handsOffSteering=" .. tostring(v), + onVehicleDataForTwoApps, { v, notExpected, notExpected }) +end +common.Step("App_1 subscribes to handsOffSteering data", +common.processSubscriptionRPC, { rpc_sub, appId_1, isExpectedSubscribeVDonHMI }) +for _, v in pairs(value) do + common.Step("OnVehicleData notification to App_1 with handsOffSteering=" .. tostring(v), + onVehicleDataForTwoApps, { v, expected, notExpected }) +end +common.Step("App_2 subscribes to handsOffSteering data", + common.processSubscriptionRPC, { rpc_sub, appId_2, isNotExpectedSubscribeVDonHMI }) +for _, v in pairs(value) do + common.Step("OnVehicleData notification tp both apps with handsOffSteering=" .. tostring(v), + onVehicleDataForTwoApps, { v, expected, expected }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua b/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua new file mode 100644 index 0000000000..58204d3076 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua @@ -0,0 +1,63 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL processes vehicle data RPCs with 'handsOffSteering' +-- parameter if an app is registered with version greater than current parameter version +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) Vehicle data RPCs and handsOffSteering parameter are allowed by policies +-- 3) handsOffSteering parameter has since = 6.0 +-- 4) App is registered with syncMsgVersion = 7.0 +-- +-- In case: +-- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends VehicleInfo.GetVehicleData response with handsOffSteering data to SDL +-- SDL does: +-- - a) send GetVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App +-- 3) App send valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 4) HMI sends VehicleInfo.SubscribeVehicleData response with handsOffSteering data to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App +-- 5) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL +-- SDL does: +-- - a) transfer this notification to App +-- 6) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 7) HMI sends VehicleInfo.UnsubscribeVehicleData response with handsOffSteering data to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- handsOffSteering = ) to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Test Configuration ]] +common.getAppParams().syncMsgVersion.majorVersion = 7 +common.getAppParams().syncMsgVersion.minorVersion = 0 + +--[[ Local Variables ]] +local rpc_sub = "SubscribeVehicleData" +local rpc_unsub = "UnsubscribeVehicleData" + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +common.Step("RPC GetVehicleData with handsOffSteering parameter", common.getVehicleData) +common.Step("RPC " .. rpc_sub .. " with handsOffSteering parameter", common.processSubscriptionRPC, { rpc_sub }) +common.Step("Notification OnVehicleData with handsOffSteering parameter", common.sendOnVehicleData) +common.Step("RPC " .. rpc_unsub .. " on handsOffSteering parameter", common.processSubscriptionRPC, { rpc_unsub }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua b/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua new file mode 100644 index 0000000000..0f4f48873e --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua @@ -0,0 +1,57 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL rejects vehicle data RPCs with 'handsOffSteering' +-- parameter if an app registered with version less than current parameter version +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) Vehicle data RPCs and handsOffSteering parameter are allowed by policies +-- 3) handsOffSteering parameter has since = 6.0 +-- 4) App is registered with syncMsgVersion = 5.0 +-- +-- In case: +-- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send GetVehicleData response with (success = false, resultCode = "INVALID_DATA") to App +-- - b) not transfer this request to HMI +-- 2) App send valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = false, resultCode = "INVALID_DATA") to App +-- - b) not transfer this request to HMI +-- 3) App send valid UnsubscribeVehicleData request to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "INVALID_DATA") to App +-- - b) not transfer this request to HMI +-- 4) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL +-- SDL does: +-- - a) ignored this notification and not transfer it to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Test Configuration ]] +common.getAppParams().syncMsgVersion.majorVersion = 5 +common.getAppParams().syncMsgVersion.minorVersion = 0 + +--[[ Local Variables ]] +local rpc_get = "GetVehicleData" +local rpc_sub = "SubscribeVehicleData" +local rpc_unsub = "UnsubscribeVehicleData" +local result = "INVALID_DATA" +local notExpected = 0 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +common.Step("RPC GetVehicleData with handsOffSteering parameter", common.processRPCFailure, { rpc_get, result }) +common.Step("RPC " .. rpc_sub .. " with handsOffSteering parameter", common.processRPCFailure, { rpc_sub, result }) +common.Step("Notification OnVehicleData with handsOffSteering parameter", common.sendOnVehicleData, { notExpected }) +common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter", common.processRPCFailure, { rpc_unsub, result }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/028_SubscribeVD_during_resumption_unexpected_disconnect.lua b/test_scripts/API/VehicleData/HandsOffSteering/028_SubscribeVD_during_resumption_unexpected_disconnect.lua new file mode 100644 index 0000000000..62798a9e00 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/028_SubscribeVD_during_resumption_unexpected_disconnect.lua @@ -0,0 +1,43 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL restores the subscription for 'handsOffSteering' data after unexpected disconnect +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC SubscribeVehicleData and handsOffSteering are allowed by policies +-- 3) App is registered and subscribed to handsOffSteering data +-- 4) Unexpected disconnect and reconnect are performed +-- +-- In case: +-- 1) App re-registers with actual HashId +-- SDL does: +-- - a) send VehicleInfo.SubscribeVehicleData(handsOffSteering=true) request to HMI during resumption +-- - b) process successful response from HMI +-- - c) restore subscription for handsOffSteering data +-- - d) respond RAI(SUCCESS) to mobile app +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc = "SubscribeVehicleData" +local appId = 1 +local subscribeVDExpectedOnHMI = true + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc }) + +common.Title("Test") +common.Step("Unexpected disconnect", common.unexpectedDisconnect) +common.Step("Connect mobile", common.connectMobile) +common.Step("Re-register App resumption data", common.registerAppWithResumption, + { appId, subscribeVDExpectedOnHMI }) +common.Step("Check resumption of subscription using OnVehicleData notification", common.sendOnVehicleData) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua b/test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua new file mode 100644 index 0000000000..5c86ca380e --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua @@ -0,0 +1,44 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL restores the subscription to 'handsOffSteering' parameter after IGN_OFF/IGN_ON +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC SubscribeVehicleData and handsOffSteering are allowed by policies +-- 3) App is registered and subscribed to handsOffSteering data +-- 4) IGN_OFF and IGN_ON are performed +-- +-- In case: +-- 1) App re-registers with actual HashId +-- SDL does: +-- - a) send VehicleInfo.SubscribeVehicleData(handsOffSteering=true) request to HMI during resumption +-- - b) process successful response from HMI +-- - c) restore subscription for handsOffSteering data +-- - d) respond RAI(SUCCESS) to mobile app +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc = "SubscribeVehicleData" +local appId = 1 +local subscribeVDExpectedOnHMI = true + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc }) + +common.Title("Test") +common.Step("IGNITION_OFF", common.ignitionOff) +common.Step("IGNITION_ON", common.start) +common.Step("Re-register App resumption data", common.registerAppWithResumption, + { appId, subscribeVDExpectedOnHMI }) +common.Step("Check resumption of subscription using OnVehicleData notification", + common.sendOnVehicleData) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua b/test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua new file mode 100644 index 0000000000..4d95913709 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua @@ -0,0 +1,59 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL restores SubscribeVehicleData on 'handsOffSteering' parameter after unexpected disconnect +-- for two apps +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC SubscribeVehicleData and handsOffSteering are allowed by policies +-- 3) App_1 and App_2 are registered and subscribed to handsOffSteering data +-- 4) Unexpected disconnect and reconnect are performed +-- +-- In case: +-- 1) App_1 re-registers with actual HashId +-- SDL does: +-- - a) send VehicleInfo.SubscribeVehicleData(handsOffSteering=true) request to HMI during resumption +-- - b) process successful response from HMI +-- - c) restore subscription for handsOffSteering data +-- - d) respond RAI(SUCCESS) to mobile app +-- 2) App_2 re-registers with actual HashId +-- SDL does: +-- - a) not send VehicleInfo.SubscribeVehicleData request to HMI during resumption +-- - b) restore subscription for handsOffSteering data internally +-- - c) respond RAI(SUCCESS) to mobile app +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc_sub = "SubscribeVehicleData" +local appId_1 = 1 +local appId_2 = 2 +local isExpectedSubscribeVDonHMI = true +local isNotExpectedSubscribeVDonHMI = false + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App_1", common.registerApp, { appId_1 }) +common.Step("App_1 subscribes to handsOffSteering data", + common.processSubscriptionRPC, { rpc_sub, appId_1, isExpectedSubscribeVDonHMI }) +common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) +common.Step("App_2 subscribes to handsOffSteering data", + common.processSubscriptionRPC, { rpc_sub, appId_2, isNotExpectedSubscribeVDonHMI }) + +common.Title("Test") +common.Step("Unexpected disconnect", common.unexpectedDisconnect) +common.Step("Connect mobile", common.connectMobile) +common.Step("Re-register App_1 with data resumption", + common.registerAppWithResumption, { appId_1, isExpectedSubscribeVDonHMI }) +common.Step("Check resumption data OnVehicleData notification", common.sendOnVehicleData) +common.Step("Re-register App_2 with data resumption", + common.registerAppWithResumption, { appId_2, isNotExpectedSubscribeVDonHMI }) +common.Step("Check resumption data OnVehicleData notification with handsOffSteering parameter for two Apps", + common.onVehicleDataTwoApps) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua b/test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua new file mode 100644 index 0000000000..1374dd59e6 --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua @@ -0,0 +1,59 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL restores SubscribeVehicleData on 'handsOffSteering' parameter after IGN_OFF/IGN_ON cycle +-- for two apps +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) RPC SubscribeVehicleData and handsOffSteering are allowed by policies +-- 3) App_1 and App_2 are registered and subscribed to handsOffSteering data +-- 4) IGN_OFF and IGN_ON are performed +-- +-- In case: +-- 1) App_1 re-registers with actual HashId +-- SDL does: +-- - a) send VehicleInfo.SubscribeVehicleData(handsOffSteering=true) request to HMI during resumption +-- - b) process successful response from HMI +-- - c) restore subscription for handsOffSteering data +-- - d) respond RAI(SUCCESS) to mobile app +-- 2) App_2 re-registers with actual HashId +-- SDL does: +-- - a) not send VehicleInfo.SubscribeVehicleData request to HMI during resumption +-- - b) restore subscription for handsOffSteering data internally +-- - c) respond RAI(SUCCESS) to mobile app +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc_sub = "SubscribeVehicleData" +local appId_1 = 1 +local appId_2 = 2 +local isExpectedSubscribeVDonHMI = true +local isNotExpectedSubscribeVDonHMI = false + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App_1", common.registerApp, { appId_1 }) +common.Step("App_1 subscribes to handsOffSteering data", + common.processSubscriptionRPC, { rpc_sub, appId_1, isExpectedSubscribeVDonHMI }) +common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) +common.Step("App_2 subscribes to handsOffSteering data", + common.processSubscriptionRPC, { rpc_sub, appId_2, isNotExpectedSubscribeVDonHMI }) + +common.Title("Test") +common.Step("IGNITION_OFF", common.ignitionOff) +common.Step("IGNITION_ON", common.start) +common.Step("Re-register App_1 with data resumption", + common.registerAppWithResumption, { appId_1, isExpectedSubscribeVDonHMI }) +common.Step("Check resumption data OnVehicleData notification", common.sendOnVehicleData) +common.Step("Re-register App_2 with data resumption", + common.registerAppWithResumption, { appId_2, isNotExpectedSubscribeVDonHMI }) +common.Step("Check resumption data OnVehicleData notification with handsOffSteering parameter for two Apps", + common.onVehicleDataTwoApps) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/common.lua b/test_scripts/API/VehicleData/HandsOffSteering/common.lua new file mode 100644 index 0000000000..b98ccbb9ea --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/common.lua @@ -0,0 +1,283 @@ +--------------------------------------------------------------------------------------------------- +-- Common module +--------------------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------------------- +--[[ General configuration parameters ]] +config.defaultProtocolVersion = 2 +config.application1.registerAppInterfaceParams.syncMsgVersion.majorVersion = 6 +config.application1.registerAppInterfaceParams.syncMsgVersion.minorVersion = 0 +config.application2.registerAppInterfaceParams.syncMsgVersion.majorVersion = 6 +config.application2.registerAppInterfaceParams.syncMsgVersion.minorVersion = 0 + +--[[ Required Shared libraries ]] +local actions = require("user_modules/sequences/actions") +local runner = require('user_modules/script_runner') +local utils = require("user_modules/utils") +local json = require("modules/json") +local SDL = require("SDL") + +--[[ General configuration parameters ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local m = {} +local hashId = {} + +m.Title = runner.Title +m.Step = runner.Step +m.getPreloadedPT = actions.sdl.getPreloadedPT +m.setPreloadedPT = actions.sdl.setPreloadedPT +m.registerApp = actions.app.register +m.registerAppWOPTU = actions.app.registerNoPTU +m.activateApp = actions.app.activate +m.getMobileSession = actions.mobile.getSession +m.getHMIConnection = actions.hmi.getConnection +m.getAppParams = actions.app.getParams +m.cloneTable = utils.cloneTable +m.start = actions.start +m.postconditions = actions.postconditions +m.policyTableUpdate = actions.policyTableUpdate +m.getAppsCount = actions.mobile.getAppsCount +m.deleteSession = actions.mobile.deleteSession +m.connectMobile = actions.mobile.connect +m.wait = utils.wait +m.spairs = utils.spairs + +local handsOffSteeringResponseData = { + dataType = "VEHICLEDATA_HANDSOFFSTEERING", + resultCode = "SUCCESS" +} + +--[[ Functions ]] +--[[ @updatePreloadedPT: Update preloaded file with additional permissions for handsOffSteering +--! @parameters: +--! pGroup: table with additional updates (optional) +--! @return: none +--]] +local function updatePreloadedPTFile(pGroup) + local pt = m.getPreloadedPT() + if not pGroup then + pGroup = { + rpcs = { + GetVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "handsOffSteering" } + }, + OnVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "handsOffSteering" } + }, + SubscribeVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "handsOffSteering" } + }, + UnsubscribeVehicleData = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = { "handsOffSteering" } + } + } + } + end + pt.policy_table.functional_groupings["HandsOffSteering"] = pGroup + pt.policy_table.app_policies["default"].groups = { "Base-4", "HandsOffSteering" } + pt.policy_table.functional_groupings["DataConsent-2"].rpcs = json.null + m.setPreloadedPT(pt) +end + +--[[ @preconditions: Clean environment, optional backup and update of sdl_preloaded_pt.json file + --! @parameters: + --! pGroup: data for updating sdl_preloaded_pt.json file + --! @return: none + --]] +function m.preconditions(pGroup) + actions.preconditions() + updatePreloadedPTFile(pGroup) +end + +--[[ @setHashId: Set hashId value which is required during resumption +--! @parameters: +--! pHashValue: application hashId +--! pAppId: application number (1, 2, etc.) +--! @return: none +--]] +function m.setHashId(pHashValue, pAppId) + hashId[pAppId] = pHashValue +end + +--[[ @getHashId: Get hashId value of an app which is required during resumption +--! @parameters: +--! pAppId: application number (1, 2, etc.) +--! @return: app's hashId +--]] +function m.getHashId(pAppId) + return hashId[pAppId] +end + +--[[ @getVehicleData: Successful processing of GetVehicleData RPC +--! @parameters: +--! pHandsOffSteeringHmiValue: value of the handsOffSteering parameter for HMI response +--! @return: none +--]] +function m.getVehicleData(pHandsOffSteeringHmiValue) + if pHandsOffSteeringHmiValue == nil then pHandsOffSteeringHmiValue = true end + local cid = m.getMobileSession():SendRPC("GetVehicleData", { handsOffSteering = true }) + m.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", { handsOffSteering = true }) + :Do(function(_, data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { handsOffSteering = pHandsOffSteeringHmiValue }) + end) + m.getMobileSession():ExpectResponse(cid, + { success = true, resultCode = "SUCCESS", handsOffSteering = pHandsOffSteeringHmiValue }) +end + +--[[ @processRPCFailure: Processing VehicleData RPC with ERROR resultCode +--! @parameters: +--! pRPC: RPC for mobile request +--! pResult: Result code for mobile response +--! pRequestValue: handsOffSteering value for mobile request +--! @return: none +--]] +function m.processRPCFailure(pRPC, pResult, pRequestValue) + if pRequestValue == nil then pRequestValue = true end + local cid = m.getMobileSession():SendRPC(pRPC, { handsOffSteering = pRequestValue }) + m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC):Times(0) + m.getMobileSession():ExpectResponse(cid, { success = false, resultCode = pResult }) +end + +--[[ @processRPCgenericError: Processing VehicleData RPC with invalid HMI response +--! @parameters: +--! pRPC: RPC for mobile request +--! pData: data for HMI response +--! @return: none +--]] +function m.processRPCgenericError(pRPC, pData) + local cid = m.getMobileSession():SendRPC(pRPC, { handsOffSteering = true }) + m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC, { handsOffSteering = true }) + :Do(function(_,data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { handsOffSteering = pData }) + end) + m.getMobileSession():ExpectResponse(cid, { success = false, resultCode = "GENERIC_ERROR" }) +end + +--[[ @subUnsubScribeVD: Processing SubscribeVehicleData and UnsubscribeVehicleData RPCs +--! @parameters: +--! pRPC: RPC for mobile request +--! pAppId: application number (1, 2, etc.) +--! isRequestOnHMIExpected: true or omitted - in case VehicleInfo.Sub/UnsubscribeVehicleData_request on HMI is expected, +--! otherwise - false +--! @return: none +--]] +function m.processSubscriptionRPC(pRPC, pAppId, isRequestOnHMIExpected) + if not pAppId then pAppId = 1 end + local cid = m.getMobileSession(pAppId):SendRPC(pRPC, { handsOffSteering = true }) + if isRequestOnHMIExpected == nil or isRequestOnHMIExpected == true then + m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC, { handsOffSteering = true }) + :Do(function(_,data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", + { handsOffSteering = handsOffSteeringResponseData }) + end) + else + m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC):Times(0) + end + m.getMobileSession(pAppId):ExpectResponse(cid, + { success = true, resultCode = "SUCCESS", handsOffSteering = handsOffSteeringResponseData }) + m.getMobileSession(pAppId):ExpectNotification("OnHashChange") + :Do(function(_, data) + m.setHashId(data.payload.hashID, pAppId) + end) +end + +--[[ @sendOnVehicleData: Processing OnVehicleData RPC +--! @parameters: +--! pData: data for the notification +--! pExpTime: number of notifications +--! @return: none +--]] +function m.sendOnVehicleData(pExpTime, pData) + if not pExpTime then pExpTime = 1 end + if pData == nil then pData = true end + m.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", { handsOffSteering = pData }) + m.getMobileSession():ExpectNotification("OnVehicleData", { handsOffSteering = pData }) + :Times(pExpTime) +end + +--[[ @onVehicleDataTwoApps: Processing OnVehicleData RPC for two apps +--! @parameters: +--! pExpTimes: number of notifications for 2 apps +--! @return: none +--]] +function m.onVehicleDataTwoApps(pExpTimes) + if pExpTimes == nil then pExpTimes = 1 end + m.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", { handsOffSteering = true }) + m.getMobileSession(1):ExpectNotification("OnVehicleData", { handsOffSteering = true }) + :Times(pExpTimes) + m.getMobileSession(2):ExpectNotification("OnVehicleData", { handsOffSteering = true }) + :Times(pExpTimes) +end + +--[[ @ignitionOff: IGNITION_OFF sequence +--! @parameters: none +--! @return: none +--]] +function m.ignitionOff() + local isOnSDLCloseSent = false + m.getHMIConnection():SendNotification("BasicCommunication.OnExitAllApplications", { reason = "SUSPEND" }) + m.getHMIConnection():ExpectNotification("BasicCommunication.OnSDLPersistenceComplete") + :Do(function() + m.getHMIConnection():SendNotification("BasicCommunication.OnExitAllApplications", { reason = "IGNITION_OFF" }) + m.getHMIConnection():ExpectNotification("BasicCommunication.OnSDLClose") + :Do(function() + isOnSDLCloseSent = true + SDL.DeleteFile() + end) + end) + m.wait(3000) + :Do(function() + if isOnSDLCloseSent == false then m.cprint(35, "BC.OnSDLClose was not sent") end + StopSDL() + end) +end + +--[[ @unexpectedDisconnect: closing connection +--! @parameters: none +--! @return: none +--]] +function m.unexpectedDisconnect() + m.getHMIConnection():ExpectNotification("BasicCommunication.OnAppUnregistered", { unexpectedDisconnect = true }) + :Times(m.getAppsCount()) + actions.mobile.disconnect() + m.wait(1000) +end + +--[[ @registerAppWithResumption: Successful application registration with custom expectations for resumption +--! @parameters: +--! pAppId - application number (1, 2, etc.) +--! isHMISubscription: if true VD.SubscribeVehicleData request is expected on HMI, otherwise - not expected +--! @return: none +--]] +function m.registerAppWithResumption(pAppId, isHMISubscription) + if not pAppId then pAppId = 1 end + local session = actions.mobile.createSession(pAppId) + session:StartService(7) + :Do(function() + m.getAppParams(pAppId).hashID = m.getHashId(pAppId) + local corId = session:SendRPC("RegisterAppInterface", m.getAppParams(pAppId)) + m.getHMIConnection():ExpectNotification("BasicCommunication.OnAppRegistered", { + application = { appName = m.getAppParams(pAppId).appName } + }) + if isHMISubscription == true then + m.getHMIConnection():ExpectRequest( "VehicleInfo.SubscribeVehicleData", { handsOffSteering = true }) + :Do(function(_, data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", + { handsOffSteering = handsOffSteeringResponseData }) + end) + else + m.getHMIConnection():ExpectRequest("VehicleInfo.SubscribeVehicleData"):Times(0) + end + session:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) + :Do(function() + session:ExpectNotification("OnPermissionsChange") + end) + end) +end + +return m diff --git a/test_sets/new_vehicle_data_hands_off_steering.txt b/test_sets/new_vehicle_data_hands_off_steering.txt new file mode 100644 index 0000000000..78646a5837 --- /dev/null +++ b/test_sets/new_vehicle_data_hands_off_steering.txt @@ -0,0 +1,31 @@ +./test_scripts/API/VehicleData/HandsOffSteering/001_GetVD_Success_flow.lua +./test_scripts/API/VehicleData/HandsOffSteering/002_GetVD_disallowed.lua +./test_scripts/API/VehicleData/HandsOffSteering/003_GetVD_disallowed_after_PTU.lua +./test_scripts/API/VehicleData/HandsOffSteering/004_GetVD_HMI_responds_with_invalid_data.lua +./test_scripts/API/VehicleData/HandsOffSteering/005_GetVD_App_sends_invalid_request.lua +./test_scripts/API/VehicleData/HandsOffSteering/006_SubscribeVD_Success.lua +./test_scripts/API/VehicleData/HandsOffSteering/007_SubscribeVD_disallowed.lua +./test_scripts/API/VehicleData/HandsOffSteering/008_SubscribeVD_disallowed_after_PTU.lua +;./test_scripts/API/VehicleData/HandsOffSteering/009_SubscribeVD_not_success_codes_for_handsOffSteering_data.lua https://github.com/smartdevicelink/sdl_core/issues/3384 +./test_scripts/API/VehicleData/HandsOffSteering/010_SubscribeVD_HMI_responds_with_invalid_data.lua +./test_scripts/API/VehicleData/HandsOffSteering/011_SubscribeVD_App_sends_invalid_request.lua +./test_scripts/API/VehicleData/HandsOffSteering/012_SubscribeVD_for_two_Apps.lua +./test_scripts/API/VehicleData/HandsOffSteering/013_UnsubscribeVD_Success.lua +./test_scripts/API/VehicleData/HandsOffSteering/014_UnsubscribeVD_disallowed.lua +./test_scripts/API/VehicleData/HandsOffSteering/015_UnsubscribeVD_disallowed_after_PTU.lua +;./test_scripts/API/VehicleData/HandsOffSteering/016_UnsubscribeVD_not_success_codes_for_handsOffSteering_data.lua https://github.com/smartdevicelink/sdl_core/issues/3384 +./test_scripts/API/VehicleData/HandsOffSteering/017_UnsubscribeVD_HMI_responds_with_invalid_data.lua +./test_scripts/API/VehicleData/HandsOffSteering/018_UnsubscribeVD_App_sends_invalid_request.lua +./test_scripts/API/VehicleData/HandsOffSteering/019_UnsubscribeVD_for_two_Apps.lua +./test_scripts/API/VehicleData/HandsOffSteering/020_OnVD_notification_Success.lua +;./test_scripts/API/VehicleData/HandsOffSteering/021_OnVD_notification_disallowed.lua https://github.com/smartdevicelink/sdl_core/issues/3365 +;./test_scripts/API/VehicleData/HandsOffSteering/022_OnVD_disallowed_after_PTU.lua https://github.com/smartdevicelink/sdl_core/issues/3365 +./test_scripts/API/VehicleData/HandsOffSteering/023_OnVD_notification_with_invalid_data.lua +./test_scripts/API/VehicleData/HandsOffSteering/024_OnVD_notification_App_is_not_subscribed.lua +./test_scripts/API/VehicleData/HandsOffSteering/025_OnVD_notification_for_two_Apps.lua +./test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua +./test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua +./test_scripts/API/VehicleData/HandsOffSteering/028_SubscribeVD_during_resumption_unexpected_disconnect.lua +./test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua +;./test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua https://github.com/smartdevicelink/sdl_core/issues/2283 +;./test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua https://github.com/smartdevicelink/sdl_core/issues/2283 From 559d6f5cf9b8a0edf4844930a5f1a527ee024e11 Mon Sep 17 00:00:00 2001 From: IGetmanets Date: Thu, 21 May 2020 18:11:25 +0300 Subject: [PATCH 2/7] Add handsOffSteering data in Generic network signal data scripts --- .../GenericNetworkSignalData/commonGenericNetSignalData.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua b/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua index 55ebe96096..5b2bcccf99 100644 --- a/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua +++ b/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua @@ -142,6 +142,8 @@ local function VehicleDataItemsWithDataTableCreation() common.VehicleDataItemsWithData.vin.APItype = "VEHICLEDATA_VIN" common.VehicleDataItemsWithData.prndl.value = "PARK" common.VehicleDataItemsWithData.prndl.APItype = "VEHICLEDATA_PRNDL" + common.VehicleDataItemsWithData.handsOffSteering.value = true + common.VehicleDataItemsWithData.handsOffSteering.APItype = "VEHICLEDATA_HANDSOFFSTEERING" local tirePressureParams = common.VehicleDataItemsWithData.tirePressure.params tirePressureParams.pressureTelltale.value = "OFF" local leftFrontParams = tirePressureParams.leftFront.params From 60a5b6a92109d0289e08d8aadb94cc49163962b0 Mon Sep 17 00:00:00 2001 From: IGetmanets Date: Thu, 21 May 2020 18:12:52 +0300 Subject: [PATCH 3/7] Increasing parameter version to 6.2 --- .../GenericNetworkSignalData/commonGenericNetSignalData.lua | 2 ++ ..._in_case_app_version_is_greater_than_parameter_version.lua | 2 +- ...ing_in_case_app_version_is_less_than_parameter_version.lua | 2 +- test_scripts/API/VehicleData/HandsOffSteering/common.lua | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua b/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua index 5b2bcccf99..6b8bd81aed 100644 --- a/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua +++ b/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua @@ -6,6 +6,8 @@ config.mobileHost = "127.0.0.1" config.defaultProtocolVersion = 2 config.ValidateSchema = false config.zeroOccurrenceTimeout = 1000 +config.application1.registerAppInterfaceParams.syncMsgVersion.majorVersion = 6 +config.application1.registerAppInterfaceParams.syncMsgVersion.minorVersion = 2 --[[ Required Shared libraries ]] local actions = require("user_modules/sequences/actions") diff --git a/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua b/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua index 58204d3076..b32cc9179e 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua +++ b/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua @@ -7,7 +7,7 @@ -- Preconditions: -- 1) SDL and HMI are started -- 2) Vehicle data RPCs and handsOffSteering parameter are allowed by policies --- 3) handsOffSteering parameter has since = 6.0 +-- 3) handsOffSteering parameter has since = 6.2 -- 4) App is registered with syncMsgVersion = 7.0 -- -- In case: diff --git a/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua b/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua index 0f4f48873e..7e586b5b74 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua +++ b/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua @@ -7,7 +7,7 @@ -- Preconditions: -- 1) SDL and HMI are started -- 2) Vehicle data RPCs and handsOffSteering parameter are allowed by policies --- 3) handsOffSteering parameter has since = 6.0 +-- 3) handsOffSteering parameter has since = 6.2 -- 4) App is registered with syncMsgVersion = 5.0 -- -- In case: diff --git a/test_scripts/API/VehicleData/HandsOffSteering/common.lua b/test_scripts/API/VehicleData/HandsOffSteering/common.lua index b98ccbb9ea..3ee6e3bb96 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/common.lua +++ b/test_scripts/API/VehicleData/HandsOffSteering/common.lua @@ -5,9 +5,9 @@ --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 config.application1.registerAppInterfaceParams.syncMsgVersion.majorVersion = 6 -config.application1.registerAppInterfaceParams.syncMsgVersion.minorVersion = 0 +config.application1.registerAppInterfaceParams.syncMsgVersion.minorVersion = 2 config.application2.registerAppInterfaceParams.syncMsgVersion.majorVersion = 6 -config.application2.registerAppInterfaceParams.syncMsgVersion.minorVersion = 0 +config.application2.registerAppInterfaceParams.syncMsgVersion.minorVersion = 2 --[[ Required Shared libraries ]] local actions = require("user_modules/sequences/actions") From a58bbb882f20b1aa8fa27cf94774f1c667708383 Mon Sep 17 00:00:00 2001 From: IGetmanets Date: Mon, 15 Jun 2020 12:33:49 +0300 Subject: [PATCH 4/7] fixup! Initial scripts for new vehicle data HandsOffSteering --- ...cribeVD_IGNORED_app_already_subscribed.lua | 37 +++++++++++++++++ ...ibeVD_IGNORED_app_already_unsubscribed.lua | 40 +++++++++++++++++++ .../new_vehicle_data_hands_off_steering.txt | 2 + 3 files changed, 79 insertions(+) create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/032_SubscribeVD_IGNORED_app_already_subscribed.lua create mode 100644 test_scripts/API/VehicleData/HandsOffSteering/033_UnsubscribeVD_IGNORED_app_already_unsubscribed.lua diff --git a/test_scripts/API/VehicleData/HandsOffSteering/032_SubscribeVD_IGNORED_app_already_subscribed.lua b/test_scripts/API/VehicleData/HandsOffSteering/032_SubscribeVD_IGNORED_app_already_subscribed.lua new file mode 100644 index 0000000000..6b6bf4c74a --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/032_SubscribeVD_IGNORED_app_already_subscribed.lua @@ -0,0 +1,37 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL rejects SubscribeVehicleData request with resultCode "IGNORED" in case +-- app is already subscribed to 'handsOffSteering' data +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) App is registered +-- 3) App is subscribed to 'handsOffSteering' data +-- +-- In case: +-- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = false, resultCode = "IGNORED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc = "SubscribeVehicleData" +local result = "IGNORED" + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering parameter", common.processSubscriptionRPC, { rpc }) + +common.Title("Test") +common.Step("RPC " .. rpc .. " with handsOffSteering parameter IGNORED", + common.processRPCFailure, { rpc, result }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/033_UnsubscribeVD_IGNORED_app_already_unsubscribed.lua b/test_scripts/API/VehicleData/HandsOffSteering/033_UnsubscribeVD_IGNORED_app_already_unsubscribed.lua new file mode 100644 index 0000000000..eeed2e936d --- /dev/null +++ b/test_scripts/API/VehicleData/HandsOffSteering/033_UnsubscribeVD_IGNORED_app_already_unsubscribed.lua @@ -0,0 +1,40 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md +-- +-- Description: Check that SDL rejects UnsubscribeVehicleData request with resultCode "IGNORED" in case +-- app is already unsubscribed from 'handsOffSteering' data +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) App is registered +-- 3) App is subscribed to 'handsOffSteering' data +-- 4) App is unsubscribed from 'handsOffSteering' data +-- +-- In case: +-- 1) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "IGNORED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') + +--[[ Local Variables ]] +local rpc = "SubscribeVehicleData" +local unsub_rpc = "UnsubscribeVehicleData" +local result = "IGNORED" + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) +common.Step("App subscribes to handsOffSteering parameter", common.processSubscriptionRPC, { rpc }) +common.Step("App unsubscribes from handsOffSteering parameter", common.processSubscriptionRPC, { unsub_rpc }) + +common.Title("Test") +common.Step("RPC " .. unsub_rpc .. " with handsOffSteering parameter IGNORED", + common.processRPCFailure, { unsub_rpc, result }) + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_sets/new_vehicle_data_hands_off_steering.txt b/test_sets/new_vehicle_data_hands_off_steering.txt index 78646a5837..88bbb5961f 100644 --- a/test_sets/new_vehicle_data_hands_off_steering.txt +++ b/test_sets/new_vehicle_data_hands_off_steering.txt @@ -29,3 +29,5 @@ ./test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua ;./test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua https://github.com/smartdevicelink/sdl_core/issues/2283 ;./test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua https://github.com/smartdevicelink/sdl_core/issues/2283 +./test_scripts/API/VehicleData/HandsOffSteering/032_SubscribeVD_IGNORED_app_already_subscribed.lua +./test_scripts/API/VehicleData/HandsOffSteering/033_UnsubscribeVD_IGNORED_app_already_unsubscribed.lua From 9b8450369753a8d39700eeb1bcbbaa48f77c62f3 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Tue, 30 Jun 2020 15:08:05 -0400 Subject: [PATCH 5/7] Update app version --- .../GenericNetworkSignalData/commonGenericNetSignalData.lua | 2 -- ...n_case_app_version_is_greater_than_parameter_version.lua | 6 +++--- ...g_in_case_app_version_is_less_than_parameter_version.lua | 2 +- test_scripts/API/VehicleData/HandsOffSteering/common.lua | 4 ---- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua b/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua index 6b8bd81aed..5b2bcccf99 100644 --- a/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua +++ b/test_scripts/API/VehicleData/GenericNetworkSignalData/commonGenericNetSignalData.lua @@ -6,8 +6,6 @@ config.mobileHost = "127.0.0.1" config.defaultProtocolVersion = 2 config.ValidateSchema = false config.zeroOccurrenceTimeout = 1000 -config.application1.registerAppInterfaceParams.syncMsgVersion.majorVersion = 6 -config.application1.registerAppInterfaceParams.syncMsgVersion.minorVersion = 2 --[[ Required Shared libraries ]] local actions = require("user_modules/sequences/actions") diff --git a/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua b/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua index b32cc9179e..1fb6148db9 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua +++ b/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua @@ -7,8 +7,8 @@ -- Preconditions: -- 1) SDL and HMI are started -- 2) Vehicle data RPCs and handsOffSteering parameter are allowed by policies --- 3) handsOffSteering parameter has since = 6.2 --- 4) App is registered with syncMsgVersion = 7.0 +-- 3) handsOffSteering parameter has since = 7.0 +-- 4) App is registered with syncMsgVersion = 8.0 -- -- In case: -- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL @@ -40,7 +40,7 @@ local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') --[[ Test Configuration ]] -common.getAppParams().syncMsgVersion.majorVersion = 7 +common.getAppParams().syncMsgVersion.majorVersion = 8 common.getAppParams().syncMsgVersion.minorVersion = 0 --[[ Local Variables ]] diff --git a/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua b/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua index 7e586b5b74..a2bd4c5d69 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua +++ b/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua @@ -7,7 +7,7 @@ -- Preconditions: -- 1) SDL and HMI are started -- 2) Vehicle data RPCs and handsOffSteering parameter are allowed by policies --- 3) handsOffSteering parameter has since = 6.2 +-- 3) handsOffSteering parameter has since = 7.0 -- 4) App is registered with syncMsgVersion = 5.0 -- -- In case: diff --git a/test_scripts/API/VehicleData/HandsOffSteering/common.lua b/test_scripts/API/VehicleData/HandsOffSteering/common.lua index 3ee6e3bb96..83066e7873 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/common.lua +++ b/test_scripts/API/VehicleData/HandsOffSteering/common.lua @@ -4,10 +4,6 @@ --------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.application1.registerAppInterfaceParams.syncMsgVersion.majorVersion = 6 -config.application1.registerAppInterfaceParams.syncMsgVersion.minorVersion = 2 -config.application2.registerAppInterfaceParams.syncMsgVersion.majorVersion = 6 -config.application2.registerAppInterfaceParams.syncMsgVersion.minorVersion = 2 --[[ Required Shared libraries ]] local actions = require("user_modules/sequences/actions") From e5003409a758d11455b22d6b2a77100a289a0e70 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Thu, 9 Jul 2020 12:50:32 -0400 Subject: [PATCH 6/7] Enable scripts for fixed issue --- test_scripts/API/VehicleData/HandsOffSteering/common.lua | 1 + test_sets/new_vehicle_data_hands_off_steering.txt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/common.lua b/test_scripts/API/VehicleData/HandsOffSteering/common.lua index 83066e7873..885a177359 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/common.lua +++ b/test_scripts/API/VehicleData/HandsOffSteering/common.lua @@ -38,6 +38,7 @@ m.deleteSession = actions.mobile.deleteSession m.connectMobile = actions.mobile.connect m.wait = utils.wait m.spairs = utils.spairs +m.cprint = utils.cprint local handsOffSteeringResponseData = { dataType = "VEHICLEDATA_HANDSOFFSTEERING", diff --git a/test_sets/new_vehicle_data_hands_off_steering.txt b/test_sets/new_vehicle_data_hands_off_steering.txt index 88bbb5961f..24de82747f 100644 --- a/test_sets/new_vehicle_data_hands_off_steering.txt +++ b/test_sets/new_vehicle_data_hands_off_steering.txt @@ -27,7 +27,7 @@ ./test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua ./test_scripts/API/VehicleData/HandsOffSteering/028_SubscribeVD_during_resumption_unexpected_disconnect.lua ./test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua -;./test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua https://github.com/smartdevicelink/sdl_core/issues/2283 -;./test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua https://github.com/smartdevicelink/sdl_core/issues/2283 +./test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua +./test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua ./test_scripts/API/VehicleData/HandsOffSteering/032_SubscribeVD_IGNORED_app_already_subscribed.lua ./test_scripts/API/VehicleData/HandsOffSteering/033_UnsubscribeVD_IGNORED_app_already_unsubscribed.lua From 74719da886acd6eb460a0ead540150c514f048a3 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Mon, 13 Jul 2020 22:27:06 -0400 Subject: [PATCH 7/7] Rework scripts for VechicleData incl handsOffSteering --- ...ccess_deviceStatus_primaryAudioSource.lua} | 8 +- ..._flow_deviceStatus_primaryAudioSource.lua} | 8 +- .../001_GetVD_Success_flow.lua | 22 +- .../GetVehicleData/001_Success_flow.lua | 56 -- .../GetVehicleData/002_GetVD_disallowed.lua | 52 ++ ..._parameter_DISALLOWED_by_policies_flow.lua | 52 -- .../003_GetVD_disallowed_after_PTU.lua | 70 ++ .../003_GetVD_gps_mandatory_parameters.lua | 100 --- ...4_GetVD_HMI_responds_with_invalid_data.lua | 25 +- .../005_GetVD_App_sends_invalid_request.lua | 22 +- .../006_GetVD_mandatory_parameters.lua | 71 ++ ...sion_is_greater_than_parameter_version.lua | 45 ++ ...version_is_less_than_parameter_version.lua | 46 ++ .../HandsOffSteering/002_GetVD_disallowed.lua | 43 -- .../003_GetVD_disallowed_after_PTU.lua | 60 -- .../007_SubscribeVD_disallowed.lua | 44 -- .../008_SubscribeVD_disallowed_after_PTU.lua | 66 -- ...cribeVD_HMI_responds_with_invalid_data.lua | 44 -- .../012_SubscribeVD_for_two_Apps.lua | 55 -- .../013_UnsubscribeVD_Success.lua | 40 -- .../014_UnsubscribeVD_disallowed.lua | 50 -- ...015_UnsubscribeVD_disallowed_after_PTU.lua | 70 -- ...uccess_codes_for_handsOffSteering_data.lua | 64 -- ...cribeVD_HMI_responds_with_invalid_data.lua | 46 -- ...nsubscribeVD_App_sends_invalid_request.lua | 39 -- .../019_UnsubscribeVD_for_two_Apps.lua | 61 -- .../020_OnVD_notification_Success.lua | 39 -- .../021_OnVD_notification_disallowed.lua | 52 -- .../022_OnVD_disallowed_after_PTU.lua | 62 -- ...23_OnVD_notification_with_invalid_data.lua | 37 -- ...nVD_notification_App_is_not_subscribed.lua | 52 -- .../025_OnVD_notification_for_two_Apps.lua | 72 -- ...sion_is_greater_than_parameter_version.lua | 63 -- ...version_is_less_than_parameter_version.lua | 57 -- ...uring_resumption_unexpected_disconnect.lua | 43 -- ...bscribeVD_during_resumption_IGN_OFF_ON.lua | 44 -- ...ion_unexpected_disconnect_for_two_Apps.lua | 59 -- ...ing_resumption_IGN_OFF_ON_for_two_Apps.lua | 59 -- ...cribeVD_IGNORED_app_already_subscribed.lua | 37 -- ...ibeVD_IGNORED_app_already_unsubscribed.lua | 40 -- .../VehicleData/HandsOffSteering/common.lua | 280 -------- .../OnVehicleData/001_OnVD_Success.lua | 41 ++ .../OnVehicleData/001_Success_flow.lua | 44 -- ...onForUnsubsribedParameter_Ignored_flow.lua | 50 -- .../OnVehicleData/002_OnVD_disallowed.lua | 58 ++ ...meterDisallowedByPolicies_Ignored_flow.lua | 63 -- .../003_OnVD_disallowed_after_PTU.lua | 72 ++ .../004_OnVD_gps_mandatory_parameters.lua | 113 ---- .../004_OnVD_with_invalid_data.lua | 43 ++ .../005_OnVD_App_is_not_subscribed.lua | 49 ++ .../006_OnVD_mandatory_parameters.lua | 54 ++ .../001_SubscribeVD_Success.lua} | 27 +- .../SubscribeVehicleData/001_Success_flow.lua | 41 -- ..._parameter_DISALLOWED_by_policies_flow.lua | 78 --- .../002_SubscribeVD_disallowed.lua | 51 ++ ...already_subscribed_Result_IGNORED_flow.lua | 113 ---- .../003_SubscribeVD_disallowed_after_PTU.lua | 69 ++ ...cribeVD_HMI_responds_with_invalid_data.lua | 46 ++ ...SubscribeVD_App_sends_invalid_request.lua} | 22 +- .../006_SubscribeVD_2nd_request_IGNORED.lua | 49 ++ .../007_SubscribeVD_for_2_apps.lua | 57 ++ ...D_HMI_responds_with_not_success_codes.lua} | 39 +- ..._of_subscription_Unexpected_Disconnect.lua | 44 ++ ...umption_of_subscription_Ignition_Cycle.lua | 44 ++ ...ption_for_2_apps_Unexpected_Disconnect.lua | 59 ++ ...subscription_for_2_apps_Ignition_Cycle.lua | 59 ++ .../001_Success_flow.lua | 44 -- .../001_UnsubscribeVD_Success.lua | 43 ++ ...ameter_not_yet_subscribed_IGNORED_flow.lua | 78 --- .../002_UnsubscribeVD_disallowed.lua | 60 ++ ...ready_unsubscribed_Result_IGNORED_flow.lua | 142 ---- ...003_UnsubscribeVD_disallowed_after_PTU.lua | 82 +++ ...wed_by_policies_Result_DISALLOWED_flow.lua | 77 --- ...cribeVD_HMI_responds_with_invalid_data.lua | 48 ++ ...nsubscribeVD_App_sends_invalid_request.lua | 39 ++ .../006_UnsubscribeVD_2nd_request_IGNORED.lua | 52 ++ .../007_UnsubscribeVD_for_2_apps.lua | 61 ++ ...VD_HMI_responds_with_not_success_codes.lua | 64 ++ ...pp_version_more_then_parameter_version.lua | 2 +- ...DB_app_version_equal_parameter_version.lua | 2 +- ...pp_version_less_then_parameter_version.lua | 2 +- ...pp_version_more_then_parameter_version.lua | 2 +- ...pp_version_more_then_parameter_version.lua | 2 +- ...pp_version_more_then_parameter_version.lua | 2 +- ...app_version_equal_to_parameter_version.lua | 2 +- ...pp_version_less_then_parameter_version.lua | 2 +- ...pp_version_more_then_parameter_version.lua | 2 +- ...pp_version_more_then_parameter_version.lua | 2 +- ...PI_app_version_equal_parameter_version.lua | 2 +- ...pp_version_less_then_parameter_version.lua | 2 +- .../VehicleDataVersioning/common.lua | 53 ++ test_scripts/API/VehicleData/common.lua | 628 ++++++++++++++++++ .../API/VehicleData/commonVehicleData.lua | 394 ----------- test_sets/SDL5_0/audio_source_am_fm_xm.txt | 4 +- test_sets/SDL5_0/vehicle_data.txt | 52 +- .../new_vehicle_data_hands_off_steering.txt | 33 - test_sets/vehicle_data.txt | 52 +- 97 files changed, 2374 insertions(+), 3296 deletions(-) rename test_scripts/API/VehicleData/{GetVehicleData/004_Success_deviceStatus_primaryAudioSource.lua => AudioSource/001_Success_deviceStatus_primaryAudioSource.lua} (90%) rename test_scripts/API/VehicleData/{OnVehicleData/005_Success_flow_deviceStatus_primaryAudioSource.lua => AudioSource/002_Success_flow_deviceStatus_primaryAudioSource.lua} (91%) rename test_scripts/API/VehicleData/{HandsOffSteering => GetVehicleData}/001_GetVD_Success_flow.lua (53%) delete mode 100644 test_scripts/API/VehicleData/GetVehicleData/001_Success_flow.lua create mode 100644 test_scripts/API/VehicleData/GetVehicleData/002_GetVD_disallowed.lua delete mode 100644 test_scripts/API/VehicleData/GetVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua create mode 100644 test_scripts/API/VehicleData/GetVehicleData/003_GetVD_disallowed_after_PTU.lua delete mode 100644 test_scripts/API/VehicleData/GetVehicleData/003_GetVD_gps_mandatory_parameters.lua rename test_scripts/API/VehicleData/{HandsOffSteering => GetVehicleData}/004_GetVD_HMI_responds_with_invalid_data.lua (55%) rename test_scripts/API/VehicleData/{HandsOffSteering => GetVehicleData}/005_GetVD_App_sends_invalid_request.lua (60%) create mode 100644 test_scripts/API/VehicleData/GetVehicleData/006_GetVD_mandatory_parameters.lua create mode 100644 test_scripts/API/VehicleData/GetVehicleData/007_GetVD_app_version_is_greater_than_parameter_version.lua create mode 100644 test_scripts/API/VehicleData/GetVehicleData/008_GetVD_app_version_is_less_than_parameter_version.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/002_GetVD_disallowed.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/003_GetVD_disallowed_after_PTU.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/007_SubscribeVD_disallowed.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/008_SubscribeVD_disallowed_after_PTU.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/010_SubscribeVD_HMI_responds_with_invalid_data.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/012_SubscribeVD_for_two_Apps.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/013_UnsubscribeVD_Success.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/014_UnsubscribeVD_disallowed.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/015_UnsubscribeVD_disallowed_after_PTU.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/016_UnsubscribeVD_not_success_codes_for_handsOffSteering_data.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/017_UnsubscribeVD_HMI_responds_with_invalid_data.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/018_UnsubscribeVD_App_sends_invalid_request.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/019_UnsubscribeVD_for_two_Apps.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/020_OnVD_notification_Success.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/021_OnVD_notification_disallowed.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/022_OnVD_disallowed_after_PTU.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/023_OnVD_notification_with_invalid_data.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/024_OnVD_notification_App_is_not_subscribed.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/025_OnVD_notification_for_two_Apps.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/028_SubscribeVD_during_resumption_unexpected_disconnect.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/032_SubscribeVD_IGNORED_app_already_subscribed.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/033_UnsubscribeVD_IGNORED_app_already_unsubscribed.lua delete mode 100644 test_scripts/API/VehicleData/HandsOffSteering/common.lua create mode 100644 test_scripts/API/VehicleData/OnVehicleData/001_OnVD_Success.lua delete mode 100644 test_scripts/API/VehicleData/OnVehicleData/001_Success_flow.lua delete mode 100644 test_scripts/API/VehicleData/OnVehicleData/002_NotificationForUnsubsribedParameter_Ignored_flow.lua create mode 100644 test_scripts/API/VehicleData/OnVehicleData/002_OnVD_disallowed.lua delete mode 100644 test_scripts/API/VehicleData/OnVehicleData/003_NotificationParameterDisallowedByPolicies_Ignored_flow.lua create mode 100644 test_scripts/API/VehicleData/OnVehicleData/003_OnVD_disallowed_after_PTU.lua delete mode 100644 test_scripts/API/VehicleData/OnVehicleData/004_OnVD_gps_mandatory_parameters.lua create mode 100644 test_scripts/API/VehicleData/OnVehicleData/004_OnVD_with_invalid_data.lua create mode 100644 test_scripts/API/VehicleData/OnVehicleData/005_OnVD_App_is_not_subscribed.lua create mode 100644 test_scripts/API/VehicleData/OnVehicleData/006_OnVD_mandatory_parameters.lua rename test_scripts/API/VehicleData/{HandsOffSteering/006_SubscribeVD_Success.lua => SubscribeVehicleData/001_SubscribeVD_Success.lua} (50%) delete mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/001_Success_flow.lua delete mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua create mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/002_SubscribeVD_disallowed.lua delete mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/003_RPC_parameter_already_subscribed_Result_IGNORED_flow.lua create mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/003_SubscribeVD_disallowed_after_PTU.lua create mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/004_SubscribeVD_HMI_responds_with_invalid_data.lua rename test_scripts/API/VehicleData/{HandsOffSteering/011_SubscribeVD_App_sends_invalid_request.lua => SubscribeVehicleData/005_SubscribeVD_App_sends_invalid_request.lua} (59%) create mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/006_SubscribeVD_2nd_request_IGNORED.lua create mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/007_SubscribeVD_for_2_apps.lua rename test_scripts/API/VehicleData/{HandsOffSteering/009_SubscribeVD_not_success_codes_for_handsOffSteering_data.lua => SubscribeVehicleData/008_SubscribeVD_HMI_responds_with_not_success_codes.lua} (52%) create mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/009_SubscribeVD_Resumption_of_subscription_Unexpected_Disconnect.lua create mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/010_SubscribeVD_Resumption_of_subscription_Ignition_Cycle.lua create mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/011_SubscribeVD_Resumption_of_subscription_for_2_apps_Unexpected_Disconnect.lua create mode 100644 test_scripts/API/VehicleData/SubscribeVehicleData/012_SubscribeVD_Resumption_of_subscription_for_2_apps_Ignition_Cycle.lua delete mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/001_Success_flow.lua create mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/001_UnsubscribeVD_Success.lua delete mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/002_RPC_parameter_not_yet_subscribed_IGNORED_flow.lua create mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/002_UnsubscribeVD_disallowed.lua delete mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/003_RPC_parameter_already_unsubscribed_Result_IGNORED_flow.lua create mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/003_UnsubscribeVD_disallowed_after_PTU.lua delete mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/004_RPC_parameter_disallowed_by_policies_Result_DISALLOWED_flow.lua create mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/004_UnsubscribeVD_HMI_responds_with_invalid_data.lua create mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/005_UnsubscribeVD_App_sends_invalid_request.lua create mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/006_UnsubscribeVD_2nd_request_IGNORED.lua create mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/007_UnsubscribeVD_for_2_apps.lua create mode 100644 test_scripts/API/VehicleData/UnsubscribeVehicleData/008_UnsubscribeVD_HMI_responds_with_not_success_codes.lua create mode 100644 test_scripts/API/VehicleData/VehicleDataVersioning/common.lua create mode 100644 test_scripts/API/VehicleData/common.lua delete mode 100644 test_scripts/API/VehicleData/commonVehicleData.lua delete mode 100644 test_sets/new_vehicle_data_hands_off_steering.txt diff --git a/test_scripts/API/VehicleData/GetVehicleData/004_Success_deviceStatus_primaryAudioSource.lua b/test_scripts/API/VehicleData/AudioSource/001_Success_deviceStatus_primaryAudioSource.lua similarity index 90% rename from test_scripts/API/VehicleData/GetVehicleData/004_Success_deviceStatus_primaryAudioSource.lua rename to test_scripts/API/VehicleData/AudioSource/001_Success_deviceStatus_primaryAudioSource.lua index 70f80a19e4..6c54ec2a30 100644 --- a/test_scripts/API/VehicleData/GetVehicleData/004_Success_deviceStatus_primaryAudioSource.lua +++ b/test_scripts/API/VehicleData/AudioSource/001_Success_deviceStatus_primaryAudioSource.lua @@ -1,9 +1,5 @@ --------------------------------------------------------------------------------------------------- -- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0182-audio-source-am-fm-xm.md --- User story: TBD --- Use case: TBD --- --- Requirement summary:TBD -- -- Description: -- In case: @@ -15,7 +11,7 @@ --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/common') --[[ Local Variables ]] local audioSources = { @@ -74,8 +70,6 @@ common.Title("Preconditions") common.Step("Clean environment", common.preconditions) common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -common.Step("Activate App", common.activateApp) common.Title("Test") for _, source in pairs(audioSources) do diff --git a/test_scripts/API/VehicleData/OnVehicleData/005_Success_flow_deviceStatus_primaryAudioSource.lua b/test_scripts/API/VehicleData/AudioSource/002_Success_flow_deviceStatus_primaryAudioSource.lua similarity index 91% rename from test_scripts/API/VehicleData/OnVehicleData/005_Success_flow_deviceStatus_primaryAudioSource.lua rename to test_scripts/API/VehicleData/AudioSource/002_Success_flow_deviceStatus_primaryAudioSource.lua index 08f533906a..2909f543c0 100644 --- a/test_scripts/API/VehicleData/OnVehicleData/005_Success_flow_deviceStatus_primaryAudioSource.lua +++ b/test_scripts/API/VehicleData/AudioSource/002_Success_flow_deviceStatus_primaryAudioSource.lua @@ -1,9 +1,5 @@ --------------------------------------------------------------------------------------------------- -- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0182-audio-source-am-fm-xm.md --- User story: TBD --- Use case: TBD --- --- Requirement summary:TBD -- -- Description: -- In case: @@ -14,7 +10,7 @@ --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/common') --[[ Local Variables ]] local audioSources = { @@ -90,8 +86,6 @@ common.Title("Preconditions") common.Step("Clean environment", common.preconditions) common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -common.Step("Activate App", common.activateApp) common.Title("Test") common.Step("RPC " .. rpc1.name, processRPCSubscribeSuccess) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/001_GetVD_Success_flow.lua b/test_scripts/API/VehicleData/GetVehicleData/001_GetVD_Success_flow.lua similarity index 53% rename from test_scripts/API/VehicleData/HandsOffSteering/001_GetVD_Success_flow.lua rename to test_scripts/API/VehicleData/GetVehicleData/001_GetVD_Success_flow.lua index e5907d988d..31d29b4bb5 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/001_GetVD_Success_flow.lua +++ b/test_scripts/API/VehicleData/GetVehicleData/001_GetVD_Success_flow.lua @@ -1,27 +1,22 @@ --------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL processes GetVehicleData RPC with 'handsOffSteering' parameter +-- Description: Check that SDL processes GetVehicleData RPC with parameter -- -- Preconditions: -- 1) SDL and HMI are started --- 2) RPC GetVehicleData and handsOffSteering parameter are allowed by policies +-- 2) GetVehicleData RPC and parameter are allowed by policies -- 3) App is registered -- -- In case: --- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL +-- 1) App sends valid GetVehicleData(=true) request to SDL -- SDL does: -- - a) transfer this request to HMI --- 2) HMI sends VehicleInfo.GetVehicleData response with handsOffSteering data to SDL +-- 2) HMI sends VI.GetVehicleData response with data to SDL -- SDL does: -- - a) send GetVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App +-- = ) to App --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variable ]] -local handsOffSteeringValues = { true, false } +local common = require('test_scripts/API/VehicleData/common') --[[ Scenario ]] common.Title("Preconditions") @@ -30,8 +25,9 @@ common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) common.Step("Register App", common.registerApp) common.Title("Test") -for _, value in pairs(handsOffSteeringValues) do - common.Step("RPC GetVehicleData with handsOffSteering " .. tostring(value), common.getVehicleData, { value }) +for param in common.spairs(common.getVDParams()) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.get, common.getVehicleData, { param }) end common.Title("Postconditions") diff --git a/test_scripts/API/VehicleData/GetVehicleData/001_Success_flow.lua b/test_scripts/API/VehicleData/GetVehicleData/001_Success_flow.lua deleted file mode 100644 index 59cdcede31..0000000000 --- a/test_scripts/API/VehicleData/GetVehicleData/001_Success_flow.lua +++ /dev/null @@ -1,56 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case 1: Main Flow --- --- Requirement summary: --- [GetVehicleData] As a mobile app wants to send a request to get the details of the vehicle data --- --- Description: --- In case: --- mobile application sends valid GetVehicleData to SDL and this request is allowed by Policies --- SDL must: --- 1) Transfer this request to HMI --- 2) After successful response from hmi --- respond SUCCESS, success:true and parameter value received from HMI to mobile application ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Functions ]] -local function processRPCSuccess(pData) - local reqParams = { - [pData] = true - } - local hmiResParams = { - [pData] = common.allVehicleData[pData].value - } - local cid = common.getMobileSession():SendRPC("GetVehicleData", reqParams) - common.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", reqParams) - :Do(function(_, data) - common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", hmiResParams) - end) - local mobResParams = common.cloneTable(hmiResParams) - mobResParams.success = true - mobResParams.resultCode = "SUCCESS" - common.getMobileSession():ExpectResponse(cid, mobResParams) -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment", common.preconditions) -common.Step("`100, 1` in GetVehicleDataRequest in ini file", common.setSDLIniParameter, - { "GetVehicleDataRequest", "100, 1" }) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -common.Step("Activate App", common.activateApp) - -common.Title("Test") -for vehicleDataName in pairs(common.allVehicleData) do - common.Step("RPC GetVehicleData " .. vehicleDataName, processRPCSuccess, { vehicleDataName }) -end - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/GetVehicleData/002_GetVD_disallowed.lua b/test_scripts/API/VehicleData/GetVehicleData/002_GetVD_disallowed.lua new file mode 100644 index 0000000000..fd63a11aae --- /dev/null +++ b/test_scripts/API/VehicleData/GetVehicleData/002_GetVD_disallowed.lua @@ -0,0 +1,52 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL rejects GetVehicleData request with resultCode "DISALLOWED" +-- if parameter is not allowed by policy +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) parameter is not allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid GetVehicleData(=true) request to SDL +-- SDL does: +-- - a) send GetVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local result = "DISALLOWED" + +--[[ Local Functions ]] +local function getVDGroup(pDisallowedParam) + local params = {} + for param in pairs(common.getVDParams()) do + if param ~= pDisallowedParam then table.insert(params, param) end + end + return { + rpcs = { + [common.rpc.get] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = params + } + } + } +end + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams()) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions, { getVDGroup(param) }) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App", common.registerApp) + + common.Title("Test") + common.Step("RPC " .. common.rpc.get .. " DISALLOWED", common.processRPCFailure, + { common.rpc.get, param, result }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/GetVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua b/test_scripts/API/VehicleData/GetVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua deleted file mode 100644 index ce8157f245..0000000000 --- a/test_scripts/API/VehicleData/GetVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua +++ /dev/null @@ -1,52 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case: request is allowed but parameter of this request is NOT allowed by Policies --- --- Requirement summary: --- [GetVehicleData] As a mobile app wants to send a request to get the details of the vehicle data --- --- Description: --- In case: --- 1) mobile application sends valid GetVehicleData to SDL and this request is allowed --- by Policies but RPC parameter is not allowed --- SDL must: --- SDL responds DISALLOWED, success:false to mobile application --- and doesn't transfer this request to HMI ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc = { - name = "GetVehicleData", - params = { - engineOilLife = true, - fuelRange = true, - tirePressure = true, - electronicParkBrakeStatus = true, - turnSignal = true - } -} - ---[[ Local Functions ]] -local function processRPCFailure() - local cid = common.getMobileSession():SendRPC(rpc.name, rpc.params) - common.getHMIConnection():ExpectRequest("VehicleInfo." .. rpc.name, rpc.params):Times(0) - common.getMobileSession():ExpectResponse(cid, { success = false, resultCode = "DISALLOWED" }) -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdateMin }) -common.Step("Activate App", common.activateApp) - -common.Title("Test") -common.Step("RPC " .. rpc.name .. " DISALLOWED", processRPCFailure) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/GetVehicleData/003_GetVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/GetVehicleData/003_GetVD_disallowed_after_PTU.lua new file mode 100644 index 0000000000..4ff52c6933 --- /dev/null +++ b/test_scripts/API/VehicleData/GetVehicleData/003_GetVD_disallowed_after_PTU.lua @@ -0,0 +1,70 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL rejects GetVehicleData request with resultCode "DISALLOWED" +-- if parameter is not allowed by policy after PTU +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) GetVehicleData RPC and parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid GetVehicleData(=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends VI.GetVehicleData response with data to SDL +-- SDL does: +-- - a) send GetVehicleData response with (success = true, resultCode = "SUCCESS", +-- = ) to App +-- 3) PTU is performed with disabling permissions for parameter +-- 4) App sends valid GetVehicleData(=true) request to SDL +-- SDL does: +-- - a) send GetVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local result = "DISALLOWED" + +--[[ Local Function ]] +local function getVDGroup(pDisallowedParam) + local params = {} + for param in pairs(common.getVDParams()) do + if param ~= pDisallowedParam then table.insert(params, param) end + end + return { + rpcs = { + [common.rpc.get] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = params + } + } + } +end + +local function policyTableUpdate(pDisallowedParam) + local function ptUpdate(pt) + pt.policy_table.functional_groupings["NewTestCaseGroup"] = getVDGroup(pDisallowedParam) + pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } + end + common.policyTableUpdate(ptUpdate) +end + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams()) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App", common.registerApp) + common.Step("RPC GetVehicleData, SUCCESS", common.getVehicleData, { param }) + + common.Title("Test") + common.Step("PTU with disabling permissions for VD parameter", policyTableUpdate, { param }) + common.Step("RPC " .. common.rpc.get .. " DISALLOWED after PTU", common.processRPCFailure, + { common.rpc.get, param, result }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/GetVehicleData/003_GetVD_gps_mandatory_parameters.lua b/test_scripts/API/VehicleData/GetVehicleData/003_GetVD_gps_mandatory_parameters.lua deleted file mode 100644 index 9fa6b3f530..0000000000 --- a/test_scripts/API/VehicleData/GetVehicleData/003_GetVD_gps_mandatory_parameters.lua +++ /dev/null @@ -1,100 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case 1: Main Flow --- --- Requirement summary: --- [GetVehicleData] As a mobile app wants to send a request to get the details of the vehicle data --- --- Description: --- In case: --- mobile application sends valid GetVehicleData to SDL and this request is allowed by Policies --- SDL must: --- 1) Transfer this request to HMI --- 2) After successful response from hmi with all mandatory parameters --- respond SUCCESS, success:true and resend parameter values received from HMI to mobile application --- 3) After response from HMI with missed mandatory parameters --- respond success:false, GENERIC_ERROR ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc = { - name = "GetVehicleData", - params = { - gps = true - } -} - -local vehicleDataValues = { - allData = { - longitudeDegrees = 10, - latitudeDegrees = 20, - utcYear = 2010, - utcMonth = 1, - utcDay = 2, - utcHours = 3, - utcMinutes = 4, - utcSeconds = 5, - compassDirection = "NORTH", - actual = true, - satellites = 6, - dimension = "2D", - altitude = 7, - heading = 8, - speed = 9, - pdop = 10, - hdop = 11, - vdop = 12 - }, - mandatoryOnly = { - longitudeDegrees = 10, - latitudeDegrees = 20 - } -} - -local vehicleDataValuesMissedMandatory = { - missedAll = { utcYear = 2010 }, - missedLongitude = { latitudeDegrees = 20 }, - missedLatitude = { longitudeDegrees = 10 } -} - ---[[ Local Functions ]] -local function processRPC(pParams, isSuccess) - local cid = common.getMobileSession():SendRPC(rpc.name, rpc.params) - common.getHMIConnection():ExpectRequest("VehicleInfo." .. rpc.name, rpc.params) - :Do(function(_, data) - common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { gps = pParams }) - end) - if isSuccess == true then - local responseParams = {} - responseParams.gps = pParams - responseParams.success = true - responseParams.resultCode = "SUCCESS" - common.getMobileSession():ExpectResponse(cid, responseParams) - else - common.getMobileSession():ExpectResponse(cid, - { success = false, resultCode = "GENERIC_ERROR", info = "Invalid message received from vehicle" }) - 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("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -common.Step("Activate App", common.activateApp) - -common.Title("Test") -for key, value in pairs(vehicleDataValues) do - common.Step("RPC GetVehicleData gps " .. key, processRPC, { value, true }) -end -for key, value in pairs(vehicleDataValuesMissedMandatory) do - common.Step("RPC GetVehicleData gps " .. key, processRPC, { value, false }) -end - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/004_GetVD_HMI_responds_with_invalid_data.lua b/test_scripts/API/VehicleData/GetVehicleData/004_GetVD_HMI_responds_with_invalid_data.lua similarity index 55% rename from test_scripts/API/VehicleData/HandsOffSteering/004_GetVD_HMI_responds_with_invalid_data.lua rename to test_scripts/API/VehicleData/GetVehicleData/004_GetVD_HMI_responds_with_invalid_data.lua index 540c150814..f208568c27 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/004_GetVD_HMI_responds_with_invalid_data.lua +++ b/test_scripts/API/VehicleData/GetVehicleData/004_GetVD_HMI_responds_with_invalid_data.lua @@ -1,28 +1,22 @@ --------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL responds with resultCode "GENERIC_ERROR" to GetVehicleData request if HMI response is --- invalid +-- Description: Check that SDL responds with resultCode "GENERIC_ERROR" to GetVehicleData request +-- if HMI response for parameter is invalid -- -- Preconditions: -- 1) SDL and HMI are started --- 2) RPC GetVehicleData and handsOffSteering parameter are allowed by policies +-- 2) GetVehicleData RPC and parameter are allowed by policies -- 3) App is registered -- -- In case: --- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL +-- 1) App sends valid GetVehicleData(=true) request to SDL -- SDL does: -- - a) transfer this request to HMI --- 2) HMI sends GetVehicleData response with invalid type of handsOffSteering parameter +-- 2) HMI sends GetVehicleData response with invalid type of parameter -- SDL does: -- - a) send GetVehicleData response with (success = false, resultCode = "GENERIC_ERROR") to App --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variable ]] -local rpc = "GetVehicleData" -local handsOffSteeringValue = 123 +local common = require('test_scripts/API/VehicleData/common') --[[ Scenario ]] common.Title("Preconditions") @@ -31,8 +25,11 @@ common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) common.Step("Register App", common.registerApp) common.Title("Test") -common.Step("RPC GetVehicleData, HMI sends invalid response", common.processRPCgenericError, - { rpc, handsOffSteeringValue }) +for param, value in common.spairs(common.getVDParams()) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.get .. " invalid HMI response", common.processRPCgenericError, + { common.rpc.get, param, common.getInvalidData(value) }) +end common.Title("Postconditions") common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/005_GetVD_App_sends_invalid_request.lua b/test_scripts/API/VehicleData/GetVehicleData/005_GetVD_App_sends_invalid_request.lua similarity index 60% rename from test_scripts/API/VehicleData/HandsOffSteering/005_GetVD_App_sends_invalid_request.lua rename to test_scripts/API/VehicleData/GetVehicleData/005_GetVD_App_sends_invalid_request.lua index 4cf069d6d7..38abe7d0af 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/005_GetVD_App_sends_invalid_request.lua +++ b/test_scripts/API/VehicleData/GetVehicleData/005_GetVD_App_sends_invalid_request.lua @@ -1,27 +1,24 @@ --------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL responds with resultCode "INVALID_DATA" to GetVehicleData request if App sends request --- with invalid data +-- Description: Check that SDL responds with resultCode "INVALID_DATA" to GetVehicleData request +-- if App sends request for parameter with invalid data -- -- Preconditions: -- 1) SDL and HMI are started --- 2) RPC GetVehicleData and handsOffSteering parameter are allowed by policies +-- 2) GetVehicleData RPC and parameter are allowed by policies -- 3) App is registered -- -- In case: --- 1) App sends invalid GetVehicleData(handsOffSteering=123) request to SDL +-- 1) App sends invalid GetVehicleData(=123) request to SDL -- SDL does: -- - a) send GetVehicleData response with (success = false, resultCode = "INVALID_DATA") to App -- - b) not transfer this request to HMI --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') +local common = require('test_scripts/API/VehicleData/common') --[[ Local Variables ]] -local rpc = "GetVehicleData" local result = "INVALID_DATA" -local handsOffSteeringValue = 123 +local value = 123 --[[ Scenario ]] common.Title("Preconditions") @@ -30,8 +27,11 @@ common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) common.Step("Register App", common.registerApp) common.Title("Test") -common.Step("RPC GetVehicleData, invalid request", - common.processRPCFailure, { rpc, result, handsOffSteeringValue }) +for param in common.spairs(common.getVDParams()) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.get .. " invalid App request", + common.processRPCFailure, { common.rpc.get, param, result, value }) +end common.Title("Postconditions") common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/GetVehicleData/006_GetVD_mandatory_parameters.lua b/test_scripts/API/VehicleData/GetVehicleData/006_GetVD_mandatory_parameters.lua new file mode 100644 index 0000000000..66f7329864 --- /dev/null +++ b/test_scripts/API/VehicleData/GetVehicleData/006_GetVD_mandatory_parameters.lua @@ -0,0 +1,71 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL processes GetVehicleData RPC with parameter +-- with only mandatory sub-parameters in HMI response +-- or with missing at least one mandatory sub-parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) GetVehicleData RPC and parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid GetVehicleData(=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends VI.GetVehicleData response with data to SDL +-- with only mandatory sub-parameters +-- SDL does: +-- - a) send GetVehicleData response with (success = true, resultCode = "SUCCESS", +-- = ) to App +-- 3) App sends valid GetVehicleData(=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 4) HMI sends VI.GetVehicleData response with data to SDL +-- with missing mandatory sub-parameter +-- SDL does: +-- - a) ignore HMI response +-- - b) send GetVehicleData response with (success = false, resultCode = "GENERIC_ERROR") to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Functions ]] +local function processRPC(pRPC, pParam, pValue, pIsSuccess) + local cid = common.getMobileSession():SendRPC(pRPC, { [pParam] = true }) + common.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC, { [pParam] = true }) + :Do(function(_, data) + common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { [pParam] = pValue }) + end) + if pIsSuccess == true then + local responseParams = {} + responseParams[pParam] = pValue + responseParams.success = true + responseParams.resultCode = "SUCCESS" + common.getMobileSession():ExpectResponse(cid, responseParams) + else + common.getMobileSession():ExpectResponse(cid, + { success = false, resultCode = "GENERIC_ERROR", info = "Invalid message received from vehicle" }) + 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("RAI", common.registerApp) + +common.Title("Test") +for param in pairs(common.mandatoryVD) do + common.Title("VD parameter: " .. param) + for caseName, value in pairs(common.getMandatoryOnlyCases(param)) do + common.Step("RPC " .. common.rpc.get .. " with " .. caseName .. " SUCCESS", processRPC, + { common.rpc.get, param, value, true }) + end + for caseName, value in pairs(common.getMandatoryMissingCases(param)) do + common.Step("RPC " .. common.rpc.get .. " with " .. caseName .. " GENERIC_ERROR", processRPC, + { common.rpc.get, param, value, false }) + end +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/GetVehicleData/007_GetVD_app_version_is_greater_than_parameter_version.lua b/test_scripts/API/VehicleData/GetVehicleData/007_GetVD_app_version_is_greater_than_parameter_version.lua new file mode 100644 index 0000000000..aac7450ffc --- /dev/null +++ b/test_scripts/API/VehicleData/GetVehicleData/007_GetVD_app_version_is_greater_than_parameter_version.lua @@ -0,0 +1,45 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL processes vehicle data RPCs with parameter +-- if an app is registered with version greater than current parameter version +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) Vehicle Data RPCs and parameter are allowed by policies +-- 3) parameter has param_version defined (e.g. 5.1.0) +-- 4) App is registered with specific syncMsgVersion (e.g. 5.1.1) +-- which is greater than version of parameter +-- +-- In case: +-- 1) App sends any of Vehicle Data RPC with parameter +-- - a) GetVehicleData, SubscribeVehicleData, UnsubscribeVehicleData +-- SDL does: +-- - a) process this RPC successfully +-- 2) App is subscribed to parameter +-- 3) HMI sends OnVehicleData notification with parameter +-- SDL does: +-- - a) process this Notification successfully +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local isExpected = 1 + +--[[ Scenario ]] +for param, version in common.spairs(common.versioningVD) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Set App version", common.setAppVersion, { version, common.operator.increase }) + common.Step("Register App", common.registerApp) + + common.Title("Test") + common.Step("RPC " .. common.rpc.get, common.getVehicleData, { param }) + common.Step("RPC " .. common.rpc.sub, common.processSubscriptionRPC, { common.rpc.sub, param }) + common.Step("RPC " .. common.rpc.on, common.sendOnVehicleData, { param, isExpected }) + common.Step("RPC " .. common.rpc.unsub, common.processSubscriptionRPC, { common.rpc.unsub, param }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/GetVehicleData/008_GetVD_app_version_is_less_than_parameter_version.lua b/test_scripts/API/VehicleData/GetVehicleData/008_GetVD_app_version_is_less_than_parameter_version.lua new file mode 100644 index 0000000000..4d36361d2a --- /dev/null +++ b/test_scripts/API/VehicleData/GetVehicleData/008_GetVD_app_version_is_less_than_parameter_version.lua @@ -0,0 +1,46 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL rejects vehicle data RPCs with parameter +-- if an app is registered with version less than current parameter version +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) Vehicle Data RPCs and parameter are allowed by policies +-- 3) parameter has param_version defined (e.g. 5.1.0) +-- 4) App is registered with specific syncMsgVersion (e.g. 5.0.9) +-- which is less than version of parameter +-- +-- In case: +-- 1) App sends any of Vehicle Data RPC with parameter +-- - a) GetVehicleData, SubscribeVehicleData, UnsubscribeVehicleData +-- SDL does: +-- - a) send GetVehicleData response with (success = false, resultCode = "INVALID_DATA") to App +-- - b) not transfer this request to HMI +-- 2) HMI sends OnVehicleData notification with parameter +-- SDL does: +-- - a) ignore this notification and not transfer it to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local result = "INVALID_DATA" +local isNotExpected = 0 + +--[[ Scenario ]] +for param, version in common.spairs(common.versioningVD) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Set App version", common.setAppVersion, { version, common.operator.decrease }) + common.Step("Register App", common.registerApp) + + common.Title("Test") + common.Step("RPC " .. common.rpc.get, common.processRPCFailure, { common.rpc.get, param, result }) + common.Step("RPC " .. common.rpc.sub, common.processRPCFailure, { common.rpc.sub, param, result }) + common.Step("RPC " .. common.rpc.on, common.sendOnVehicleData, { param, isNotExpected }) + common.Step("RPC " .. common.rpc.unsub, common.processRPCFailure, { common.rpc.unsub, param, result }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/HandsOffSteering/002_GetVD_disallowed.lua b/test_scripts/API/VehicleData/HandsOffSteering/002_GetVD_disallowed.lua deleted file mode 100644 index e28ea2d34a..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/002_GetVD_disallowed.lua +++ /dev/null @@ -1,43 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL rejects GetVehicleData request with resultCode "DISALLOWED" if 'handsOffSteering' --- parameter is not allowed by policy --- --- Preconditions: --- 1) SDL and HMI are started --- 2) 'handsOffSteering' parameter is Not allowed by policies --- 3) App is registered --- --- In case: --- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send GetVehicleData response with (success = false, resultCode = "DISALLOWED") to App --- - b) not transfer this request to HMI ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - --- [[ Local Variables ]] -local rpc = "GetVehicleData" -local result = "DISALLOWED" -local VDGroup = { - rpcs = { - GetVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "gps" } - } - } -} - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions, { VDGroup }) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) - -common.Title("Test") -common.Step("RPC GetVehicleData DISALLOWED", common.processRPCFailure, { rpc, result }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/003_GetVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/HandsOffSteering/003_GetVD_disallowed_after_PTU.lua deleted file mode 100644 index b84bf9a9f5..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/003_GetVD_disallowed_after_PTU.lua +++ /dev/null @@ -1,60 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL rejects GetVehicleData request with resultCode "DISALLOWED" if 'handsOffSteering' --- parameter is not allowed by policy after PTU --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPC GetVehicleData and handsOffSteering parameter are allowed by policies --- 3) App is registered --- --- In case: --- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) transfer this request to HMI --- 2) HMI sends VehicleInfo.GetVehicleData response with handsOffSteering data to SDL --- SDL does: --- - a) send GetVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App --- 3) PTU is performed with disabling permissions for handsOffSteering parameter --- 4) App sends valid GetVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send GetVehicleData response with (success = false, resultCode = "DISALLOWED") to App --- - b) not transfer this request to HMI ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc = "GetVehicleData" -local result = "DISALLOWED" - --- [[ Local Function ]] -local function ptUpdate(pt) - local pGroups = { - rpcs = { - GetVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "gps" } - } - } - } - pt.policy_table.functional_groupings["NewTestCaseGroup"] = pGroups - pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("RPC GetVehicleData, SUCCESS", common.getVehicleData) - -common.Title("Test") -common.Step("Policy Table Update with disabling permissions for handsOffSteering", - common.policyTableUpdate, { ptUpdate }) -common.Step("RPC GetVehicleData, DISALLOWED after PTU", common.processRPCFailure, { rpc, result }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/007_SubscribeVD_disallowed.lua b/test_scripts/API/VehicleData/HandsOffSteering/007_SubscribeVD_disallowed.lua deleted file mode 100644 index 6b9aadd62a..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/007_SubscribeVD_disallowed.lua +++ /dev/null @@ -1,44 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL rejects SubscribeVehicleData request with resultCode "DISALLOWED" if 'handsOffSteering' --- parameter is not allowed by policy --- --- Preconditions: --- 1) SDL and HMI are started --- 2) 'handsOffSteering' parameter is Not allowed by policies --- 3) App is registered --- --- In case: --- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send SubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App --- - b) not transfer this request to HMI ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc = "SubscribeVehicleData" -local result = "DISALLOWED" -local VDGroup = { - rpcs = { - SubscribeVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "gps" } - } - } -} - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions, { VDGroup }) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) - -common.Title("Test") -common.Step("RPC " .. rpc .. " with handsOffSteering parameter DISALLOWED", - common.processRPCFailure, { rpc, result }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/008_SubscribeVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/HandsOffSteering/008_SubscribeVD_disallowed_after_PTU.lua deleted file mode 100644 index 765dd98c4d..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/008_SubscribeVD_disallowed_after_PTU.lua +++ /dev/null @@ -1,66 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL rejects SubscribeVehicleData request with resultCode "DISALLOWED" if 'handsOffSteering' --- parameter is not allowed by policy after PTU --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies --- 3) App is registered --- --- In case: --- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) transfer this request to HMI --- 2) HMI sends VehicleInfo.SubscribeVehicleData response with handsOffSteering data to SDL --- SDL does: --- - a) send SubscribeVehicleData response with (success = true, resultCode = SUCCESS", --- handsOffSteering = ) to App --- 3) PTU is performed with disabling permissions for handsOffSteering parameter --- 4) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send SubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App --- - b) not transfer this request to HMI ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc = "SubscribeVehicleData" -local result = "DISALLOWED" - ---[[ Local Function ]] -local function ptUpdate(pt) - local pGroups = { - rpcs = { - SubscribeVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "gps" } - }, - OnVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "handsOffSteering" } - } - } - } - pt.policy_table.functional_groupings["NewTestCaseGroup"] = pGroups - pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("RPC " .. rpc .. " with handsOffSteering parameter", - common.processSubscriptionRPC, { rpc }) - -common.Title("Test") -common.Step("Policy Table Update with disabling permissions for handsOffSteering", - common.policyTableUpdate, { ptUpdate }) -common.Step("RPC " .. rpc .. " with handsOffSteering parameter DISALLOWED after PTU", - common.processRPCFailure, { rpc, result }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/010_SubscribeVD_HMI_responds_with_invalid_data.lua b/test_scripts/API/VehicleData/HandsOffSteering/010_SubscribeVD_HMI_responds_with_invalid_data.lua deleted file mode 100644 index ebda48910c..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/010_SubscribeVD_HMI_responds_with_invalid_data.lua +++ /dev/null @@ -1,44 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL responds with resultCode "GENERIC_ERROR" to SubscribeVehicleData request --- if HMI response is invalid --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies --- 3) App is registered --- --- In case: --- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) transfer this request to HMI --- 2) HMI sends invalid response --- SDL does: --- - a) send SubscribeVehicleData response with (success = false, resultCode = "GENERIC_ERROR") to App ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variable ]] -local rpc = "SubscribeVehicleData" -local invalidData = { - invalidType = 123, - wrongDataType = "VEHICLEDATA_GPS", - invalidDataType = 123 -} - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) - -common.Title("Test") -for caseName, value in common.spairs(invalidData) do - common.Step("RPC SubscribeVehicleData, invalid HMI response " .. caseName, - common.processRPCgenericError, { rpc, value }) -end - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/012_SubscribeVD_for_two_Apps.lua b/test_scripts/API/VehicleData/HandsOffSteering/012_SubscribeVD_for_two_Apps.lua deleted file mode 100644 index 7d82e0f17b..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/012_SubscribeVD_for_two_Apps.lua +++ /dev/null @@ -1,55 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL processes SubscribeVehicleData RPC for two Apps with 'handsOffSteering' parameter --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies --- 3) App_1 and App_2 are registered --- --- In case: --- 1) App_1 sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) transfer this request to HMI --- 2) HMI sends successful VehicleInfo.SubscribeVehicleData response with handsOffSteering data to SDL --- SDL does: --- - a) send SubscribeVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App_1 --- 3) App_2 sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send SubscribeVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App_2 --- - b) not transfer this request to HMI ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variable ]] -local rpc = "SubscribeVehicleData" -local appId_1 = 1 -local appId_2 = 2 -local isExpectedSubscribeVDonHMI = true -local isNotExpectedSubscribeVDonHMI = false -local notExpected = 0 -local expected = 1 - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App_1", common.registerApp, { appId_1 }) -common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) -common.Step("Absence of OnVehicleData notification for both apps", - common.onVehicleDataTwoApps, { notExpected }) - -common.Title("Test") -common.Step("RPC " .. rpc .. " on handsOffSteering parameter for App_1", - common.processSubscriptionRPC, { rpc, appId_1, isExpectedSubscribeVDonHMI }) -common.Step("RPC " .. rpc .. " on handsOffSteering parameter for App_2", - common.processSubscriptionRPC, { rpc, appId_2, isNotExpectedSubscribeVDonHMI }) -common.Step("OnVehicleData notification for both apps", - common.onVehicleDataTwoApps, { expected }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/013_UnsubscribeVD_Success.lua b/test_scripts/API/VehicleData/HandsOffSteering/013_UnsubscribeVD_Success.lua deleted file mode 100644 index e8e533bd62..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/013_UnsubscribeVD_Success.lua +++ /dev/null @@ -1,40 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL processes UnsubscribeVehicleData RPC with 'handsOffSteering' parameter --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPCs SubscribeVehicleData, UnsubscribeVehicleData and handsOffSteering parameter are allowed by policies --- 3) App is registered --- 4) App is subscribed to handsOffSteering parameter --- --- In case: --- 1) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) transfer this request to HMI --- 2) HMI sends VehicleInfo.UnsubscribeVehicleData response with handsOffSteering structure to SDL --- SDL does: --- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc_sub = "SubscribeVehicleData" -local rpc_unsub = "UnsubscribeVehicleData" - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) - -common.Title("Test") -common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter", - common.processSubscriptionRPC, { rpc_unsub }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/014_UnsubscribeVD_disallowed.lua b/test_scripts/API/VehicleData/HandsOffSteering/014_UnsubscribeVD_disallowed.lua deleted file mode 100644 index a1fa028797..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/014_UnsubscribeVD_disallowed.lua +++ /dev/null @@ -1,50 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL rejects UnsubscribeVehicleData request with resultCode "DISALLOWED" if --- `handsOffSteering` parameter is not allowed by policy --- --- Preconditions: --- 1) SDL and HMI are started --- 2) `handsOffSteering` parameter is not allowed by policies for UnsubscribeVehicleData RPC --- 3) App is registered and subscribed to handsOffSteering data --- --- In case: --- 1) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App --- - b) not transfer this request to HMI ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc_sub = "SubscribeVehicleData" -local rpc_unsub = "UnsubscribeVehicleData" -local result = "DISALLOWED" -local VDGroup = { - rpcs = { - SubscribeVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = {"handsOffSteering"} - }, - UnsubscribeVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "gps" } - } - } -} - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions, { VDGroup }) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) - -common.Title("Test") -common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter DISALLOWED", - common.processRPCFailure, { rpc_unsub, result }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/015_UnsubscribeVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/HandsOffSteering/015_UnsubscribeVD_disallowed_after_PTU.lua deleted file mode 100644 index c637a751d3..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/015_UnsubscribeVD_disallowed_after_PTU.lua +++ /dev/null @@ -1,70 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL rejects UnsubscribeVehicleData request with resultCode "DISALLOWED" if 'handsOffSteering' --- parameter is not allowed by policy after PTU --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPCs SubscribeVehicleData, UnsubscribeVehicleData and handsOffSteering parameter are allowed by policies --- 3) App is registered and subscribed to handsOffSteering data --- --- In case: --- 1) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) transfer this request to HMI --- 2) HMI sends VehicleInfo.UnsubscribeVehicleData response with handsOffSteering data to SDL --- SDL does: --- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App --- 3) App is subscribed to handsOffSteering data again --- 4) PTU is performed with disabling permissions for handsOffSteering parameter --- 5) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App --- - b) not transfer this request to HMI ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc_sub = "SubscribeVehicleData" -local rpc_unsub = "UnsubscribeVehicleData" -local result = "DISALLOWED" - ---[[ Local Function ]] -local function ptUpdate(pt) - local pGroups = { - rpcs = { - UnsubscribeVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "gps" } - }, - OnVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "handsOffSteering" } - } - } - } - pt.policy_table.functional_groupings["NewTestCaseGroup"] = pGroups - pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) -common.Step("Check allow " .. rpc_unsub .. " RPC", common.processSubscriptionRPC, { rpc_unsub }) -common.Step("App subscribes to handsOffSteering data again", common.processSubscriptionRPC, { rpc_sub }) - -common.Title("Test") -common.Step("Policy Table Update with disabling permissions for handsOffSteering", - common.policyTableUpdate, { ptUpdate }) -common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter DISALLOWED after PTU", - common.processRPCFailure, { rpc_unsub, result }) -common.Step("Check that App is still subscribed", common.sendOnVehicleData) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/016_UnsubscribeVD_not_success_codes_for_handsOffSteering_data.lua b/test_scripts/API/VehicleData/HandsOffSteering/016_UnsubscribeVD_not_success_codes_for_handsOffSteering_data.lua deleted file mode 100644 index 74e10476cc..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/016_UnsubscribeVD_not_success_codes_for_handsOffSteering_data.lua +++ /dev/null @@ -1,64 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Processing of UnsubscribeVehicleData RPC with unsuccessful resultCode for handsOffSteering data --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPCs SubscribeVehicleData, UnsubscribeVehicleData and handsOffSteering parameter are allowed by policies --- 3) App is registered --- 4) App is subscribed to handsOffSteering data --- --- In case: --- 1) App sends UnsubscribeVehicleData(handsOffSteering=true) request to the SDL --- SDL does: --- a) transfer this request to HMI. --- 2) HMI responds with "SUCCESS" result to UnsubscribeVehicleData request --- and with not success result for handsOffSteering vehicle data --- SDL does: --- a) respond "SUCCESS", success:true and with unsuccessful resultCode for handsOffSteering data to the mobile app ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc = "SubscribeVehicleData" -local resultCodes = { - "TRUNCATED_DATA", - "DISALLOWED", - "USER_DISALLOWED", - "INVALID_ID", - "VEHICLE_DATA_NOT_AVAILABLE", - "DATA_NOT_SUBSCRIBED", - "IGNORED", - "DATA_ALREADY_SUBSCRIBED" -} - ---[[ Local Functions ]] -local function UnsubscribeVDwithUnsuccessCodeForVD(pCode) - local handsOffSteeringData = { dataType = "VEHICLEDATA_HANDSOFFSTEERING", resultCode = pCode} - local cid = common.getMobileSession():SendRPC("UnsubscribeVehicleData", { handsOffSteering = true }) - common.getHMIConnection():ExpectRequest("VehicleInfo.UnsubscribeVehicleData", { handsOffSteering = true }) - :Do(function(_,data) - common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", - { handsOffSteering = handsOffSteeringData }) - end) - common.getMobileSession():ExpectResponse(cid, - { success = true, resultCode = "SUCCESS", handsOffSteering = handsOffSteeringData }) -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc }) - -common.Title("Test") -for _, code in common.spairs(resultCodes) do - common.Step("UnsubscribeVehicleData with handsOffSteering resultCode =" .. code, - UnsubscribeVDwithUnsuccessCodeForVD, { code }) -end - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/017_UnsubscribeVD_HMI_responds_with_invalid_data.lua b/test_scripts/API/VehicleData/HandsOffSteering/017_UnsubscribeVD_HMI_responds_with_invalid_data.lua deleted file mode 100644 index 31e3b5581d..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/017_UnsubscribeVD_HMI_responds_with_invalid_data.lua +++ /dev/null @@ -1,46 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL responds with resultCode "GENERIC_ERROR" to UnsubscribeVehicleData request if HMI response --- is invalid --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPCs UnsubscribeVehicleData, SubscribeVehicleData and handsOffSteering parameter are allowed by policies --- 3) App is registered and subscribed to handsOffSteering data --- --- In case: --- 1) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) transfer this request to HMI --- 2) HMI response is invalid --- SDL does: --- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "GENERIC_ERROR") to App ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc_sub = "SubscribeVehicleData" -local rpc_unsub = "UnsubscribeVehicleData" -local invalidData = { - invalidType = 123, - wrongDataType = "VEHICLEDATA_GPS", - invalidDataType = 123 -} - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) - -common.Title("Test") -for caseName, value in common.spairs(invalidData) do - common.Step("RPC UnsubscribeVehicleData, invalid HMI response " .. caseName, - common.processRPCgenericError, { rpc_unsub, value }) -end - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/018_UnsubscribeVD_App_sends_invalid_request.lua b/test_scripts/API/VehicleData/HandsOffSteering/018_UnsubscribeVD_App_sends_invalid_request.lua deleted file mode 100644 index 7cb7fb6fe8..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/018_UnsubscribeVD_App_sends_invalid_request.lua +++ /dev/null @@ -1,39 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL responds with resultCode "INVALID_DATA" to UnsubscribeVehicleData request if App sends --- request with invalid data --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPCs UnsubscribeVehicleData, SubscribeVehicleData and handsOffSteering parameter are allowed by policies --- 3) App is registered and subscribed to handsOffSteering parameter --- --- In case: --- 1) App sends invalid UnsubscribeVehicleData(handsOffSteering=123) request to SDL --- SDL does: --- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "INVALID_DATA") to App --- - c) not transfer this request to HMI ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc_sub = "SubscribeVehicleData" -local rpc_unsub = "UnsubscribeVehicleData" -local result = "INVALID_DATA" -local invalidData = 123 - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) - -common.Title("Test") -common.Step("RPC UnsubscribeVehicleData, App sends invalid request", - common.processRPCFailure, { rpc_unsub, result, invalidData }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/019_UnsubscribeVD_for_two_Apps.lua b/test_scripts/API/VehicleData/HandsOffSteering/019_UnsubscribeVD_for_two_Apps.lua deleted file mode 100644 index 137169292b..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/019_UnsubscribeVD_for_two_Apps.lua +++ /dev/null @@ -1,61 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL processes UnsubscribeVehicleData RPC for two Apps with 'handsOffSteering' parameter --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPCs UnsubscribeVehicleData, SubscribeVehicleData and handsOffSteering parameter are allowed by policies --- 3) App_1 and App_2 are registered and subscribed to handsOffSteering data --- --- In case: --- 1) App_1 sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App_1 --- - c) not transfer this request to HMI --- 2) App_2 sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) transfer this request to HMI --- 3) HMI sends VehicleInfo.UnsubscribeVehicleData response with handsOffSteering data to SDL --- SDL does: --- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App_2 ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc_sub = "SubscribeVehicleData" -local rpc_unsub = "UnsubscribeVehicleData" -local appId_1 = 1 -local appId_2 = 2 -local isExpectedSubscribeVDonHMI = true -local isNotExpectedSubscribeVDonHMI = false -local notExpected = 0 -local expected = 1 - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App_1", common.registerApp, { appId_1 }) -common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) -common.Step("App_1 subscribes to handsOffSteering data", - common.processSubscriptionRPC, { rpc_sub, appId_1, isExpectedSubscribeVDonHMI }) -common.Step("App_2 subscribes to handsOffSteering data", - common.processSubscriptionRPC, { rpc_sub, appId_2, isNotExpectedSubscribeVDonHMI }) -common.Step("OnVehicleData notification for both apps", - common.onVehicleDataTwoApps, { expected }) - -common.Title("Test") -common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter for App_1", - common.processSubscriptionRPC, { rpc_unsub, appId_1, isNotExpectedSubscribeVDonHMI }) -common.Step("Absence of OnVehicleData notification for App_1", common.sendOnVehicleData, { notExpected }) -common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter for App_2", - common.processSubscriptionRPC, { rpc_unsub, appId_2, isExpectedSubscribeVDonHMI }) -common.Step("Absence of OnVehicleData notification for both apps", - common.onVehicleDataTwoApps, { notExpected }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/020_OnVD_notification_Success.lua b/test_scripts/API/VehicleData/HandsOffSteering/020_OnVD_notification_Success.lua deleted file mode 100644 index df218096ce..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/020_OnVD_notification_Success.lua +++ /dev/null @@ -1,39 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL processes OnVehicleData notification with 'handsOffSteering' parameter --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPCs SubscribeVehicleData, OnVehicleData and handsOffSteering parameter are allowed by policies --- 3) App is registered --- 4) App is subscribed to handsOffSteering data --- --- In case: --- 1) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL --- SDL does: --- - a) transfer this notification to App ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local handsOffSteeringValues = { true, false } -local rpc = "SubscribeVehicleData" -local expected = 1 - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering parameter", common.processSubscriptionRPC, { rpc }) - -common.Title("Test") -for _, value in pairs(handsOffSteeringValues) do - common.Step("HMI sends OnVehicleData notification with handsOffSteering " .. tostring(value), - common.sendOnVehicleData, { expected, value }) -end - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/021_OnVD_notification_disallowed.lua b/test_scripts/API/VehicleData/HandsOffSteering/021_OnVD_notification_disallowed.lua deleted file mode 100644 index 20bc03cdc8..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/021_OnVD_notification_disallowed.lua +++ /dev/null @@ -1,52 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL doesn't transfer OnVehicleData notification to App if 'handsOffSteering' parameter is not --- allowed by policy --- --- Preconditions: --- 1) SDL and HMI are started --- 2) 'handsOffSteering' is Not allowed by policies for OnVehicleData RPC --- 3) App is registered --- 4) App is subscribed to handsOffSteering parameter --- --- In case: --- 1) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL --- SDL does: --- - a) ignored this notification and not transfer it to App ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local handsOffSteeringValues = { true, false } -local rpc = "SubscribeVehicleData" -local notExpected = 0 -local VDGroup = { - rpcs = { - SubscribeVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = {"handsOffSteering"} - }, - OnVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "gps" } - } - } -} - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions, { VDGroup }) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering parameter", common.processSubscriptionRPC, { rpc }) - -common.Title("Test") -for _, value in pairs(handsOffSteeringValues) do - common.Step("HMI sends OnVehicleData notification not allowed by policy, handsOffSteering-" .. tostring(value), - common.sendOnVehicleData, { notExpected, value }) -end - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/022_OnVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/HandsOffSteering/022_OnVD_disallowed_after_PTU.lua deleted file mode 100644 index 380f1395a9..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/022_OnVD_disallowed_after_PTU.lua +++ /dev/null @@ -1,62 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL doesn't transfer OnVehicleData notification to App if 'handsOffSteering' parameter is not --- allowed by policy after PTU --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPCs SubscribeVehicleData, OnVehicleData and handsOffSteering parameter are allowed by policies --- 3) App is registered and subscribed to handsOffSteering data --- --- In case: --- 1) HMI sends VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL --- SDL does: --- - a) transfer this notification to App --- 3) PTU is performed with disabling permissions for handsOffSteering parameter --- 1) HMI sends VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL --- SDL does: --- - a) ignored this notification and not transfer it to App ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc = "SubscribeVehicleData" -local notExpected = 0 -local expected = 1 - ---[[ Local Function ]] -local function ptUpdate(pt) - local pGroups = { - rpcs = { - SubscribeVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "gps" } - }, - OnVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "handsOffSteering" } - } - } - } - pt.policy_table.functional_groupings["NewTestCaseGroup"] = pGroups - pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering data", - common.processSubscriptionRPC, { rpc }) -common.Step("OnVehicleData notification with handsOffSteering data", common.sendOnVehicleData, { expected }) - -common.Title("Test") -common.Step("Policy Table Update with disabling permissions for handsOffSteering", - common.policyTableUpdate, { ptUpdate }) -common.Step("Absence OnVehicleData notification with handsOffSteering data", common.sendOnVehicleData, { notExpected }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/023_OnVD_notification_with_invalid_data.lua b/test_scripts/API/VehicleData/HandsOffSteering/023_OnVD_notification_with_invalid_data.lua deleted file mode 100644 index abff9a9736..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/023_OnVD_notification_with_invalid_data.lua +++ /dev/null @@ -1,37 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL doesn't transfer OnVehicleData notification to App if HMI sends notification with --- invalid data --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPCs OnVehicleData, SubscribeVehicleData and handsOffSteering parameter are allowed by policies --- 3) App is registered --- 4) App is subscribed to handsOffSteering parameter --- --- In case: --- 1) HMI sends VehicleInfo.OnVehicleData notification with invalid data to SDL --- SDL does: --- - a) ignored this notification and not transfer to App ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variable ]] -local rpc_sub = "SubscribeVehicleData" -local invalidData = 123 -local notExpected = 0 - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) - -common.Title("Test") -common.Step("HMI sends OnVD notification with invalid data", common.sendOnVehicleData, { notExpected, invalidData }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/024_OnVD_notification_App_is_not_subscribed.lua b/test_scripts/API/VehicleData/HandsOffSteering/024_OnVD_notification_App_is_not_subscribed.lua deleted file mode 100644 index 2482954282..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/024_OnVD_notification_App_is_not_subscribed.lua +++ /dev/null @@ -1,52 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL doesn't transfer OnVehicleData notification with 'handsOffSteering' parameter to App --- if an app is not subscribed to 'handsOffSteering' data --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPCs SubscribeVehicleData, UnsubscribeVehicleData, OnVehicleData notification and --- handsOffSteering parameter are allowed by policies --- 3) App is registered --- 4) App is subscribed to handsOffSteering data --- --- In case: --- 1) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL --- SDL does: --- - a) transfer this notification to App --- 2) App unsubscribes from handsOffSteering parameter --- 3) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL --- SDL does: --- - a) not transfer this notification to App ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local handsOffSteeringValues = { true, false } -local rpc_sub = "SubscribeVehicleData" -local rpc_unsub = "UnsubscribeVehicleData" -local notExpected = 0 -local expected = 1 - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc_sub }) -for _, value in pairs(handsOffSteeringValues) do - common.Step("OnVehicleData notification is transfered to App, handsOffSteering=" .. tostring(value), - common.sendOnVehicleData, { expected, value }) -end - -common.Title("Test") -common.Step("App subscribes from handsOffSteering data", common.processSubscriptionRPC, { rpc_unsub }) -for _, value in pairs(handsOffSteeringValues) do - common.Step("OnVehicleData notification is not transfered to App, handsOffSteering=" .. tostring(value), - common.sendOnVehicleData, { notExpected, value }) -end - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/025_OnVD_notification_for_two_Apps.lua b/test_scripts/API/VehicleData/HandsOffSteering/025_OnVD_notification_for_two_Apps.lua deleted file mode 100644 index 2bf551e94c..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/025_OnVD_notification_for_two_Apps.lua +++ /dev/null @@ -1,72 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL processes OnVehicleData notification with 'handsOffSteering' parameter for two Apps --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPCs OnVehicleData, SubscribeVehicleData notification and handsOffSteering parameter are allowed by policies --- 3) App_1 and App_2 are registered --- --- In case: --- 1) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL --- SDL does: --- - a) not transfer this notification to both apps --- 1) App_1 subscribes to handsOffSteering data --- 2) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL --- SDL does: --- - a) transfer this notification only to App_1 --- 3) App_2 subscribes to handsOffSteering data --- 4) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL --- SDL does: --- - a) transfer this notification to App_1 and App_2 ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local value = { true, false } -local rpc_sub = "SubscribeVehicleData" -local appId_1 = 1 -local appId_2 = 2 -local isExpectedSubscribeVDonHMI = true -local isNotExpectedSubscribeVDonHMI = false -local expected = 1 -local notExpected = 0 - ---[[ Local Functions ]] -local function onVehicleDataForTwoApps(pHandsOffSteering, pExpTimesApp1, pExpTimesApp2) - common.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", { handsOffSteering = pHandsOffSteering }) - common.getMobileSession(appId_1):ExpectNotification("OnVehicleData", { handsOffSteering = pHandsOffSteering }) - :Times(pExpTimesApp1) - common.getMobileSession(appId_2):ExpectNotification("OnVehicleData", { handsOffSteering = pHandsOffSteering }) - :Times(pExpTimesApp2) -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App_1", common.registerApp, { appId_1 }) -common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) - -common.Title("Test") -for _, v in pairs(value) do - common.Step("Absence OnVehicleData notification for both apps with handsOffSteering=" .. tostring(v), - onVehicleDataForTwoApps, { v, notExpected, notExpected }) -end -common.Step("App_1 subscribes to handsOffSteering data", -common.processSubscriptionRPC, { rpc_sub, appId_1, isExpectedSubscribeVDonHMI }) -for _, v in pairs(value) do - common.Step("OnVehicleData notification to App_1 with handsOffSteering=" .. tostring(v), - onVehicleDataForTwoApps, { v, expected, notExpected }) -end -common.Step("App_2 subscribes to handsOffSteering data", - common.processSubscriptionRPC, { rpc_sub, appId_2, isNotExpectedSubscribeVDonHMI }) -for _, v in pairs(value) do - common.Step("OnVehicleData notification tp both apps with handsOffSteering=" .. tostring(v), - onVehicleDataForTwoApps, { v, expected, expected }) -end - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua b/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua deleted file mode 100644 index 1fb6148db9..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua +++ /dev/null @@ -1,63 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL processes vehicle data RPCs with 'handsOffSteering' --- parameter if an app is registered with version greater than current parameter version --- --- Preconditions: --- 1) SDL and HMI are started --- 2) Vehicle data RPCs and handsOffSteering parameter are allowed by policies --- 3) handsOffSteering parameter has since = 7.0 --- 4) App is registered with syncMsgVersion = 8.0 --- --- In case: --- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) transfer this request to HMI --- 2) HMI sends VehicleInfo.GetVehicleData response with handsOffSteering data to SDL --- SDL does: --- - a) send GetVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App --- 3) App send valid SubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) transfer this request to HMI --- 4) HMI sends VehicleInfo.SubscribeVehicleData response with handsOffSteering data to SDL --- SDL does: --- - a) send SubscribeVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App --- 5) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL --- SDL does: --- - a) transfer this notification to App --- 6) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) transfer this request to HMI --- 7) HMI sends VehicleInfo.UnsubscribeVehicleData response with handsOffSteering data to SDL --- SDL does: --- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Test Configuration ]] -common.getAppParams().syncMsgVersion.majorVersion = 8 -common.getAppParams().syncMsgVersion.minorVersion = 0 - ---[[ Local Variables ]] -local rpc_sub = "SubscribeVehicleData" -local rpc_unsub = "UnsubscribeVehicleData" - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) - -common.Title("Test") -common.Step("RPC GetVehicleData with handsOffSteering parameter", common.getVehicleData) -common.Step("RPC " .. rpc_sub .. " with handsOffSteering parameter", common.processSubscriptionRPC, { rpc_sub }) -common.Step("Notification OnVehicleData with handsOffSteering parameter", common.sendOnVehicleData) -common.Step("RPC " .. rpc_unsub .. " on handsOffSteering parameter", common.processSubscriptionRPC, { rpc_unsub }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua b/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua deleted file mode 100644 index a2bd4c5d69..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua +++ /dev/null @@ -1,57 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL rejects vehicle data RPCs with 'handsOffSteering' --- parameter if an app registered with version less than current parameter version --- --- Preconditions: --- 1) SDL and HMI are started --- 2) Vehicle data RPCs and handsOffSteering parameter are allowed by policies --- 3) handsOffSteering parameter has since = 7.0 --- 4) App is registered with syncMsgVersion = 5.0 --- --- In case: --- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send GetVehicleData response with (success = false, resultCode = "INVALID_DATA") to App --- - b) not transfer this request to HMI --- 2) App send valid SubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send SubscribeVehicleData response with (success = false, resultCode = "INVALID_DATA") to App --- - b) not transfer this request to HMI --- 3) App send valid UnsubscribeVehicleData request to SDL --- SDL does: --- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "INVALID_DATA") to App --- - b) not transfer this request to HMI --- 4) HMI sends valid VehicleInfo.OnVehicleData notification with handsOffSteering data to SDL --- SDL does: --- - a) ignored this notification and not transfer it to App ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Test Configuration ]] -common.getAppParams().syncMsgVersion.majorVersion = 5 -common.getAppParams().syncMsgVersion.minorVersion = 0 - ---[[ Local Variables ]] -local rpc_get = "GetVehicleData" -local rpc_sub = "SubscribeVehicleData" -local rpc_unsub = "UnsubscribeVehicleData" -local result = "INVALID_DATA" -local notExpected = 0 - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) - -common.Title("Test") -common.Step("RPC GetVehicleData with handsOffSteering parameter", common.processRPCFailure, { rpc_get, result }) -common.Step("RPC " .. rpc_sub .. " with handsOffSteering parameter", common.processRPCFailure, { rpc_sub, result }) -common.Step("Notification OnVehicleData with handsOffSteering parameter", common.sendOnVehicleData, { notExpected }) -common.Step("RPC " .. rpc_unsub .. " with handsOffSteering parameter", common.processRPCFailure, { rpc_unsub, result }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/028_SubscribeVD_during_resumption_unexpected_disconnect.lua b/test_scripts/API/VehicleData/HandsOffSteering/028_SubscribeVD_during_resumption_unexpected_disconnect.lua deleted file mode 100644 index 62798a9e00..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/028_SubscribeVD_during_resumption_unexpected_disconnect.lua +++ /dev/null @@ -1,43 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL restores the subscription for 'handsOffSteering' data after unexpected disconnect --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPC SubscribeVehicleData and handsOffSteering are allowed by policies --- 3) App is registered and subscribed to handsOffSteering data --- 4) Unexpected disconnect and reconnect are performed --- --- In case: --- 1) App re-registers with actual HashId --- SDL does: --- - a) send VehicleInfo.SubscribeVehicleData(handsOffSteering=true) request to HMI during resumption --- - b) process successful response from HMI --- - c) restore subscription for handsOffSteering data --- - d) respond RAI(SUCCESS) to mobile app ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc = "SubscribeVehicleData" -local appId = 1 -local subscribeVDExpectedOnHMI = true - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc }) - -common.Title("Test") -common.Step("Unexpected disconnect", common.unexpectedDisconnect) -common.Step("Connect mobile", common.connectMobile) -common.Step("Re-register App resumption data", common.registerAppWithResumption, - { appId, subscribeVDExpectedOnHMI }) -common.Step("Check resumption of subscription using OnVehicleData notification", common.sendOnVehicleData) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua b/test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua deleted file mode 100644 index 5c86ca380e..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua +++ /dev/null @@ -1,44 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL restores the subscription to 'handsOffSteering' parameter after IGN_OFF/IGN_ON --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPC SubscribeVehicleData and handsOffSteering are allowed by policies --- 3) App is registered and subscribed to handsOffSteering data --- 4) IGN_OFF and IGN_ON are performed --- --- In case: --- 1) App re-registers with actual HashId --- SDL does: --- - a) send VehicleInfo.SubscribeVehicleData(handsOffSteering=true) request to HMI during resumption --- - b) process successful response from HMI --- - c) restore subscription for handsOffSteering data --- - d) respond RAI(SUCCESS) to mobile app ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc = "SubscribeVehicleData" -local appId = 1 -local subscribeVDExpectedOnHMI = true - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering data", common.processSubscriptionRPC, { rpc }) - -common.Title("Test") -common.Step("IGNITION_OFF", common.ignitionOff) -common.Step("IGNITION_ON", common.start) -common.Step("Re-register App resumption data", common.registerAppWithResumption, - { appId, subscribeVDExpectedOnHMI }) -common.Step("Check resumption of subscription using OnVehicleData notification", - common.sendOnVehicleData) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua b/test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua deleted file mode 100644 index 4d95913709..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua +++ /dev/null @@ -1,59 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL restores SubscribeVehicleData on 'handsOffSteering' parameter after unexpected disconnect --- for two apps --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPC SubscribeVehicleData and handsOffSteering are allowed by policies --- 3) App_1 and App_2 are registered and subscribed to handsOffSteering data --- 4) Unexpected disconnect and reconnect are performed --- --- In case: --- 1) App_1 re-registers with actual HashId --- SDL does: --- - a) send VehicleInfo.SubscribeVehicleData(handsOffSteering=true) request to HMI during resumption --- - b) process successful response from HMI --- - c) restore subscription for handsOffSteering data --- - d) respond RAI(SUCCESS) to mobile app --- 2) App_2 re-registers with actual HashId --- SDL does: --- - a) not send VehicleInfo.SubscribeVehicleData request to HMI during resumption --- - b) restore subscription for handsOffSteering data internally --- - c) respond RAI(SUCCESS) to mobile app ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc_sub = "SubscribeVehicleData" -local appId_1 = 1 -local appId_2 = 2 -local isExpectedSubscribeVDonHMI = true -local isNotExpectedSubscribeVDonHMI = false - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App_1", common.registerApp, { appId_1 }) -common.Step("App_1 subscribes to handsOffSteering data", - common.processSubscriptionRPC, { rpc_sub, appId_1, isExpectedSubscribeVDonHMI }) -common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) -common.Step("App_2 subscribes to handsOffSteering data", - common.processSubscriptionRPC, { rpc_sub, appId_2, isNotExpectedSubscribeVDonHMI }) - -common.Title("Test") -common.Step("Unexpected disconnect", common.unexpectedDisconnect) -common.Step("Connect mobile", common.connectMobile) -common.Step("Re-register App_1 with data resumption", - common.registerAppWithResumption, { appId_1, isExpectedSubscribeVDonHMI }) -common.Step("Check resumption data OnVehicleData notification", common.sendOnVehicleData) -common.Step("Re-register App_2 with data resumption", - common.registerAppWithResumption, { appId_2, isNotExpectedSubscribeVDonHMI }) -common.Step("Check resumption data OnVehicleData notification with handsOffSteering parameter for two Apps", - common.onVehicleDataTwoApps) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua b/test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua deleted file mode 100644 index 1374dd59e6..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua +++ /dev/null @@ -1,59 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL restores SubscribeVehicleData on 'handsOffSteering' parameter after IGN_OFF/IGN_ON cycle --- for two apps --- --- Preconditions: --- 1) SDL and HMI are started --- 2) RPC SubscribeVehicleData and handsOffSteering are allowed by policies --- 3) App_1 and App_2 are registered and subscribed to handsOffSteering data --- 4) IGN_OFF and IGN_ON are performed --- --- In case: --- 1) App_1 re-registers with actual HashId --- SDL does: --- - a) send VehicleInfo.SubscribeVehicleData(handsOffSteering=true) request to HMI during resumption --- - b) process successful response from HMI --- - c) restore subscription for handsOffSteering data --- - d) respond RAI(SUCCESS) to mobile app --- 2) App_2 re-registers with actual HashId --- SDL does: --- - a) not send VehicleInfo.SubscribeVehicleData request to HMI during resumption --- - b) restore subscription for handsOffSteering data internally --- - c) respond RAI(SUCCESS) to mobile app ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc_sub = "SubscribeVehicleData" -local appId_1 = 1 -local appId_2 = 2 -local isExpectedSubscribeVDonHMI = true -local isNotExpectedSubscribeVDonHMI = false - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App_1", common.registerApp, { appId_1 }) -common.Step("App_1 subscribes to handsOffSteering data", - common.processSubscriptionRPC, { rpc_sub, appId_1, isExpectedSubscribeVDonHMI }) -common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) -common.Step("App_2 subscribes to handsOffSteering data", - common.processSubscriptionRPC, { rpc_sub, appId_2, isNotExpectedSubscribeVDonHMI }) - -common.Title("Test") -common.Step("IGNITION_OFF", common.ignitionOff) -common.Step("IGNITION_ON", common.start) -common.Step("Re-register App_1 with data resumption", - common.registerAppWithResumption, { appId_1, isExpectedSubscribeVDonHMI }) -common.Step("Check resumption data OnVehicleData notification", common.sendOnVehicleData) -common.Step("Re-register App_2 with data resumption", - common.registerAppWithResumption, { appId_2, isNotExpectedSubscribeVDonHMI }) -common.Step("Check resumption data OnVehicleData notification with handsOffSteering parameter for two Apps", - common.onVehicleDataTwoApps) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/032_SubscribeVD_IGNORED_app_already_subscribed.lua b/test_scripts/API/VehicleData/HandsOffSteering/032_SubscribeVD_IGNORED_app_already_subscribed.lua deleted file mode 100644 index 6b6bf4c74a..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/032_SubscribeVD_IGNORED_app_already_subscribed.lua +++ /dev/null @@ -1,37 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL rejects SubscribeVehicleData request with resultCode "IGNORED" in case --- app is already subscribed to 'handsOffSteering' data --- --- Preconditions: --- 1) SDL and HMI are started --- 2) App is registered --- 3) App is subscribed to 'handsOffSteering' data --- --- In case: --- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send SubscribeVehicleData response with (success = false, resultCode = "IGNORED") to App --- - b) not transfer this request to HMI ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc = "SubscribeVehicleData" -local result = "IGNORED" - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering parameter", common.processSubscriptionRPC, { rpc }) - -common.Title("Test") -common.Step("RPC " .. rpc .. " with handsOffSteering parameter IGNORED", - common.processRPCFailure, { rpc, result }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/033_UnsubscribeVD_IGNORED_app_already_unsubscribed.lua b/test_scripts/API/VehicleData/HandsOffSteering/033_UnsubscribeVD_IGNORED_app_already_unsubscribed.lua deleted file mode 100644 index eeed2e936d..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/033_UnsubscribeVD_IGNORED_app_already_unsubscribed.lua +++ /dev/null @@ -1,40 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL rejects UnsubscribeVehicleData request with resultCode "IGNORED" in case --- app is already unsubscribed from 'handsOffSteering' data --- --- Preconditions: --- 1) SDL and HMI are started --- 2) App is registered --- 3) App is subscribed to 'handsOffSteering' data --- 4) App is unsubscribed from 'handsOffSteering' data --- --- In case: --- 1) App sends valid UnsubscribeVehicleData(handsOffSteering=true) request to SDL --- SDL does: --- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "IGNORED") to App --- - b) not transfer this request to HMI ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variables ]] -local rpc = "SubscribeVehicleData" -local unsub_rpc = "UnsubscribeVehicleData" -local result = "IGNORED" - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment and update preloaded_pt file", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("Register App", common.registerApp) -common.Step("App subscribes to handsOffSteering parameter", common.processSubscriptionRPC, { rpc }) -common.Step("App unsubscribes from handsOffSteering parameter", common.processSubscriptionRPC, { unsub_rpc }) - -common.Title("Test") -common.Step("RPC " .. unsub_rpc .. " with handsOffSteering parameter IGNORED", - common.processRPCFailure, { unsub_rpc, result }) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/common.lua b/test_scripts/API/VehicleData/HandsOffSteering/common.lua deleted file mode 100644 index 885a177359..0000000000 --- a/test_scripts/API/VehicleData/HandsOffSteering/common.lua +++ /dev/null @@ -1,280 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Common module ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.defaultProtocolVersion = 2 - ---[[ Required Shared libraries ]] -local actions = require("user_modules/sequences/actions") -local runner = require('user_modules/script_runner') -local utils = require("user_modules/utils") -local json = require("modules/json") -local SDL = require("SDL") - ---[[ General configuration parameters ]] -runner.testSettings.isSelfIncluded = false - ---[[ Local Variables ]] -local m = {} -local hashId = {} - -m.Title = runner.Title -m.Step = runner.Step -m.getPreloadedPT = actions.sdl.getPreloadedPT -m.setPreloadedPT = actions.sdl.setPreloadedPT -m.registerApp = actions.app.register -m.registerAppWOPTU = actions.app.registerNoPTU -m.activateApp = actions.app.activate -m.getMobileSession = actions.mobile.getSession -m.getHMIConnection = actions.hmi.getConnection -m.getAppParams = actions.app.getParams -m.cloneTable = utils.cloneTable -m.start = actions.start -m.postconditions = actions.postconditions -m.policyTableUpdate = actions.policyTableUpdate -m.getAppsCount = actions.mobile.getAppsCount -m.deleteSession = actions.mobile.deleteSession -m.connectMobile = actions.mobile.connect -m.wait = utils.wait -m.spairs = utils.spairs -m.cprint = utils.cprint - -local handsOffSteeringResponseData = { - dataType = "VEHICLEDATA_HANDSOFFSTEERING", - resultCode = "SUCCESS" -} - ---[[ Functions ]] ---[[ @updatePreloadedPT: Update preloaded file with additional permissions for handsOffSteering ---! @parameters: ---! pGroup: table with additional updates (optional) ---! @return: none ---]] -local function updatePreloadedPTFile(pGroup) - local pt = m.getPreloadedPT() - if not pGroup then - pGroup = { - rpcs = { - GetVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "handsOffSteering" } - }, - OnVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "handsOffSteering" } - }, - SubscribeVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "handsOffSteering" } - }, - UnsubscribeVehicleData = { - hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, - parameters = { "handsOffSteering" } - } - } - } - end - pt.policy_table.functional_groupings["HandsOffSteering"] = pGroup - pt.policy_table.app_policies["default"].groups = { "Base-4", "HandsOffSteering" } - pt.policy_table.functional_groupings["DataConsent-2"].rpcs = json.null - m.setPreloadedPT(pt) -end - ---[[ @preconditions: Clean environment, optional backup and update of sdl_preloaded_pt.json file - --! @parameters: - --! pGroup: data for updating sdl_preloaded_pt.json file - --! @return: none - --]] -function m.preconditions(pGroup) - actions.preconditions() - updatePreloadedPTFile(pGroup) -end - ---[[ @setHashId: Set hashId value which is required during resumption ---! @parameters: ---! pHashValue: application hashId ---! pAppId: application number (1, 2, etc.) ---! @return: none ---]] -function m.setHashId(pHashValue, pAppId) - hashId[pAppId] = pHashValue -end - ---[[ @getHashId: Get hashId value of an app which is required during resumption ---! @parameters: ---! pAppId: application number (1, 2, etc.) ---! @return: app's hashId ---]] -function m.getHashId(pAppId) - return hashId[pAppId] -end - ---[[ @getVehicleData: Successful processing of GetVehicleData RPC ---! @parameters: ---! pHandsOffSteeringHmiValue: value of the handsOffSteering parameter for HMI response ---! @return: none ---]] -function m.getVehicleData(pHandsOffSteeringHmiValue) - if pHandsOffSteeringHmiValue == nil then pHandsOffSteeringHmiValue = true end - local cid = m.getMobileSession():SendRPC("GetVehicleData", { handsOffSteering = true }) - m.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", { handsOffSteering = true }) - :Do(function(_, data) - m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { handsOffSteering = pHandsOffSteeringHmiValue }) - end) - m.getMobileSession():ExpectResponse(cid, - { success = true, resultCode = "SUCCESS", handsOffSteering = pHandsOffSteeringHmiValue }) -end - ---[[ @processRPCFailure: Processing VehicleData RPC with ERROR resultCode ---! @parameters: ---! pRPC: RPC for mobile request ---! pResult: Result code for mobile response ---! pRequestValue: handsOffSteering value for mobile request ---! @return: none ---]] -function m.processRPCFailure(pRPC, pResult, pRequestValue) - if pRequestValue == nil then pRequestValue = true end - local cid = m.getMobileSession():SendRPC(pRPC, { handsOffSteering = pRequestValue }) - m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC):Times(0) - m.getMobileSession():ExpectResponse(cid, { success = false, resultCode = pResult }) -end - ---[[ @processRPCgenericError: Processing VehicleData RPC with invalid HMI response ---! @parameters: ---! pRPC: RPC for mobile request ---! pData: data for HMI response ---! @return: none ---]] -function m.processRPCgenericError(pRPC, pData) - local cid = m.getMobileSession():SendRPC(pRPC, { handsOffSteering = true }) - m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC, { handsOffSteering = true }) - :Do(function(_,data) - m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { handsOffSteering = pData }) - end) - m.getMobileSession():ExpectResponse(cid, { success = false, resultCode = "GENERIC_ERROR" }) -end - ---[[ @subUnsubScribeVD: Processing SubscribeVehicleData and UnsubscribeVehicleData RPCs ---! @parameters: ---! pRPC: RPC for mobile request ---! pAppId: application number (1, 2, etc.) ---! isRequestOnHMIExpected: true or omitted - in case VehicleInfo.Sub/UnsubscribeVehicleData_request on HMI is expected, ---! otherwise - false ---! @return: none ---]] -function m.processSubscriptionRPC(pRPC, pAppId, isRequestOnHMIExpected) - if not pAppId then pAppId = 1 end - local cid = m.getMobileSession(pAppId):SendRPC(pRPC, { handsOffSteering = true }) - if isRequestOnHMIExpected == nil or isRequestOnHMIExpected == true then - m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC, { handsOffSteering = true }) - :Do(function(_,data) - m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", - { handsOffSteering = handsOffSteeringResponseData }) - end) - else - m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC):Times(0) - end - m.getMobileSession(pAppId):ExpectResponse(cid, - { success = true, resultCode = "SUCCESS", handsOffSteering = handsOffSteeringResponseData }) - m.getMobileSession(pAppId):ExpectNotification("OnHashChange") - :Do(function(_, data) - m.setHashId(data.payload.hashID, pAppId) - end) -end - ---[[ @sendOnVehicleData: Processing OnVehicleData RPC ---! @parameters: ---! pData: data for the notification ---! pExpTime: number of notifications ---! @return: none ---]] -function m.sendOnVehicleData(pExpTime, pData) - if not pExpTime then pExpTime = 1 end - if pData == nil then pData = true end - m.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", { handsOffSteering = pData }) - m.getMobileSession():ExpectNotification("OnVehicleData", { handsOffSteering = pData }) - :Times(pExpTime) -end - ---[[ @onVehicleDataTwoApps: Processing OnVehicleData RPC for two apps ---! @parameters: ---! pExpTimes: number of notifications for 2 apps ---! @return: none ---]] -function m.onVehicleDataTwoApps(pExpTimes) - if pExpTimes == nil then pExpTimes = 1 end - m.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", { handsOffSteering = true }) - m.getMobileSession(1):ExpectNotification("OnVehicleData", { handsOffSteering = true }) - :Times(pExpTimes) - m.getMobileSession(2):ExpectNotification("OnVehicleData", { handsOffSteering = true }) - :Times(pExpTimes) -end - ---[[ @ignitionOff: IGNITION_OFF sequence ---! @parameters: none ---! @return: none ---]] -function m.ignitionOff() - local isOnSDLCloseSent = false - m.getHMIConnection():SendNotification("BasicCommunication.OnExitAllApplications", { reason = "SUSPEND" }) - m.getHMIConnection():ExpectNotification("BasicCommunication.OnSDLPersistenceComplete") - :Do(function() - m.getHMIConnection():SendNotification("BasicCommunication.OnExitAllApplications", { reason = "IGNITION_OFF" }) - m.getHMIConnection():ExpectNotification("BasicCommunication.OnSDLClose") - :Do(function() - isOnSDLCloseSent = true - SDL.DeleteFile() - end) - end) - m.wait(3000) - :Do(function() - if isOnSDLCloseSent == false then m.cprint(35, "BC.OnSDLClose was not sent") end - StopSDL() - end) -end - ---[[ @unexpectedDisconnect: closing connection ---! @parameters: none ---! @return: none ---]] -function m.unexpectedDisconnect() - m.getHMIConnection():ExpectNotification("BasicCommunication.OnAppUnregistered", { unexpectedDisconnect = true }) - :Times(m.getAppsCount()) - actions.mobile.disconnect() - m.wait(1000) -end - ---[[ @registerAppWithResumption: Successful application registration with custom expectations for resumption ---! @parameters: ---! pAppId - application number (1, 2, etc.) ---! isHMISubscription: if true VD.SubscribeVehicleData request is expected on HMI, otherwise - not expected ---! @return: none ---]] -function m.registerAppWithResumption(pAppId, isHMISubscription) - if not pAppId then pAppId = 1 end - local session = actions.mobile.createSession(pAppId) - session:StartService(7) - :Do(function() - m.getAppParams(pAppId).hashID = m.getHashId(pAppId) - local corId = session:SendRPC("RegisterAppInterface", m.getAppParams(pAppId)) - m.getHMIConnection():ExpectNotification("BasicCommunication.OnAppRegistered", { - application = { appName = m.getAppParams(pAppId).appName } - }) - if isHMISubscription == true then - m.getHMIConnection():ExpectRequest( "VehicleInfo.SubscribeVehicleData", { handsOffSteering = true }) - :Do(function(_, data) - m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", - { handsOffSteering = handsOffSteeringResponseData }) - end) - else - m.getHMIConnection():ExpectRequest("VehicleInfo.SubscribeVehicleData"):Times(0) - end - session:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) - :Do(function() - session:ExpectNotification("OnPermissionsChange") - end) - end) -end - -return m diff --git a/test_scripts/API/VehicleData/OnVehicleData/001_OnVD_Success.lua b/test_scripts/API/VehicleData/OnVehicleData/001_OnVD_Success.lua new file mode 100644 index 0000000000..b0a26b4c34 --- /dev/null +++ b/test_scripts/API/VehicleData/OnVehicleData/001_OnVD_Success.lua @@ -0,0 +1,41 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL processes OnVehicleData notification with parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData, OnVehicleData RPCs and parameter are allowed by policies +-- 3) App is registered +-- 4) App is subscribed to parameter data +-- +-- In case: +-- 1) HMI sends valid OnVehicleData notification with parameter data to SDL +-- SDL does: +-- - a) transfer this notification to App +-- Exception: Notification for unsubscribable VD parameter is not transfered +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local isExpected = 1 +local isNotExpected = 0 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub, common.processSubscriptionRPC, { common.rpc.sub, param }) + common.Step("RPC " .. common.rpc.on, common.sendOnVehicleData, { param, isExpected }) +end +for param in common.spairs(common.getVDParams(false)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.on, common.sendOnVehicleData, { param, isNotExpected }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/OnVehicleData/001_Success_flow.lua b/test_scripts/API/VehicleData/OnVehicleData/001_Success_flow.lua deleted file mode 100644 index f031fb8a58..0000000000 --- a/test_scripts/API/VehicleData/OnVehicleData/001_Success_flow.lua +++ /dev/null @@ -1,44 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case 1: TO ADD!!! --- --- Requirement summary: --- [OnVehicleData] As a mobile app is subscribed for VI parameter --- and received notification about this parameter change from hmi --- --- Description: --- In case: --- 1) If application is subscribed to get vehicle data with 'engineOilLife' parameter --- 2) Notification about changes in subscribed parameter is received from hmi --- SDL must: --- Forward this notification to mobile application ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc = "SubscribeVehicleData" --- removed because vin parameter is not applicable for SubscribeVehicleData -common.allVehicleData.vin = nil - ---[[ Scenario ]] -runner.Title("Preconditions") -runner.Step("Clean environment", common.preconditions) -runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -runner.Step("Activate App", common.activateApp) - -runner.Title("Test") -for vehicleDataName in pairs(common.allVehicleData) do - runner.Step("RPC " .. rpc .. " " .. vehicleDataName, common.processRPCSubscriptionSuccess, - {rpc, vehicleDataName }) - runner.Step("RPC OnVehicleData " .. vehicleDataName, common.checkNotificationSuccess, - { vehicleDataName }) -end - -runner.Title("Postconditions") -runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/OnVehicleData/002_NotificationForUnsubsribedParameter_Ignored_flow.lua b/test_scripts/API/VehicleData/OnVehicleData/002_NotificationForUnsubsribedParameter_Ignored_flow.lua deleted file mode 100644 index b320fd41b5..0000000000 --- a/test_scripts/API/VehicleData/OnVehicleData/002_NotificationForUnsubsribedParameter_Ignored_flow.lua +++ /dev/null @@ -1,50 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case 1: Main Flow --- Item: Use Case: request is allowed by Policies --- --- Requirement summary: --- [OnVehicleData] As a hmi sends notification about VI parameter change --- but mobile app is not subscribed for this parameter --- --- Description: --- In case: --- 1) Hmi sends valid OnVehicleData notification to SDL --- but mobile app is not subscribed for this parameter --- SDL must: --- Ignore this request and do not forward it to mobile app ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc1 = "SubscribeVehicleData" -local rpc2 = "UnsubscribeVehicleData" --- removed because vin parameter is not applicable for SubscribeVehicleData -common.allVehicleData.vin = nil - ---[[ Scenario ]] -runner.Title("Preconditions") -runner.Step("Clean environment", common.preconditions) -runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -runner.Step("Activate App", common.activateApp) - -runner.Title("Test") -for vehicleDataName in pairs(common.allVehicleData) do - runner.Step("RPC " .. rpc1 .. " " .. vehicleDataName, common.processRPCSubscriptionSuccess, - {rpc1, vehicleDataName }) - runner.Step("RPC OnVehicleData " .. vehicleDataName .. " forwarded to mobile", common.checkNotificationSuccess, - { vehicleDataName }) - runner.Step("RPC " .. rpc2 .. " " .. vehicleDataName, common.processRPCSubscriptionSuccess, - {rpc2, vehicleDataName }) - runner.Step("RPC OnVehicleData " .. vehicleDataName .. " not forwarded to mobile", common.checkNotificationIgnored, - { vehicleDataName }) -end - -runner.Title("Postconditions") -runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/OnVehicleData/002_OnVD_disallowed.lua b/test_scripts/API/VehicleData/OnVehicleData/002_OnVD_disallowed.lua new file mode 100644 index 0000000000..eeb78c58dd --- /dev/null +++ b/test_scripts/API/VehicleData/OnVehicleData/002_OnVD_disallowed.lua @@ -0,0 +1,58 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL doesn't transfer OnVehicleData notification to App +-- if parameter is not allowed by policy +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) is not allowed by policies for OnVehicleData RPC +-- 3) App is registered +-- 4) App is subscribed to parameter +-- +-- In case: +-- 1) HMI sends valid OnVehicleData notification with parameter data to SDL +-- SDL does: +-- - a) ignore this notification and not transfer it to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local isNotExpected = 0 + +--[[ Local Functions ]] +local function getVDGroup(pDisallowedParam) + local all_params = {} + local params = {} + for param in pairs(common.getVDParams(true)) do + if param ~= pDisallowedParam then table.insert(params, param) end + table.insert(all_params, param) + end + return { + rpcs = { + [common.rpc.sub] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = all_params + }, + [common.rpc.on] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = params + } + } + } +end + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions, { getVDGroup(param) }) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App", common.registerApp) + + common.Title("Test") + common.Step("RPC " .. common.rpc.sub .. " SUCCESS", common.processSubscriptionRPC, { common.rpc.sub, param }) + common.Step("RPC " .. common.rpc.on .. " ignored", common.sendOnVehicleData, { param, isNotExpected }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/OnVehicleData/003_NotificationParameterDisallowedByPolicies_Ignored_flow.lua b/test_scripts/API/VehicleData/OnVehicleData/003_NotificationParameterDisallowedByPolicies_Ignored_flow.lua deleted file mode 100644 index 1fd0714310..0000000000 --- a/test_scripts/API/VehicleData/OnVehicleData/003_NotificationParameterDisallowedByPolicies_Ignored_flow.lua +++ /dev/null @@ -1,63 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case 1: TO ADD!!! --- --- Requirement summary: --- [OnVehicleData] As a mobile app is subscribed for VI parameter --- and received notification about this parameter change from hmi --- --- Description: --- In case: --- 1) If application is subscribed to get vehicle data with 'engineOilLife' parameter --- 2) Parameter is disallowed by Policies in this notification --- 3) Notification about changes in subscribed parameter is received from hmi --- SDL must: --- Ignore this notification and not send to mobile application ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc = "SubscribeVehicleData" --- removed because vin parameter is not applicable for SubscribeVehicleData -common.allVehicleData.vin = nil - ---[[ Local Functions ]] -local function ptUpdate(pTbl) - common.ptUpdate(pTbl) - local NewTestGroup = common.cloneTable(pTbl.policy_table.functional_groupings["Emergency-1"]) - for vehicleDataName in pairs(NewTestGroup.rpcs) do - NewTestGroup.rpcs[vehicleDataName].parameters = common.EMPTY_ARRAY - end - pTbl.policy_table.functional_groupings.NewTestGroup = NewTestGroup - pTbl.policy_table.app_policies[common.getConfigAppParams(1).fullAppID].groups = { "Base-4", "Emergency-1" } - pTbl.policy_table.app_policies[common.getConfigAppParams(2).fullAppID].groups = { "Base-4", "NewTestGroup" } -end - -local function checkNotification2apps(pData) - local hmiNotParams = { [pData] = common.allVehicleData[pData].value } - local mobNotParams = common.cloneTable(hmiNotParams) - common.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", hmiNotParams) - common.getMobileSession(1):ExpectNotification("OnVehicleData", mobNotParams) - common.getMobileSession(2):ExpectNotification("OnVehicleData"):Times(0) -end - ---[[ Scenario ]] -runner.Title("Preconditions") -runner.Step("Clean environment", common.preconditions) -runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI 1", common.registerApp, { 1 }) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -runner.Step("RAI 2", common.registerApp, { 2 }) -common.Step("PTU", common.policyTableUpdate, { ptUpdate }) -runner.Step("Activate App1", common.activateApp, { 1 }) -runner.Step("Activate App2", common.activateApp, { 2 }) - -runner.Title("Test") -for vehicleDataName in pairs(common.allVehicleData) do - runner.Step("RPC " .. rpc .. " " .. vehicleDataName, common.processRPCSubscriptionSuccess, { rpc, vehicleDataName }) - runner.Step("RPC OnVehicleData " .. vehicleDataName, checkNotification2apps, { vehicleDataName }) -end diff --git a/test_scripts/API/VehicleData/OnVehicleData/003_OnVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/OnVehicleData/003_OnVD_disallowed_after_PTU.lua new file mode 100644 index 0000000000..d7d1635162 --- /dev/null +++ b/test_scripts/API/VehicleData/OnVehicleData/003_OnVD_disallowed_after_PTU.lua @@ -0,0 +1,72 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL doesn't transfer OnVehicleData notification to App +-- if parameter is not allowed by policy after PTU +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData, OnVehicleData RPCs and parameter are allowed by policies +-- 3) App is registered and subscribed to parameter +-- +-- In case: +-- 1) HMI sends OnVehicleData notification with parameter data to SDL +-- SDL does: +-- - a) transfer this notification to App +-- 2) PTU is performed with disabling permissions for parameter +-- 3) HMI sends OnVehicleData notification with parameter data to SDL +-- SDL does: +-- - a) ignore this notification and not transfer it to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local isExpected = 1 +local isNotExpected = 0 + +--[[ Local Functions ]] +local function getVDGroup(pDisallowedParam) + local all_params = {} + local params = {} + for param in pairs(common.getVDParams(true)) do + if param ~= pDisallowedParam then table.insert(params, param) end + table.insert(all_params, param) + end + return { + rpcs = { + [common.rpc.sub] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = all_params + }, + [common.rpc.on] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = params + } + } + } +end + +local function policyTableUpdate(pDisallowedParam) + local function ptUpdate(pt) + pt.policy_table.functional_groupings["NewTestCaseGroup"] = getVDGroup(pDisallowedParam) + pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } + end + common.policyTableUpdate(ptUpdate) +end + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions, { getVDGroup(param) }) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App", common.registerApp) + common.Step("RPC " .. common.rpc.sub .. " SUCCESS", common.processSubscriptionRPC, { common.rpc.sub, param }) + common.Step("RPC " .. common.rpc.on .. " transferred", common.sendOnVehicleData, { param, isExpected }) + + common.Title("Test") + common.Step("PTU with disabling permissions for VD parameter", policyTableUpdate, { param }) + common.Step("RPC " .. common.rpc.on .. " ignored", common.sendOnVehicleData, { param, isNotExpected }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/OnVehicleData/004_OnVD_gps_mandatory_parameters.lua b/test_scripts/API/VehicleData/OnVehicleData/004_OnVD_gps_mandatory_parameters.lua deleted file mode 100644 index 238720d7d9..0000000000 --- a/test_scripts/API/VehicleData/OnVehicleData/004_OnVD_gps_mandatory_parameters.lua +++ /dev/null @@ -1,113 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case 1: TO ADD!!! --- --- Requirement summary: --- [OnVehicleData] As a mobile app is subscribed for VI parameter --- and received notification about this parameter change from hmi --- --- Description: --- In case: --- 1) If application is subscribed to get vehicle data with 'gps' parameter --- 2) Notification about changes with mandatory parameters is received from hmi --- 3) Notification about changes without mandatory parameters is received from hmi --- SDL must: --- 1) Forward this notification to mobile application --- 2) Not forward this notification to mobile application ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc1 = { - name = "SubscribeVehicleData", - params = { - gps = true - } -} - -local vehicleDataResults = { - gps = { - dataType = "VEHICLEDATA_GPS", - resultCode = "SUCCESS" - } -} - -local vehicleDataValues = { - allData = { - longitudeDegrees = 10, - latitudeDegrees = 20, - utcYear = 2010, - utcMonth = 1, - utcDay = 2, - utcHours = 3, - utcMinutes = 4, - utcSeconds = 5, - compassDirection = "NORTH", - actual = true, - satellites = 6, - dimension = "2D", - altitude = 7, - heading = 8, - speed = 9, - pdop = 10, - hdop = 11, - vdop = 12 - }, - mandatoryOnly = { - longitudeDegrees = 10, - latitudeDegrees = 20 - } -} - -local vehicleDataValuesMissedMandatory = { - missedAll = { utcYear = 2010 }, - missedLongitude = { latitudeDegrees = 20 }, - missedLatitude = { longitudeDegrees = 10 } -} - ---[[ Local Functions ]] -local function processRPCSubscribeSuccess() - local cid = common.getMobileSession():SendRPC(rpc1.name, rpc1.params) - common.getHMIConnection():ExpectRequest("VehicleInfo." .. rpc1.name, rpc1.params) - :Do(function(_, data) - common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", vehicleDataResults) - end) - - local responseParams = vehicleDataResults - responseParams.success = true - responseParams.resultCode = "SUCCESS" - common.getMobileSession():ExpectResponse(cid, responseParams) -end - -local function checkNotification(pParams, isNotificationExpect) - common.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", { gps = pParams }) - if isNotificationExpect == true then - common.getMobileSession():ExpectNotification("OnVehicleData", { gps = pParams }) - else - common.getMobileSession():ExpectNotification("OnVehicleData") - :Times(0) - 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("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -common.Step("Activate App", common.activateApp) -common.Step("SubscribeVehicleData gps", processRPCSubscribeSuccess) - -common.Title("Test") -for key, value in pairs(vehicleDataValues) do - common.Step("RPC OnVehicleData gps " .. key, checkNotification, { value, true }) -end -for key, value in pairs(vehicleDataValuesMissedMandatory) do - common.Step("RPC OnVehicleData gps " .. key, checkNotification, { value, false }) -end - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/OnVehicleData/004_OnVD_with_invalid_data.lua b/test_scripts/API/VehicleData/OnVehicleData/004_OnVD_with_invalid_data.lua new file mode 100644 index 0000000000..fb6e10639e --- /dev/null +++ b/test_scripts/API/VehicleData/OnVehicleData/004_OnVD_with_invalid_data.lua @@ -0,0 +1,43 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL doesn't transfer OnVehicleData notification to App +-- if HMI sends notification with invalid data for parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) OnVehicleData, SubscribeVehicleData RPCs and parameter are allowed by policies +-- 3) App is registered +-- 4) App is subscribed to parameter +-- +-- In case: +-- 1) HMI sends OnVehicleData notification with invalid data for parameter to SDL +-- SDL does: +-- - a) ignore this notification and not transfer to App +-- Addition: Notification for unsubscribable VD parameter is not transfered as well +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local isNotExpected = 0 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for param, value in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub, common.processSubscriptionRPC, { common.rpc.sub, param }) + common.Step("RPC " .. common.rpc.on, common.sendOnVehicleData, + { param, isNotExpected, common.getInvalidData(value) }) +end +for param, value in common.spairs(common.getVDParams(false)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.on, common.sendOnVehicleData, + { param, isNotExpected, common.getInvalidData(value) }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/OnVehicleData/005_OnVD_App_is_not_subscribed.lua b/test_scripts/API/VehicleData/OnVehicleData/005_OnVD_App_is_not_subscribed.lua new file mode 100644 index 0000000000..dd141bacd0 --- /dev/null +++ b/test_scripts/API/VehicleData/OnVehicleData/005_OnVD_App_is_not_subscribed.lua @@ -0,0 +1,49 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL doesn't transfer OnVehicleData notification with parameter to App +-- if an app is not subscribed to this parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData, UnsubscribeVehicleData, OnVehicleData RPCs and +-- parameter are allowed by policies +-- 3) App is registered +-- 4) App is subscribed to parameter +-- +-- In case: +-- 1) HMI sends valid OnVehicleData notification with parameter data to SDL +-- SDL does: +-- - a) transfer this notification to App +-- 2) App unsubscribes from parameter +-- 3) HMI sends valid OnVehicleData notification with parameter data to SDL +-- SDL does: +-- - a) not transfer this notification to App +-- Exception: Notification for unsubscribable VD parameter is not transfered +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local isExpected = 1 +local isNotExpected = 0 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub, common.processSubscriptionRPC, { common.rpc.sub, param }) + common.Step("RPC " .. common.rpc.on, common.sendOnVehicleData, { param, isExpected }) + common.Step("RPC " .. common.rpc.unsub, common.processSubscriptionRPC, { common.rpc.unsub, param }) + common.Step("RPC " .. common.rpc.on, common.sendOnVehicleData, { param, isNotExpected }) +end +for param in common.spairs(common.getVDParams(false)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.on, common.sendOnVehicleData, { param, isNotExpected }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/OnVehicleData/006_OnVD_mandatory_parameters.lua b/test_scripts/API/VehicleData/OnVehicleData/006_OnVD_mandatory_parameters.lua new file mode 100644 index 0000000000..8be87c2b04 --- /dev/null +++ b/test_scripts/API/VehicleData/OnVehicleData/006_OnVD_mandatory_parameters.lua @@ -0,0 +1,54 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL processes OnVehicleData notification with parameter +-- with only mandatory sub-parameters +-- or with missing at least one mandatory sub-parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData, OnVehicleData RPCs and parameter are allowed by policies +-- 3) App is registered +-- 4) App is subscribed to parameter data +-- +-- In case: +-- 1) HMI sends valid OnVehicleData notification with parameter data to SDL +-- with only mandatory sub-parameters +-- SDL does: +-- - a) transfer this notification to App +-- 2) HMI sends OnVehicleData notification with parameter data to SDL +-- without at least one mandatory sub-parameter +-- SDL does: +-- - a) not transfer this notification to App +-- 4) HMI sends OnVehicleData notification with parameter data to SDL +-- with missing mandatory sub-parameter +-- SDL does: +-- - a) ignore this notification and not transfer to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local isExpected = 1 +local isNotExpected = 0 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("RAI", common.registerApp) + +common.Title("Test") +for param in pairs(common.mandatoryVD) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub .. " SUCCESS", common.processSubscriptionRPC, { common.rpc.sub, param }) + for caseName, value in pairs(common.getMandatoryOnlyCases(param)) do + common.Step("RPC " .. common.rpc.on .. " with " .. caseName .. " Transfered", common.sendOnVehicleData, + { param, isExpected, value }) + end + for caseName, value in pairs(common.getMandatoryMissingCases(param)) do + common.Step("RPC " .. common.rpc.on .. " with " .. caseName .. " Ignored", common.sendOnVehicleData, + { param, isNotExpected, value }) + end +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/006_SubscribeVD_Success.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/001_SubscribeVD_Success.lua similarity index 50% rename from test_scripts/API/VehicleData/HandsOffSteering/006_SubscribeVD_Success.lua rename to test_scripts/API/VehicleData/SubscribeVehicleData/001_SubscribeVD_Success.lua index aa8cc5bb00..fcc2fdef1e 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/006_SubscribeVD_Success.lua +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/001_SubscribeVD_Success.lua @@ -1,27 +1,23 @@ --------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL processes SubscribeVehicleData RPC with 'handsOffSteering' parameter +-- Description: Check that SDL processes SubscribeVehicleData RPC with parameter -- -- Preconditions: -- 1) SDL and HMI are started --- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 2) SubscribeVehicleData RPC and parameter are allowed by policies -- 3) App is registered -- -- In case: --- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- 1) App sends valid SubscribeVehicleData(=true) request to SDL -- SDL does: -- - a) transfer this request to HMI --- 2) HMI sends VehicleInfo.SubscribeVehicleData response with handsOffSteering data to SDL +-- 2) HMI sends SubscribeVehicleData response with data to SDL -- SDL does: -- - a) send SubscribeVehicleData response with (success = true, resultCode = "SUCCESS", --- handsOffSteering = ) to App +-- = ) to App +-- Exception: SDL does respond with "INVALID_DATA" in case app tries to subscribe for unsubscribable VD parameter --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') - ---[[ Local Variable ]] -local rpc = "SubscribeVehicleData" +local common = require('test_scripts/API/VehicleData/common') --[[ Scenario ]] common.Title("Preconditions") @@ -30,7 +26,14 @@ common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) common.Step("Register App", common.registerApp) common.Title("Test") -common.Step("RPC " .. rpc .. " with handsOffSteering parameter", common.processSubscriptionRPC, { rpc }) +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub, common.processSubscriptionRPC, { common.rpc.sub, param }) +end +for param in common.spairs(common.getVDParams(false)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub, common.processRPCFailure, { common.rpc.sub, param, "INVALID_DATA" }) +end common.Title("Postconditions") common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/001_Success_flow.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/001_Success_flow.lua deleted file mode 100644 index 82c91e95e5..0000000000 --- a/test_scripts/API/VehicleData/SubscribeVehicleData/001_Success_flow.lua +++ /dev/null @@ -1,41 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case: request is allowed by Policies --- --- Requirement summary: --- [SubscribeVehicleData] As a mobile app wants to send a request to subscribe for specified parameter --- --- Description: --- In case: --- 1) mobile application sends valid SubscribeVehicleData to SDL and this request is allowed by Policies --- SDL must: --- Transfer this request to HMI and after successful response from hmi --- Respond SUCCESS, success:true to mobile application ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc = "SubscribeVehicleData" --- removed because vin parameter is not applicable for SubscribeVehicleData -common.allVehicleData.vin = nil - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -common.Step("Activate App", common.activateApp) - -common.Title("Test") -for vehicleDataName in pairs(common.allVehicleData) do - runner.Step("RPC " .. rpc .. " " .. vehicleDataName, common.processRPCSubscriptionSuccess, - {rpc, vehicleDataName }) -end - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua deleted file mode 100644 index 0132fafc31..0000000000 --- a/test_scripts/API/VehicleData/SubscribeVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua +++ /dev/null @@ -1,78 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case: request is allowed but parameter of this request is NOT allowed by Policies --- --- Requirement summary: --- [SubscribeVehicleData] As a mobile app wants to send a request to get the details of the vehicle data --- --- Description: --- In case: --- Mobile application sends valid SubscribeVehicleData to SDL and this request is --- allowed by Policies but RPC parameter is not allowed --- SDL must: --- Respond DISALLOWED, success:false to mobile application and not transfer this request to HMI ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc = { - name = "SubscribeVehicleData", - params = { - engineOilLife = true, - fuelRange = true, - tirePressure = true, - electronicParkBrakeStatus = true, - turnSignal = true - - } -} - -local vehicleDataResults = { - engineOilLife = { - dataType = "VEHICLEDATA_ENGINEOILLIFE", - resultCode = "DISALLOWED" - }, - fuelRange = { - dataType = "VEHICLEDATA_FUELRANGE", - resultCode = "DISALLOWED" - }, - tirePressure = { - dataType = "VEHICLEDATA_TIREPRESSURE", - resultCode = "DISALLOWED" - }, - electronicParkBrakeStatus = { - dataType = "VEHICLEDATA_ELECTRONICPARKBRAKESTATUS", - resultCode = "DISALLOWED" - }, - turnSignal = { - dataType = "VEHICLEDATA_TURNSIGNAL", - resultCode = "DISALLOWED" - } -} - ---[[ Local Functions ]] -local function processRPCFailure() - local cid = common.getMobileSession():SendRPC(rpc.name, rpc.params) - common.getHMIConnection():ExpectRequest("VehicleInfo." .. rpc.name, rpc.params):Times(0) - local responseParams = vehicleDataResults - responseParams.success = false - responseParams.resultCode = "DISALLOWED" - common.getMobileSession():ExpectResponse(cid, responseParams) -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdateMin }) -common.Step("Activate App", common.activateApp) - -common.Title("Test") -common.Step("RPC " .. rpc.name , processRPCFailure) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/002_SubscribeVD_disallowed.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/002_SubscribeVD_disallowed.lua new file mode 100644 index 0000000000..9ea599a173 --- /dev/null +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/002_SubscribeVD_disallowed.lua @@ -0,0 +1,51 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL rejects SubscribeVehicleData request with resultCode "DISALLOWED" +-- if parameter is not allowed by policy +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) parameter is not allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid SubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local result = "DISALLOWED" + +--[[ Local Functions ]] +local function getVDGroup(pDisallowedParam) + local params = {} + for param in pairs(common.getVDParams(true)) do + if param ~= pDisallowedParam then table.insert(params, param) end + end + return { + rpcs = { + [common.rpc.sub] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = params + } + } + } +end + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions, { getVDGroup(param) }) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App", common.registerApp) + + common.Title("Test") + common.Step("RPC " .. common.rpc.sub .. " DISALLOWED", common.processRPCFailure, { common.rpc.sub, param, result }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/003_RPC_parameter_already_subscribed_Result_IGNORED_flow.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/003_RPC_parameter_already_subscribed_Result_IGNORED_flow.lua deleted file mode 100644 index 45c7af3af1..0000000000 --- a/test_scripts/API/VehicleData/SubscribeVehicleData/003_RPC_parameter_already_subscribed_Result_IGNORED_flow.lua +++ /dev/null @@ -1,113 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Item: Use Case: request is allowed by policies but app is already subscribed for specified parameter --- --- Requirement summary: --- [SubscribeVehicleData] As a mobile app wants to send a request to subscribe for specified parameter --- --- Description: --- In case: --- Mobile application sends valid SubscribeVehicleData to SDL and this request --- is allowed by Policies but app is already subscribed for specified parameter --- SDL must: --- SDL responds IGNORED, success:false and info: "Already subscribed on some provided VehicleData." --- to mobile application and doesn't transfer this request to HMI ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc = { - name = "SubscribeVehicleData", - params = { - engineOilLife = true, - fuelRange = true, - tirePressure = true, - electronicParkBrakeStatus = true, - turnSignal = true - } -} - -local vehicleDataResults = { - engineOilLife = { - dataType = "VEHICLEDATA_ENGINEOILLIFE", - resultCode = "SUCCESS" - }, - fuelRange = { - dataType = "VEHICLEDATA_FUELRANGE", - resultCode = "SUCCESS" - }, - tirePressure = { - dataType = "VEHICLEDATA_TIREPRESSURE", - resultCode = "SUCCESS" - }, - electronicParkBrakeStatus = { - dataType = "VEHICLEDATA_ELECTRONICPARKBRAKESTATUS", - resultCode = "SUCCESS" - }, - turnSignal = { - dataType = "VEHICLEDATA_TURNSIGNAL", - resultCode = "SUCCESS" - } -} - -local vehicleDataResults2 = { - engineOilLife = { - dataType = "VEHICLEDATA_ENGINEOILLIFE", - resultCode = "DATA_ALREADY_SUBSCRIBED" - }, - fuelRange = { - dataType = "VEHICLEDATA_FUELRANGE", - resultCode = "DATA_ALREADY_SUBSCRIBED" - }, - tirePressure = { - dataType = "VEHICLEDATA_TIREPRESSURE", - resultCode = "DATA_ALREADY_SUBSCRIBED" - }, - turnSignal = { - dataType = "VEHICLEDATA_TURNSIGNAL", - resultCode = "DATA_ALREADY_SUBSCRIBED" - }, - electronicParkBrakeStatus = { - dataType = "VEHICLEDATA_ELECTRONICPARKBRAKESTATUS", - resultCode = "DATA_ALREADY_SUBSCRIBED" - } -} - ---[[ Local Functions ]] -local function processRPCSuccess() - local cid = common.getMobileSession():SendRPC(rpc.name, rpc.params) - common.getHMIConnection():ExpectRequest("VehicleInfo." .. rpc.name, rpc.params) - :Do(function(_, data) - common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", - vehicleDataResults) - end) - local responseParams = vehicleDataResults - responseParams.success = true - responseParams.resultCode = "SUCCESS" - common.getMobileSession():ExpectResponse(cid, responseParams) -end - -local function processRPCIgnored() - local cid = common.getMobileSession():SendRPC(rpc.name, rpc.params) - common.getHMIConnection():ExpectRequest("VehicleInfo." .. rpc.name, rpc.params):Times(0) - local responseParams = vehicleDataResults2 - responseParams.success = false - responseParams.resultCode = "IGNORED" - common.getMobileSession():ExpectResponse(cid, responseParams) -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -common.Step("Activate App", common.activateApp) - -common.Title("Test") -common.Step("RPC " .. rpc.name .. " 1st time" , processRPCSuccess) -common.Step("RPC " .. rpc.name .. " 2nd time" , processRPCIgnored) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/003_SubscribeVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/003_SubscribeVD_disallowed_after_PTU.lua new file mode 100644 index 0000000000..c08b91a799 --- /dev/null +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/003_SubscribeVD_disallowed_after_PTU.lua @@ -0,0 +1,69 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL rejects SubscribeVehicleData request with resultCode "DISALLOWED" +-- if parameter is not allowed by policy after PTU +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData RPC and parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid SubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends SubscribeVehicleData response with data to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = true, resultCode = SUCCESS", +-- = ) to App +-- 3) PTU is performed with disabling permissions for parameter +-- 4) App sends valid SubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local result = "DISALLOWED" + +--[[ Local Function ]] +local function getVDGroup(pDisallowedParam) + local params = {} + for param in pairs(common.getVDParams(true)) do + if param ~= pDisallowedParam then table.insert(params, param) end + end + return { + rpcs = { + [common.rpc.sub] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = params + } + } + } +end + +local function policyTableUpdate(pDisallowedParam) + local function ptUpdate(pt) + pt.policy_table.functional_groupings["NewTestCaseGroup"] = getVDGroup(pDisallowedParam) + pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } + end + common.policyTableUpdate(ptUpdate) +end + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App", common.registerApp) + common.Step("RPC " .. common.rpc.sub, common.processSubscriptionRPC, { common.rpc.sub, param }) + + common.Title("Test") + common.Step("PTU with disabling permissions for VD parameter", policyTableUpdate, { param }) + common.Step("RPC " .. common.rpc.sub .. " DISALLOWED after PTU", common.processRPCFailure, { common.rpc.sub, result }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/004_SubscribeVD_HMI_responds_with_invalid_data.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/004_SubscribeVD_HMI_responds_with_invalid_data.lua new file mode 100644 index 0000000000..fbe67d0bb6 --- /dev/null +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/004_SubscribeVD_HMI_responds_with_invalid_data.lua @@ -0,0 +1,46 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL responds with resultCode "GENERIC_ERROR" to SubscribeVehicleData request +-- if HMI response for parameter is invalid +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData RPC and parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid SubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends invalid response for parameter +-- SDL does: +-- - a) ignore this response +-- - b) send SubscribeVehicleData response with (success = false, resultCode = "GENERIC_ERROR") to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Functions ]] +local function getInvalidData(pParam) + return { + wrongDataType = { dataType = "UNKNOWN", resultCode = "SUCCESS" }, + wrongResultCode = { dataType = common.vd[pParam], resultCode = "UNKNOWN" } + } +end + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + for caseName, value in common.spairs(getInvalidData(param)) do + common.Step("RPC " .. common.rpc.sub .. " invalid HMI response " .. caseName, + common.processRPCgenericError, { common.rpc.sub, param, value }) + end +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/011_SubscribeVD_App_sends_invalid_request.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/005_SubscribeVD_App_sends_invalid_request.lua similarity index 59% rename from test_scripts/API/VehicleData/HandsOffSteering/011_SubscribeVD_App_sends_invalid_request.lua rename to test_scripts/API/VehicleData/SubscribeVehicleData/005_SubscribeVD_App_sends_invalid_request.lua index a2eb52de3b..048472a607 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/011_SubscribeVD_App_sends_invalid_request.lua +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/005_SubscribeVD_App_sends_invalid_request.lua @@ -1,27 +1,24 @@ --------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Check that SDL responds with resultCode "INVALID_DATA" to SubscribeVehicleData request if App sends --- request with invalid data +-- Description: Check that SDL responds with resultCode "INVALID_DATA" to SubscribeVehicleData request +-- if App sends request with invalid data for parameter -- -- Preconditions: -- 1) SDL and HMI are started --- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 2) SubscribeVehicleData RPC and parameter are allowed by policies -- 3) App is registered -- -- In case: --- 1) App sends invalid SubscribeVehicleData(handsOffSteering=123) request to SDL +-- 1) App sends invalid SubscribeVehicleData(=123) request to SDL -- SDL does: -- - a) send SubscribeVehicleData response with (success = false, resultCode = "INVALID_DATA") to App -- - b) not transfer this request to HMI --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') +local common = require('test_scripts/API/VehicleData/common') --[[ Local Variables ]] -local rpc = "SubscribeVehicleData" local result = "INVALID_DATA" -local invalidData = 123 +local value = 123 --[[ Scenario ]] common.Title("Preconditions") @@ -30,8 +27,11 @@ common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) common.Step("Register App", common.registerApp) common.Title("Test") -common.Step("RPC SubscribeVehicleData, App sends invalid request", - common.processRPCFailure, { rpc, result, invalidData }) +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub .. " invalid App request", + common.processRPCFailure, { common.rpc.sub, param, result, value }) +end common.Title("Postconditions") common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/006_SubscribeVD_2nd_request_IGNORED.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/006_SubscribeVD_2nd_request_IGNORED.lua new file mode 100644 index 0000000000..940582692a --- /dev/null +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/006_SubscribeVD_2nd_request_IGNORED.lua @@ -0,0 +1,49 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL responds with resultCode "IGNORED" to 2nd SubscribeVehicleData request +-- with prameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData RPC and parameter are allowed by policies +-- 3) App is registered +-- +-- In case: +-- 1) App sends valid SubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) process request successfully +-- 2) App sends valid SubscribeVehicleData(=true) request to SDL 2nd time +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = false, resultCode = "IGNORED") to App +-- - b) not transfer this request to HMI +-- Exception: SDL does respond with "INVALID_DATA" in case app tries to subscribe for unsubscribable VD parameter +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local result = "IGNORED" + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC 1 " .. common.rpc.sub .. " SUCCESS", common.processSubscriptionRPC, + { common.rpc.sub, param }) + common.Step("RPC 2 " .. common.rpc.sub .. " IGNORED", common.processRPCFailure, + { common.rpc.sub, param, result }) +end +for param in common.spairs(common.getVDParams(false)) do + common.Title("VD parameter: " .. param) + common.Step("RPC 1 " .. common.rpc.sub .. " INVALID_DATA", common.processRPCFailure, + { common.rpc.sub, param, "INVALID_DATA" }) + common.Step("RPC 2 " .. common.rpc.sub .. " INVALID_DATA", common.processRPCFailure, + { common.rpc.sub, param, "INVALID_DATA" }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/007_SubscribeVD_for_2_apps.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/007_SubscribeVD_for_2_apps.lua new file mode 100644 index 0000000000..ddf05c487c --- /dev/null +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/007_SubscribeVD_for_2_apps.lua @@ -0,0 +1,57 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL processes SubscribeVehicleData RPC for two Apps with parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData RPC and parameter are allowed by policies +-- 3) App_1 and App_2 are registered +-- +-- In case: +-- 1) App_1 sends valid SubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends successful SubscribeVehicleData response with data to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- = ) to App_1 +-- 3) App_2 sends valid SubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) send SubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- = ) to App_2 +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local appId_1 = 1 +local appId_2 = 2 +local isExpectedSubscribeVDonHMI = true +local isNotExpectedSubscribeVDonHMI = false +local isExpected = 1 +local isNotExpected = 0 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App_1", common.registerApp, { appId_1 }) +common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) + +common.Title("Test") +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("Absence of OnVehicleData for both apps", + common.sendOnVehicleDataTwoApps, { param, isNotExpected, isNotExpected }) + common.Step("RPC " .. common.rpc.sub .. " for App_1", + common.processSubscriptionRPC, { common.rpc.sub, param, appId_1, isExpectedSubscribeVDonHMI }) + common.Step("OnVehicleData for App_1", + common.sendOnVehicleDataTwoApps, { param, isExpected, isNotExpected }) + common.Step("RPC " .. common.rpc.sub .. " for App_2", + common.processSubscriptionRPC, { common.rpc.sub, param, appId_2, isNotExpectedSubscribeVDonHMI }) + common.Step("OnVehicleData for both apps", + common.sendOnVehicleDataTwoApps, { param, isExpected, isExpected }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/HandsOffSteering/009_SubscribeVD_not_success_codes_for_handsOffSteering_data.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/008_SubscribeVD_HMI_responds_with_not_success_codes.lua similarity index 52% rename from test_scripts/API/VehicleData/HandsOffSteering/009_SubscribeVD_not_success_codes_for_handsOffSteering_data.lua rename to test_scripts/API/VehicleData/SubscribeVehicleData/008_SubscribeVD_HMI_responds_with_not_success_codes.lua index 35ec043743..72da15e82f 100644 --- a/test_scripts/API/VehicleData/HandsOffSteering/009_SubscribeVD_not_success_codes_for_handsOffSteering_data.lua +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/008_SubscribeVD_HMI_responds_with_not_success_codes.lua @@ -1,24 +1,24 @@ --------------------------------------------------------------------------------------------------- --- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md --- --- Description: Processing of SubscribeVehicleData RPC with unsuccessful resultCode for handsOffSteering data +-- Description: Check Processing of SubscribeVehicleData request +-- if HMI respond with unsuccessful resultCode for parameter -- -- Preconditions: -- 1) SDL and HMI are started --- 2) RPC SubscribeVehicleData and handsOffSteering parameter are allowed by policies +-- 2) SubscribeVehicleData RPC and parameter are allowed by policies -- 3) App is registered -- -- In case: --- 1) App sends valid SubscribeVehicleData(handsOffSteering=true) request to SDL +-- 1) App sends valid SubscribeVehicleData(=true) request to SDL -- SDL does: -- - a) transfer this request to HMI. -- 2) HMI responds with "SUCCESS" result to SubscribeVehicleData request --- and with not success result for handsOffSteering vehicle data +-- and with not success result for vehicle data -- SDL does: --- - a) respond "SUCCESS", success:true and with unsuccessful resultCode for handsOffSteering data to the mobile app +-- - a) respond "SUCCESS", success:true and with unsuccessful resultCode for data to the mobile app +-- Note: expected behavior is under clarification in https://github.com/smartdevicelink/sdl_core/issues/3384 --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/HandsOffSteering/common') +local common = require('test_scripts/API/VehicleData/common') --[[ Local Variables ]] local resultCodes = { @@ -33,16 +33,14 @@ local resultCodes = { } --[[ Local Variables ]] -local function subscribeToVDwithUnsuccessCodeForVD(pCode) - local handsOffSteeringData = { dataType = "VEHICLEDATA_HANDSOFFSTEERING", resultCode = pCode} - local cid = common.getMobileSession():SendRPC("SubscribeVehicleData", { handsOffSteering = true }) - common.getHMIConnection():ExpectRequest("VehicleInfo.SubscribeVehicleData", { handsOffSteering = true }) +local function subscribeToVDwithUnsuccessCodeForVD(pParam, pCode) + local response = { dataType = common.vd[pParam], resultCode = pCode} + local cid = common.getMobileSession():SendRPC("SubscribeVehicleData", { [pParam] = true }) + common.getHMIConnection():ExpectRequest("VehicleInfo.SubscribeVehicleData", { [pParam] = true }) :Do(function(_,data) - common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", - { handsOffSteering = handsOffSteeringData }) + common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { [pParam] = response }) end) - common.getMobileSession():ExpectResponse(cid, - { success = true, resultCode = "SUCCESS", handsOffSteering = handsOffSteeringData }) + common.getMobileSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS", [pParam] = response }) end --[[ Scenario ]] @@ -52,9 +50,12 @@ common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) common.Step("Register App", common.registerApp) common.Title("Test") -for _, code in common.spairs(resultCodes) do - common.Step("SubscribeVehicleData with handsOffSteering resultCode =" .. code, - subscribeToVDwithUnsuccessCodeForVD, { code }) +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + for _, code in common.spairs(resultCodes) do + common.Step("RPC " .. common.rpc.sub .. " resultCode " .. code, + subscribeToVDwithUnsuccessCodeForVD, { param, code }) + end end common.Title("Postconditions") diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/009_SubscribeVD_Resumption_of_subscription_Unexpected_Disconnect.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/009_SubscribeVD_Resumption_of_subscription_Unexpected_Disconnect.lua new file mode 100644 index 0000000000..a545cc76cc --- /dev/null +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/009_SubscribeVD_Resumption_of_subscription_Unexpected_Disconnect.lua @@ -0,0 +1,44 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL resumes the subscription for parameter after unexpected disconnect +-- +-- In case: +-- 1) App is subscribed to parameter +-- 2) Unexpected disconnect and reconnect are performed +-- 3) App re-registered with actual HashId +-- SDL does: +-- a) send VI.SubscribeVehicleData(=true) request to HMI +-- 4) HMI sends SubscribeVehicleData response to SDL +-- SDL does: +-- a) not send SubscribeVehicleData response to mobile app +-- 5) HMI sends valid OnVehicleData notification with parameter data. +-- SDL does: +-- a) process this notification and transfer it to mobile app. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local appId = 1 +local isSubscribed = true +local isExpected = 1 + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App", common.registerApp) + common.Step("App subscribes to VD param", common.processSubscriptionRPC, + { common.rpc.sub, param }) + + common.Title("Test") + common.Step("Unexpected disconnect", common.unexpectedDisconnect, { param }) + common.Step("Connect mobile", common.connectMobile) + common.Step("Re-register App resumption data", common.registerAppWithResumption, + { param, appId, isSubscribed }) + common.Step("OnVehicleData with VD param", common.sendOnVehicleData, { param, isExpected }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/010_SubscribeVD_Resumption_of_subscription_Ignition_Cycle.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/010_SubscribeVD_Resumption_of_subscription_Ignition_Cycle.lua new file mode 100644 index 0000000000..5174d384a7 --- /dev/null +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/010_SubscribeVD_Resumption_of_subscription_Ignition_Cycle.lua @@ -0,0 +1,44 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL resumes the subscription for parameter after Ignition Cycle +-- +-- In case: +-- 1) App is subscribed to parameter +-- 2) Ignition cycle is performed +-- 3) App re-registered with actual HashId +-- SDL does: +-- a) send SubscribeVehicleData(=true) request to HMI +-- 4) HMI sends SubscribeVehicleData response to SDL +-- SDL does: +-- a) not send SubscribeVehicleData response to mobile app +-- 5) HMI sends valid OnVehicleData notification with parameter data. +-- SDL does: +-- a) process this notification and transfer it to mobile app. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local appId = 1 +local isSubscribed = true +local isExpected = 1 + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App", common.registerApp) + common.Step("App subscribes to VD param", common.processSubscriptionRPC, + { common.rpc.sub, param }) + + common.Title("Test") + common.Step("Ignition Off", common.ignitionOff, { param }) + common.Step("Ignition On", common.start) + common.Step("Re-register App resumption data", common.registerAppWithResumption, + { param, appId, isSubscribed }) + common.Step("OnVehicleData with VD param", common.sendOnVehicleData, { param, isExpected }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/011_SubscribeVD_Resumption_of_subscription_for_2_apps_Unexpected_Disconnect.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/011_SubscribeVD_Resumption_of_subscription_for_2_apps_Unexpected_Disconnect.lua new file mode 100644 index 0000000000..cb766f4adf --- /dev/null +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/011_SubscribeVD_Resumption_of_subscription_for_2_apps_Unexpected_Disconnect.lua @@ -0,0 +1,59 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL resumes the subscription for parameter for two Apps +-- after unexpected disconnect +-- +-- Precondition: +-- 1) Two apps are registered and activated +-- 2) Apps are subscribed to parameter data +-- 3) Unexpected disconnect and reconnect are performed +-- +-- In case: +-- 1) App_1 registers with actual hashID +-- SDL does: +-- a) start data resumption for app +-- b) start to resume the subscription and sends VI.SubscribeVehicleData request to HMI +-- c) after success response from HMI SDL resumes the subscription +-- 2) App_2 registers with actual hashID +-- SDL does: +-- a) start data resumption for app +-- b) resume the subscription internally and not send VI.SubscribeVehicleData request to HMI +-- 3) HMI sends OnVehicleData notification with parameter +-- SDL does: +-- a) resend OnVehicleData notification to both mobile apps +-------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local appId1 = 1 +local appId2 = 2 +local isExpectedSubscribeVDonHMI = true +local notExpectedSubscribeVDonHMI = false +local isExpected = 1 + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment", common.preconditions) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App1", common.registerAppWOPTU, { appId1 }) + common.Step("Register App2", common.registerAppWOPTU, { appId2 }) + common.Step("App1 subscribes to VD param", common.processSubscriptionRPC, + { common.rpc.sub, param, appId1, isExpectedSubscribeVDonHMI }) + common.Step("App2 subscribes to VD param", common.processSubscriptionRPC, + { common.rpc.sub, param, appId2, notExpectedSubscribeVDonHMI }) + + common.Title("Test") + common.Step("Unexpected disconnect", common.unexpectedDisconnect, { param }) + common.Step("Connect mobile", common.connectMobile) + common.Step("Re-register App1 resumption data", common.registerAppWithResumption, + { param, appId1, isExpectedSubscribeVDonHMI }) + common.Step("Re-register App2 resumption data", common.registerAppWithResumption, + { param, appId2, notExpectedSubscribeVDonHMI }) + common.Step("OnVehicleData with VD param for both apps", common.sendOnVehicleData, + { param, isExpected }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/SubscribeVehicleData/012_SubscribeVD_Resumption_of_subscription_for_2_apps_Ignition_Cycle.lua b/test_scripts/API/VehicleData/SubscribeVehicleData/012_SubscribeVD_Resumption_of_subscription_for_2_apps_Ignition_Cycle.lua new file mode 100644 index 0000000000..084855a3df --- /dev/null +++ b/test_scripts/API/VehicleData/SubscribeVehicleData/012_SubscribeVD_Resumption_of_subscription_for_2_apps_Ignition_Cycle.lua @@ -0,0 +1,59 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL resumes the subscription for parameter for two Apps +-- after Ignition Cycle +-- +-- Precondition: +-- 1) Two apps are registered and activated +-- 2) Apps are subscribed to parameter data +-- 3) Ignition cycle is performed +-- +-- In case: +-- 1) App_1 registers with actual hashID +-- SDL does: +-- a) start data resumption for app +-- b) start to resume the subscription and sends VI.SubscribeVehicleData request to HMI +-- c) after success response from HMI SDL resumes the subscription +-- 2) App_2 registers with actual hashID +-- SDL does: +-- a) start data resumption for app +-- b) resume the subscription internally and not send VI.SubscribeVehicleData request to HMI +-- 3) HMI sends OnVehicleData notification with parameter +-- SDL does: +-- a) resend OnVehicleData notification to both mobile apps +-------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local appId1 = 1 +local appId2 = 2 +local isExpectedSubscribeVDonHMI = true +local notExpectedSubscribeVDonHMI = false +local isExpected = 1 + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment", common.preconditions) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App1", common.registerAppWOPTU, { appId1 }) + common.Step("Register App2", common.registerAppWOPTU, { appId2 }) + common.Step("App1 subscribes to VD param", common.processSubscriptionRPC, + { common.rpc.sub, param, appId1, isExpectedSubscribeVDonHMI }) + common.Step("App2 subscribes to VD param", common.processSubscriptionRPC, + { common.rpc.sub, param, appId2, notExpectedSubscribeVDonHMI }) + + common.Title("Test") + common.Step("Ignition Off", common.ignitionOff, { param }) + common.Step("Ignition On", common.start) + common.Step("Re-register App1 resumption data", common.registerAppWithResumption, + { param, appId1, isExpectedSubscribeVDonHMI }) + common.Step("Re-register App2 resumption data", common.registerAppWithResumption, + { param, appId2, notExpectedSubscribeVDonHMI }) + common.Step("OnVehicleData with VD param for both apps", common.sendOnVehicleData, + { param, isExpected }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/001_Success_flow.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/001_Success_flow.lua deleted file mode 100644 index a99c61698a..0000000000 --- a/test_scripts/API/VehicleData/UnsubscribeVehicleData/001_Success_flow.lua +++ /dev/null @@ -1,44 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case: request is allowed by Policies --- --- Requirement summary: --- [UnsubscribeVehicleData] Mobile app wants to send a request to unsubscribe --- for already subscribed specified parameter --- --- Description: --- In case: --- Mobile application sends valid UnsubscribeVehicleData to SDL --- This request is allowed by Policies and mobile app is subscribed for this parameter --- SDL must: --- Transfer this request to HMI and after successful response from hmi --- Respond SUCCESS, success:true to mobile application ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc_subscribe = "SubscribeVehicleData" -local rpc_unsubscribe = "UnsubscribeVehicleData" --- removed because vin parameter is not applicable for SubscribeVehicleData -common.allVehicleData.vin = nil - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -common.Step("Activate App", common.activateApp) - -common.Title("Test") -for vehicleDataName in pairs(common.allVehicleData) do - runner.Step("RPC " .. rpc_subscribe .. " " .. vehicleDataName, common.processRPCSubscriptionSuccess, - {rpc_subscribe, vehicleDataName }) - runner.Step("RPC " .. rpc_unsubscribe .. " " .. vehicleDataName, common.processRPCSubscriptionSuccess, - {rpc_unsubscribe, vehicleDataName }) -end -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/001_UnsubscribeVD_Success.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/001_UnsubscribeVD_Success.lua new file mode 100644 index 0000000000..c22145513b --- /dev/null +++ b/test_scripts/API/VehicleData/UnsubscribeVehicleData/001_UnsubscribeVD_Success.lua @@ -0,0 +1,43 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL processes UnsubscribeVehicleData RPC with parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData, UnsubscribeVehicleData RPCs and parameter are allowed by policies +-- 3) App is registered +-- 4) App is subscribed to parameter +-- +-- In case: +-- 1) App sends valid UnsubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends VI.UnsubscribeVehicleData response with parameter to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- = ) to App +-- Exception: SDL does respond with "INVALID_DATA" in case app tries to unsubscribe from unsubscribable VD parameter +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub, common.processSubscriptionRPC, { common.rpc.sub, param }) + common.Step("RPC " .. common.rpc.unsub, common.processSubscriptionRPC, { common.rpc.unsub, param }) +end + +for param in common.spairs(common.getVDParams(false)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.unsub .. " INVALID_DATA", common.processRPCFailure, + { common.rpc.unsub, param, "INVALID_DATA" }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/002_RPC_parameter_not_yet_subscribed_IGNORED_flow.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/002_RPC_parameter_not_yet_subscribed_IGNORED_flow.lua deleted file mode 100644 index d66dd68576..0000000000 --- a/test_scripts/API/VehicleData/UnsubscribeVehicleData/002_RPC_parameter_not_yet_subscribed_IGNORED_flow.lua +++ /dev/null @@ -1,78 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case: request is allowed by Policies --- --- Requirement summary: --- [UnsubscribeVehicleData] Mobile app wants to send a request to unsubscribe --- for not yet subscribed specified parameter --- --- Description: --- In case: --- Mobile application sends valid UnsubscribeVehicleData to SDL and this request --- is allowed by Policies but app is not yet subscribed for this parameter --- SDL must: --- Respond IGNORED, success:false to mobile application and not transfer this request to HMI ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc = { - name = "UnsubscribeVehicleData", - params = { - engineOilLife = true, - fuelRange = true, - tirePressure = true, - electronicParkBrakeStatus = true, - turnSignal = true - } -} - -local vehicleDataResults = { - engineOilLife = { - dataType = "VEHICLEDATA_ENGINEOILLIFE", - resultCode = "DATA_NOT_SUBSCRIBED" - }, - fuelRange = { - dataType = "VEHICLEDATA_FUELRANGE", - resultCode = "DATA_NOT_SUBSCRIBED" - }, - tirePressure = { - dataType = "VEHICLEDATA_TIREPRESSURE", - resultCode = "DATA_NOT_SUBSCRIBED" - }, - electronicParkBrakeStatus = { - dataType = "VEHICLEDATA_ELECTRONICPARKBRAKESTATUS", - resultCode = "DATA_NOT_SUBSCRIBED" - }, - turnSignal = { - dataType = "VEHICLEDATA_TURNSIGNAL", - resultCode = "DATA_NOT_SUBSCRIBED" - } -} - ---[[ Local Functions ]] -local function processRPCFailure() - local cid = common.getMobileSession():SendRPC(rpc.name, rpc.params) - common.getHMIConnection():ExpectRequest("VehicleInfo." .. rpc.name, rpc.params):Times(0) - local responseParams = vehicleDataResults - responseParams.success = false - responseParams.resultCode = "IGNORED" - common.getMobileSession():ExpectResponse(cid, responseParams) -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -common.Step("Activate App", common.activateApp) - -common.Title("Test") -common.Step("RPC " .. rpc.name , processRPCFailure) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/002_UnsubscribeVD_disallowed.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/002_UnsubscribeVD_disallowed.lua new file mode 100644 index 0000000000..98325f166b --- /dev/null +++ b/test_scripts/API/VehicleData/UnsubscribeVehicleData/002_UnsubscribeVD_disallowed.lua @@ -0,0 +1,60 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL rejects UnsubscribeVehicleData request with resultCode "DISALLOWED" +-- if parameter is not allowed by policy +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) parameter is not allowed by policies for UnsubscribeVehicleData RPC +-- 3) App is registered and subscribed to parameter +-- +-- In case: +-- 1) App sends valid UnsubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local result = "DISALLOWED" + +--[[ Local Functions ]] +local function getVDGroup(pDisallowedParam) + local all_params = {} + local params = {} + for param in pairs(common.getVDParams(true)) do + if param ~= pDisallowedParam then table.insert(params, param) end + table.insert(all_params, param) + end + return { + rpcs = { + [common.rpc.sub] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = all_params + }, + [common.rpc.unsub] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = params + }, + } + } +end + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions, { getVDGroup(param) }) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App", common.registerApp) + + common.Title("Test") + common.Step("RPC " .. common.rpc.sub .. " SUCCESS", common.processSubscriptionRPC, + { common.rpc.sub, param }) + common.Step("RPC " .. common.rpc.unsub .. " DISALLOWED", common.processRPCFailure, + { common.rpc.unsub, param, result }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/003_RPC_parameter_already_unsubscribed_Result_IGNORED_flow.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/003_RPC_parameter_already_unsubscribed_Result_IGNORED_flow.lua deleted file mode 100644 index b4e7a630a8..0000000000 --- a/test_scripts/API/VehicleData/UnsubscribeVehicleData/003_RPC_parameter_already_unsubscribed_Result_IGNORED_flow.lua +++ /dev/null @@ -1,142 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case: request is allowed by Policies --- --- Requirement summary: --- [UnsubscribeVehicleData] Mobile app wants to send a request to unsubscribe --- for already unsubscribed specified parameter --- --- Description: --- In case: --- 1) Mobile application sends valid UnsubscribeVehicleData to SDL and this request is allowed by Policies --- 2) Mobile app is already unsubscribed from this parameter --- SDL must: --- Respond IGNORED, success:false {dataType = "VEHICLEDATA_engin eOilLife", --- resultCode = "DATA_NOT_SUBSCRIBED"} to mobile application ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc_subscribe = { - name = "SubscribeVehicleData", - params = { - engineOilLife = true, - fuelRange = true, - tirePressure = true, - electronicParkBrakeStatus = true, - turnSignal = true - } -} - -local rpc_unsubscribe = { - name = "UnsubscribeVehicleData", - params = { - engineOilLife = true, - fuelRange = true, - tirePressure = true, - electronicParkBrakeStatus = true, - turnSignal = true - } -} - -local vehicleDataResults = { - engineOilLife = { - dataType = "VEHICLEDATA_ENGINEOILLIFE", - resultCode = "SUCCESS" - }, - fuelRange = { - dataType = "VEHICLEDATA_FUELRANGE", - resultCode = "SUCCESS" - }, - tirePressure = { - dataType = "VEHICLEDATA_TIREPRESSURE", - resultCode = "SUCCESS" - }, - electronicParkBrakeStatus = { - dataType = "VEHICLEDATA_ELECTRONICPARKBRAKESTATUS", - resultCode = "SUCCESS" - }, - turnSignal = { - dataType = "VEHICLEDATA_TURNSIGNAL", - resultCode = "SUCCESS" - } -} - -local vehicleDataResults2 = { - engineOilLife = { - dataType = "VEHICLEDATA_ENGINEOILLIFE", - resultCode = "DATA_NOT_SUBSCRIBED" - }, - fuelRange = { - dataType = "VEHICLEDATA_FUELRANGE", - resultCode = "DATA_NOT_SUBSCRIBED" - }, - tirePressure = { - dataType = "VEHICLEDATA_TIREPRESSURE", - resultCode = "DATA_NOT_SUBSCRIBED" - }, - electronicParkBrakeStatus = { - dataType = "VEHICLEDATA_ELECTRONICPARKBRAKESTATUS", - resultCode = "DATA_NOT_SUBSCRIBED" - }, - turnSignal = { - dataType = "VEHICLEDATA_TURNSIGNAL", - resultCode = "DATA_NOT_SUBSCRIBED" - } -} - ---[[ Local Functions ]] -local function processRPCSubscribeSuccess() - local cid = common.getMobileSession():SendRPC(rpc_subscribe.name, rpc_subscribe.params) - common.getHMIConnection():ExpectRequest("VehicleInfo." .. rpc_subscribe.name, rpc_subscribe.params) - :Do(function(_, data) - common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", - vehicleDataResults) - end) - local responseParams = vehicleDataResults - responseParams.success = true - responseParams.resultCode = "SUCCESS" - common.getMobileSession():ExpectResponse(cid, responseParams) -end - -local function processRPCUnsubscribeSuccess() - local cid = common.getMobileSession():SendRPC(rpc_unsubscribe.name, rpc_unsubscribe.params) - common.getHMIConnection():ExpectRequest("VehicleInfo." .. rpc_unsubscribe.name, rpc_unsubscribe.params) - :Do(function(_, data) - common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", - vehicleDataResults) - end) - local responseParams = vehicleDataResults - responseParams.success = true - responseParams.resultCode = "SUCCESS" - common.getMobileSession():ExpectResponse(cid, responseParams) -end - -local function processRPCUnsubscribeIgnored() - local cid = common.getMobileSession():SendRPC(rpc_unsubscribe.name, rpc_unsubscribe.params) - common.getHMIConnection():ExpectRequest("VehicleInfo." .. rpc_unsubscribe.name, rpc_unsubscribe.params):Times(0) - local responseParams = vehicleDataResults2 - responseParams.success = false - responseParams.resultCode = "IGNORED" - common.getMobileSession():ExpectResponse(cid, responseParams) -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdate }) -common.Step("Activate App", common.activateApp) - -common.Title("Test") -common.Step("RPC " .. rpc_subscribe.name, processRPCSubscribeSuccess) -common.Step("RPC " .. rpc_unsubscribe.name, processRPCUnsubscribeSuccess) -common.Title("Trying to unsubscribe from already unsubscribed parameter...") -common.Step("RPC " .. rpc_unsubscribe.name, processRPCUnsubscribeIgnored) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/003_UnsubscribeVD_disallowed_after_PTU.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/003_UnsubscribeVD_disallowed_after_PTU.lua new file mode 100644 index 0000000000..7868af5c9c --- /dev/null +++ b/test_scripts/API/VehicleData/UnsubscribeVehicleData/003_UnsubscribeVD_disallowed_after_PTU.lua @@ -0,0 +1,82 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL rejects UnsubscribeVehicleData request with resultCode "DISALLOWED" +-- if parameter is not allowed by policy after PTU +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData, UnsubscribeVehicleData RPCs and parameter are allowed by policies +-- 3) App is registered and subscribed to data +-- +-- In case: +-- 1) App sends valid UnsubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends VI.UnsubscribeVehicleData response with data to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- = ) to App +-- 3) App is subscribed to data again +-- 4) PTU is performed with disabling permissions for parameter +-- 5) App sends valid UnsubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "DISALLOWED") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local result = "DISALLOWED" + +--[[ Local Function ]] +local function getVDGroup(pDisallowedParam) + local all_params = {} + local params = {} + for param in pairs(common.getVDParams(true)) do + if param ~= pDisallowedParam then table.insert(params, param) end + table.insert(all_params, param) + end + return { + rpcs = { + [common.rpc.sub] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = all_params + }, + [common.rpc.unsub] = { + hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" }, + parameters = params + }, + } + } +end + +local function policyTableUpdate(pDisallowedParam) + local function ptUpdate(pt) + pt.policy_table.functional_groupings["NewTestCaseGroup"] = getVDGroup(pDisallowedParam) + pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" } + end + common.policyTableUpdate(ptUpdate) +end + +--[[ Scenario ]] +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Title("Preconditions") + common.Step("Clean environment and update preloaded_pt file", common.preconditions) + common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + common.Step("Register App", common.registerApp) + common.Step("RPC " .. common.rpc.sub .. " SUCCESS", common.processSubscriptionRPC, + { common.rpc.sub, param }) + common.Step("RPC " .. common.rpc.unsub .. " SUCCESS", common.processSubscriptionRPC, + { common.rpc.unsub, param }) + + common.Title("Test") + common.Step("PTU with disabling permissions for VD parameter", policyTableUpdate, { param }) + common.Step("RPC " .. common.rpc.sub .. " SUCCESS", common.processSubscriptionRPC, + { common.rpc.sub, param }) + common.Step("RPC " .. common.rpc.unsub .. " DISALLOWED after PTU", common.processRPCFailure, + { common.rpc.unsub, result }) + + common.Title("Postconditions") + common.Step("Stop SDL", common.postconditions) +end diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/004_RPC_parameter_disallowed_by_policies_Result_DISALLOWED_flow.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/004_RPC_parameter_disallowed_by_policies_Result_DISALLOWED_flow.lua deleted file mode 100644 index b4c154234b..0000000000 --- a/test_scripts/API/VehicleData/UnsubscribeVehicleData/004_RPC_parameter_disallowed_by_policies_Result_DISALLOWED_flow.lua +++ /dev/null @@ -1,77 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- User story: TO ADD !!! --- Use case: TO ADD !!! --- Item: Use Case: request is allowed but parameter of this request is NOT allowed by Policies --- --- Requirement summary: --- [UnsubscribeVehicleData] Mobile app wants to send a request to unsubscribe --- from specified parameter but parameter is disallowed by Policies --- Description: --- In case: --- 1) mobile application sends valid UnsubscribeVehicleData to SDL and this request is --- allowed by Policies but RPC parameter is not allowed --- SDL must: --- 1) SDL responds DISALLOWED, success:false to mobile application and doesn't transfer this request to HMI ---------------------------------------------------------------------------------------------------- - ---[[ Required Shared libraries ]] -local common = require('test_scripts/API/VehicleData/commonVehicleData') - ---[[ Local Variables ]] -local rpc = { - name = "UnsubscribeVehicleData", - params = { - engineOilLife = true, - fuelRange = true, - tirePressure = true, - electronicParkBrakeStatus = true, - turnSignal = true - } -} - -local vehicleDataResults = { - engineOilLife = { - dataType = "VEHICLEDATA_ENGINEOILLIFE", - resultCode = "DISALLOWED" - }, - fuelRange = { - dataType = "VEHICLEDATA_FUELRANGE", - resultCode = "DISALLOWED" - }, - tirePressure = { - dataType = "VEHICLEDATA_TIREPRESSURE", - resultCode = "DISALLOWED" - }, - electronicParkBrakeStatus = { - dataType = "VEHICLEDATA_ELECTRONICPARKBRAKESTATUS", - resultCode = "DISALLOWED" - }, - turnSignal = { - dataType = "VEHICLEDATA_TURNSIGNAL", - resultCode = "DISALLOWED" - } -} - ---[[ Local Functions ]] -local function processRPCFailure() - local cid = common.getMobileSession():SendRPC(rpc.name, rpc.params) - common.getHMIConnection():ExpectRequest("VehicleInfo." .. rpc.name, rpc.params):Times(0) - local responseParams = vehicleDataResults - responseParams.success = false - responseParams.resultCode = "DISALLOWED" - common.getMobileSession():ExpectResponse(cid, responseParams) -end - ---[[ Scenario ]] -common.Title("Preconditions") -common.Step("Clean environment", common.preconditions) -common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) -common.Step("RAI", common.registerApp) -common.Step("PTU", common.policyTableUpdate, { common.ptUpdateMin }) -common.Step("Activate App", common.activateApp) - -common.Title("Test") -common.Step("RPC " .. rpc.name , processRPCFailure) - -common.Title("Postconditions") -common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/004_UnsubscribeVD_HMI_responds_with_invalid_data.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/004_UnsubscribeVD_HMI_responds_with_invalid_data.lua new file mode 100644 index 0000000000..74d095fe0e --- /dev/null +++ b/test_scripts/API/VehicleData/UnsubscribeVehicleData/004_UnsubscribeVD_HMI_responds_with_invalid_data.lua @@ -0,0 +1,48 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL responds with resultCode "GENERIC_ERROR" to UnsubscribeVehicleData request +-- if HMI response for parameter is invalid +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData, UnsubscribeVehicleData RPCs and parameter are allowed by policies +-- 3) App is registered and subscribed to data +-- +-- In case: +-- 1) App sends valid UnsubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 2) HMI sends invalid response for parameter +-- SDL does: +-- - a) ignore this response +-- - b) send UnsubscribeVehicleData response with (success = false, resultCode = "GENERIC_ERROR") to App +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Functions ]] +local function getInvalidData(pParam) + return { + wrongDataType = { dataType = "UNKNOWN", resultCode = "SUCCESS" }, + wrongResultCode = { dataType = common.vd[pParam], resultCode = "UNKNOWN" } + } +end + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub .. " SUCCESS", common.processSubscriptionRPC, + { common.rpc.sub, param }) + for caseName, value in common.spairs(getInvalidData(param)) do + common.Step("RPC " .. common.rpc.unsub .. " invalid HMI response " .. caseName, + common.processRPCgenericError, { common.rpc.unsub, param, value }) + end +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/005_UnsubscribeVD_App_sends_invalid_request.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/005_UnsubscribeVD_App_sends_invalid_request.lua new file mode 100644 index 0000000000..dab8821c18 --- /dev/null +++ b/test_scripts/API/VehicleData/UnsubscribeVehicleData/005_UnsubscribeVD_App_sends_invalid_request.lua @@ -0,0 +1,39 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL responds with resultCode "INVALID_DATA" to UnsubscribeVehicleData request +-- if App sends request with invalid data for parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData, UnsubscribeVehicleData RPCs and parameter are allowed by policies +-- 3) App is registered and subscribed to parameter +-- +-- In case: +-- 1) App sends invalid UnsubscribeVehicleData(=123) request to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "INVALID_DATA") to App +-- - b) not transfer this request to HMI +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local result = "INVALID_DATA" +local value = 123 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub .. " SUCCESS", common.processSubscriptionRPC, + { common.rpc.sub, param }) + common.Step("RPC " .. common.rpc.unsub .. " invalid App request", + common.processRPCFailure, { common.rpc.unsub, param, result, value }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/006_UnsubscribeVD_2nd_request_IGNORED.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/006_UnsubscribeVD_2nd_request_IGNORED.lua new file mode 100644 index 0000000000..5c5555731e --- /dev/null +++ b/test_scripts/API/VehicleData/UnsubscribeVehicleData/006_UnsubscribeVD_2nd_request_IGNORED.lua @@ -0,0 +1,52 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL responds with resultCode "IGNORED" to 2nd UnsubscribeVehicleData request +-- with prameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData, UnsubscribeVehicleData RPC and parameter are allowed by policies +-- 3) App is registered and subscribed to parameter +-- +-- In case: +-- 1) App sends valid UnsubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) process request successfully +-- 2) App sends valid UnsubscribeVehicleData(=true) request to SDL 2nd time +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = false, resultCode = "IGNORED") to App +-- - b) not transfer this request to HMI +-- Exception: SDL does respond with "INVALID_DATA" in case app tries to unsubscribe from unsubscribable VD parameter +--------------------------------------------------------------------------------------------------- + +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local result = "IGNORED" + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub .. " SUCCESS", common.processSubscriptionRPC, + { common.rpc.sub, param }) + common.Step("RPC 1 " .. common.rpc.unsub .. " SUCCESS", common.processSubscriptionRPC, + { common.rpc.unsub, param }) + common.Step("RPC 2 " .. common.rpc.unsub .. " IGNORED", common.processRPCFailure, + { common.rpc.unsub, param, result }) +end +for param in common.spairs(common.getVDParams(false)) do + common.Title("VD parameter: " .. param) + common.Step("RPC 1 " .. common.rpc.unsub .. " INVALID_DATA", common.processRPCFailure, + { common.rpc.unsub, param, "INVALID_DATA" }) + common.Step("RPC 2 " .. common.rpc.unsub .. " INVALID_DATA", common.processRPCFailure, + { common.rpc.unsub, param, "INVALID_DATA" }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/007_UnsubscribeVD_for_2_apps.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/007_UnsubscribeVD_for_2_apps.lua new file mode 100644 index 0000000000..5a2670a3e7 --- /dev/null +++ b/test_scripts/API/VehicleData/UnsubscribeVehicleData/007_UnsubscribeVD_for_2_apps.lua @@ -0,0 +1,61 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check that SDL processes UnsubscribeVehicleData RPC for two Apps with parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData, UnsubscribeVehicleData RPCs and parameter are allowed by policies +-- 3) App_1 and App_2 are registered and subscribed to data +-- +-- In case: +-- 1) App_1 sends valid UnsubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- = ) to App_1 +-- - b) not transfer this request to HMI +-- 2) App_2 sends valid UnsubscribeVehicleData(=true) request to SDL +-- SDL does: +-- - a) transfer this request to HMI +-- 3) HMI sends VI.UnsubscribeVehicleData response with data to SDL +-- SDL does: +-- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", +-- = ) to App_2 +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local appId_1 = 1 +local appId_2 = 2 +local isExpectedSubscribeVDonHMI = true +local isNotExpectedSubscribeVDonHMI = false +local isNotExpected = 0 +local isExpected = 1 + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App_1", common.registerApp, { appId_1 }) +common.Step("Register App_2", common.registerAppWOPTU, { appId_2 }) + +common.Title("Test") +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub .. " for App_1", + common.processSubscriptionRPC, { common.rpc.sub, param, appId_1, isExpectedSubscribeVDonHMI }) + common.Step("RPC " .. common.rpc.sub .. " for App_2", + common.processSubscriptionRPC, { common.rpc.sub, param, appId_2, isNotExpectedSubscribeVDonHMI }) + common.Step("OnVehicleData for both apps", + common.sendOnVehicleDataTwoApps, { param, isExpected, isExpected }) + common.Step("RPC " .. common.rpc.unsub .. " for App_1", + common.processSubscriptionRPC, { common.rpc.unsub, param, appId_1, isNotExpectedSubscribeVDonHMI }) + common.Step("Absence of OnVehicleData for App_1", + common.sendOnVehicleDataTwoApps, { param, isNotExpected, isExpected }) + common.Step("RPC " .. common.rpc.unsub .. " for App_2", + common.processSubscriptionRPC, { common.rpc.unsub, param, appId_2, isExpectedSubscribeVDonHMI }) + common.Step("Absence of OnVehicleData for both apps", + common.sendOnVehicleDataTwoApps, { param, isNotExpected, isNotExpected }) +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/UnsubscribeVehicleData/008_UnsubscribeVD_HMI_responds_with_not_success_codes.lua b/test_scripts/API/VehicleData/UnsubscribeVehicleData/008_UnsubscribeVD_HMI_responds_with_not_success_codes.lua new file mode 100644 index 0000000000..8c0cce9673 --- /dev/null +++ b/test_scripts/API/VehicleData/UnsubscribeVehicleData/008_UnsubscribeVD_HMI_responds_with_not_success_codes.lua @@ -0,0 +1,64 @@ +--------------------------------------------------------------------------------------------------- +-- Description: Check Processing of UnsubscribeVehicleData request +-- if HMI respond with unsuccessful resultCode for parameter +-- +-- Preconditions: +-- 1) SDL and HMI are started +-- 2) SubscribeVehicleData, UnsubscribeVehicleData RPCs and parameter are allowed by policies +-- 3) App is registered +-- 4) App is subscribed to data +-- +-- In case: +-- 1) App sends UnsubscribeVehicleData(=true) request to the SDL +-- SDL does: +-- a) transfer this request to HMI. +-- 2) HMI responds with "SUCCESS" result to UnsubscribeVehicleData request +-- and with not success result for vehicle data +-- SDL does: +-- a) respond "GENERIC_ERROR", success:false and with unsuccessful resultCode for data to the mobile app +-- Note: expected behavior is under clarification in https://github.com/smartdevicelink/sdl_core/issues/3384 +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/API/VehicleData/common') + +--[[ Local Variables ]] +local resultCodes = { + "TRUNCATED_DATA", + "DISALLOWED", + "USER_DISALLOWED", + "INVALID_ID", + "VEHICLE_DATA_NOT_AVAILABLE", + "DATA_NOT_SUBSCRIBED", + "IGNORED", + "DATA_ALREADY_SUBSCRIBED" +} + +--[[ Local Functions ]] +local function unsubscribeVDwithUnsuccessCodeForVD(pParam, pCode) + local response = { dataType = common.vd[pParam], resultCode = pCode} + local cid = common.getMobileSession():SendRPC("UnsubscribeVehicleData", { [pParam] = true }) + common.getHMIConnection():ExpectRequest("VehicleInfo.UnsubscribeVehicleData", { [pParam] = true }) + :Do(function(_,data) + common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { [pParam] = response }) + end) + common.getMobileSession():ExpectResponse(cid, { success = false, resultCode = "GENERIC_ERROR", [pParam] = response }) +end + +--[[ Scenario ]] +common.Title("Preconditions") +common.Step("Clean environment and update preloaded_pt file", common.preconditions) +common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +common.Step("Register App", common.registerApp) + +common.Title("Test") +for param in common.spairs(common.getVDParams(true)) do + common.Title("VD parameter: " .. param) + common.Step("RPC " .. common.rpc.sub, common.processSubscriptionRPC, { common.rpc.sub, param }) + for _, code in common.spairs(resultCodes) do + common.Step("RPC " .. common.rpc.unsub .. " resultCode " .. code, + unsubscribeVDwithUnsuccessCodeForVD, { param, code }) + end +end + +common.Title("Postconditions") +common.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/001_VD_parameter_in_API_DB_app_version_more_then_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/001_VD_parameter_in_API_DB_app_version_more_then_parameter_version.lua index e7e38c3b8e..5ef0cebbcf 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/001_VD_parameter_in_API_DB_app_version_more_then_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/001_VD_parameter_in_API_DB_app_version_more_then_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/002_VD_parameter_in_API_DB_app_version_equal_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/002_VD_parameter_in_API_DB_app_version_equal_parameter_version.lua index 51bf8f6952..30630e65fa 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/002_VD_parameter_in_API_DB_app_version_equal_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/002_VD_parameter_in_API_DB_app_version_equal_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/003_VD_parameter_in_API_DB_app_version_less_then_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/003_VD_parameter_in_API_DB_app_version_less_then_parameter_version.lua index 65391cf4bd..5d49e9f2a7 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/003_VD_parameter_in_API_DB_app_version_less_then_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/003_VD_parameter_in_API_DB_app_version_less_then_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/004_VD_parameter_in_API_DB_different_values_app_version_more_then_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/004_VD_parameter_in_API_DB_different_values_app_version_more_then_parameter_version.lua index 919e07aa07..bf1a7c2d5b 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/004_VD_parameter_in_API_DB_different_values_app_version_more_then_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/004_VD_parameter_in_API_DB_different_values_app_version_more_then_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/005_VD_parameter_in_API_DB_different_values_version_in_DB_more_then_version_of_API_app_version_more_then_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/005_VD_parameter_in_API_DB_different_values_version_in_DB_more_then_version_of_API_app_version_more_then_parameter_version.lua index 77793ac323..c19f1d66b5 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/005_VD_parameter_in_API_DB_different_values_version_in_DB_more_then_version_of_API_app_version_more_then_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/005_VD_parameter_in_API_DB_different_values_version_in_DB_more_then_version_of_API_app_version_more_then_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/006_VD_parameter_DB_app_version_more_then_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/006_VD_parameter_DB_app_version_more_then_parameter_version.lua index e3bc09ef29..a1932f5663 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/006_VD_parameter_DB_app_version_more_then_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/006_VD_parameter_DB_app_version_more_then_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/007_VD_parameter_DB_app_version_equal_to_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/007_VD_parameter_DB_app_version_equal_to_parameter_version.lua index 88d81944f2..dd33882c56 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/007_VD_parameter_DB_app_version_equal_to_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/007_VD_parameter_DB_app_version_equal_to_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/008_VD_parameter_DB_app_version_less_then_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/008_VD_parameter_DB_app_version_less_then_parameter_version.lua index 24fdff4246..cd35b12e15 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/008_VD_parameter_DB_app_version_less_then_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/008_VD_parameter_DB_app_version_less_then_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/009_VD_parameter_DB_version_more_then_API_app_version_more_then_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/009_VD_parameter_DB_version_more_then_API_app_version_more_then_parameter_version.lua index ac5a57cea0..62bb512d70 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/009_VD_parameter_DB_version_more_then_API_app_version_more_then_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/009_VD_parameter_DB_version_more_then_API_app_version_more_then_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/010_VD_parameter_in_API_app_version_more_then_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/010_VD_parameter_in_API_app_version_more_then_parameter_version.lua index 4203aef988..70533be55a 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/010_VD_parameter_in_API_app_version_more_then_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/010_VD_parameter_in_API_app_version_more_then_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/011_VD_parameter_in_API_app_version_equal_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/011_VD_parameter_in_API_app_version_equal_parameter_version.lua index 66a3577001..e2344ebd4d 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/011_VD_parameter_in_API_app_version_equal_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/011_VD_parameter_in_API_app_version_equal_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/012_VD_parameter_in_API_app_version_less_then_parameter_version.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/012_VD_parameter_in_API_app_version_less_then_parameter_version.lua index 0ca75109e2..54f8241737 100644 --- a/test_scripts/API/VehicleData/VehicleDataVersioning/012_VD_parameter_in_API_app_version_less_then_parameter_version.lua +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/012_VD_parameter_in_API_app_version_less_then_parameter_version.lua @@ -12,7 +12,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/VehicleData/commonVehicleData') +local common = require('test_scripts/API/VehicleData/VehicleDataVersioning/common') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false diff --git a/test_scripts/API/VehicleData/VehicleDataVersioning/common.lua b/test_scripts/API/VehicleData/VehicleDataVersioning/common.lua new file mode 100644 index 0000000000..a8b9e73dd3 --- /dev/null +++ b/test_scripts/API/VehicleData/VehicleDataVersioning/common.lua @@ -0,0 +1,53 @@ +--------------------------------------------------------------------------------------------------- +-- Common module +--------------------------------------------------------------------------------------------------- +--[[ Module ]] +local m = require('test_scripts/API/VehicleData/common') + +function m.processGetVDsuccess(pData) + local reqParams = { + [pData] = true + } + local hmiResParams = { + [pData] = m.vdValues[pData] + } + local cid = m.getMobileSession():SendRPC("GetVehicleData", reqParams) + m.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", reqParams) + :Do(function(_, data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", hmiResParams) + end) + local mobResParams = m.cloneTable(hmiResParams) + mobResParams.success = true + mobResParams.resultCode = "SUCCESS" + m.getMobileSession():ExpectResponse(cid, mobResParams) +end + +function m.processGetVDunsuccess(pData) + local reqParams = { + [pData] = true + } + local cid = m.getMobileSession():SendRPC("GetVehicleData", reqParams) + m.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", reqParams) :Times(0) + m.getMobileSession():ExpectResponse(cid, { resultCode = "INVALID_DATA", success = false }) +end + +function m.processGetVDwithCustomDataSuccess() + local cid = m.getMobileSession():SendRPC("GetVehicleData", { custom_vd_item1_integer = true }) + m.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", { OEM_REF_INT = true }) + :Do(function(_, data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { OEM_REF_INT = 10 }) + end) + local mobResParams = { custom_vd_item1_integer = 10 } + mobResParams.success = true + mobResParams.resultCode = "SUCCESS" + m.getMobileSession():ExpectResponse(cid, mobResParams) +end + +function m.updatePreloadedFile(pUpdateFunc) + local pt = m.getPreloadedPT() + pt.policy_table.functional_groupings["DataConsent-2"].rpcs = m.json.null + pUpdateFunc(pt) + m.setPreloadedPT(pt) +end + +return m diff --git a/test_scripts/API/VehicleData/common.lua b/test_scripts/API/VehicleData/common.lua new file mode 100644 index 0000000000..c175700fe1 --- /dev/null +++ b/test_scripts/API/VehicleData/common.lua @@ -0,0 +1,628 @@ +--------------------------------------------------------------------------------------------------- +-- Common module +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local actions = require("user_modules/sequences/actions") +local runner = require('user_modules/script_runner') +local utils = require("user_modules/utils") +local json = require("modules/json") +local SDL = require("SDL") +local apiLoader = require("modules/api_loader") +local color = require("user_modules/consts").color + +--[[ General configuration parameters ]] +runner.testSettings.isSelfIncluded = false +config.defaultProtocolVersion = 2 + +--[[ Local Variables ]] +local m = {} +local hashId = {} +local api = { + hmi = apiLoader.init("data/HMI_API.xml"), + mob = apiLoader.init("data/MOBILE_API.xml") +} + +--[[ Common Proxy Functions ]] +do + m.Title = runner.Title + m.Step = runner.Step + m.getPreloadedPT = actions.sdl.getPreloadedPT + m.setPreloadedPT = actions.sdl.setPreloadedPT + m.registerApp = actions.app.register + m.registerAppWOPTU = actions.app.registerNoPTU + m.activateApp = actions.app.activate + m.getMobileSession = actions.getMobileSession + m.getHMIConnection = actions.hmi.getConnection + m.getAppParams = actions.app.getParams + m.getConfigAppParams = actions.app.getParams + m.cloneTable = utils.cloneTable + m.start = actions.start + m.postconditions = actions.postconditions + m.policyTableUpdate = actions.policyTableUpdate + m.connectMobile = actions.mobile.connect + m.wait = utils.wait + m.spairs = utils.spairs + m.cprint = utils.cprint + m.json = actions.json +end + +--[[ Common Variables ]] +m.rpc = { + get = "GetVehicleData", + sub = "SubscribeVehicleData", + unsub = "UnsubscribeVehicleData", + on = "OnVehicleData" +} + +m.vd = { + vin = "", + gps = "VEHICLEDATA_GPS", + speed = "VEHICLEDATA_SPEED", + rpm = "VEHICLEDATA_RPM", + fuelLevel = "VEHICLEDATA_FUELLEVEL", + fuelLevel_State = "VEHICLEDATA_FUELLEVEL_STATE", + instantFuelConsumption = "VEHICLEDATA_FUELCONSUMPTION", + externalTemperature = "VEHICLEDATA_EXTERNTEMP", + prndl = "VEHICLEDATA_PRNDL", + tirePressure = "VEHICLEDATA_TIREPRESSURE", + odometer = "VEHICLEDATA_ODOMETER", + beltStatus = "VEHICLEDATA_BELTSTATUS", + bodyInformation = "VEHICLEDATA_BODYINFO", + deviceStatus = "VEHICLEDATA_DEVICESTATUS", + eCallInfo = "VEHICLEDATA_ECALLINFO", + airbagStatus = "VEHICLEDATA_AIRBAGSTATUS", + emergencyEvent = "VEHICLEDATA_EMERGENCYEVENT", + -- clusterModeStatus = "VEHICLEDATA_CLUSTERMODESTATUS", -- disabled due to issue: https://github.com/smartdevicelink/sdl_core/issues/3460 + myKey = "VEHICLEDATA_MYKEY", + driverBraking = "VEHICLEDATA_BRAKING", + wiperStatus = "VEHICLEDATA_WIPERSTATUS", + headLampStatus = "VEHICLEDATA_HEADLAMPSTATUS", + engineTorque = "VEHICLEDATA_ENGINETORQUE", + accPedalPosition = "VEHICLEDATA_ACCPEDAL", + steeringWheelAngle = "VEHICLEDATA_STEERINGWHEEL", + turnSignal = "VEHICLEDATA_TURNSIGNAL", + fuelRange = "VEHICLEDATA_FUELRANGE", + engineOilLife = "VEHICLEDATA_ENGINEOILLIFE", + electronicParkBrakeStatus = "VEHICLEDATA_ELECTRONICPARKBRAKESTATUS", + cloudAppVehicleID = "VEHICLEDATA_CLOUDAPPVEHICLEID", + handsOffSteering = "VEHICLEDATA_HANDSOFFSTEERING", + windowStatus = "VEHICLEDATA_WINDOWSTATUS", + gearStatus = "VEHICLEDATA_GEARSTATUS", + stabilityControlsStatus = "VEHICLEDATA_STABILITYCONTROLSSTATUS" +} + +m.operator = { + increase = 1, + decrease = -1 +} + +--[[ API Functions ]] + +math.randomseed(os.clock()) + +--[[ @split: Split input string by '.' into a few sub-strings +--! @parameters: +--! pStr: input string +--! @return: table with sub-strings +--]] +local function split(pStr) + local result = {} + for match in (pStr.."."):gmatch("(.-)%.") do + if string.len(match) > 0 then table.insert(result, match) end + end + return result +end + +--[[ @getParamValues: Generate VD parameter values bases on restrictions in API +-- Function iterates through all structs recursively +--! @parameters: +--! pParams: table with parameters +--! pCmnSchema: table with data representation of 'Common' interface +--! @return: table with VD parameters and values +--]] +function m.getParamValues(pParams, pCmnSchema) + local function getTypeValue(pData) + local itype = split(pData.type)[2] + local function getSimpleValue() + local tp = pData.type + local min = 1 + local max = 30 + -- set min/max restrictions + if tp == "Float" or tp == "Integer" then + if pData.minvalue ~= nil then min = pData.minvalue end + if pData.maxvalue ~= nil then max = pData.maxvalue end + end + if tp == "String" then + if pData.minlength ~= nil then min = pData.minlength end + if pData.maxlength ~= nil then max = pData.maxlength end + end + -- generate random value + if tp == "Boolean" then + return math.random(0, 1) == 1 + end + if tp == "Float" then + return tonumber(string.format('%.02f', math.random() + math.random(min, max-1))) + end + if tp == "Integer" then + return math.random(min, max) + end + if tp == "String" then + local length = math.random(min, max) + local res = "" + for _ = 1, length do + res = res .. string.char(math.random(97, 122)) -- [a-z] characters + end + return res + end + end + local function getEnumValue() + local data = {} + for k in m.spairs(pCmnSchema.enum[itype]) do + table.insert(data, k) + end + return data[math.random(1, #data)] + end + local function getStructValue() + return m.getParamValues(pCmnSchema.struct[itype].param, pCmnSchema) + end + if pCmnSchema.struct[itype] ~= nil then + return getStructValue() + elseif pCmnSchema.enum[itype] ~= nil then + return getEnumValue() + else + return getSimpleValue() + end + end + local function getArrayTypeValue(pData) + local min = 1 + local max = 5 + if pData.minsize ~= nil and pData.minsize > min then min = pData.minsize end + if pData.maxsize ~= nil and pData.maxsize < max then max = pData.maxsize end + local numOfItems = math.random(min, max) + local out = {} + for _ = 1, numOfItems do + table.insert(out, getTypeValue(pData, pCmnSchema)) + end + return out + end + local out = {} + for k, v in pairs(pParams) do + if v.array == false then + out[k] = getTypeValue(v) + else + out[k] = getArrayTypeValue(v) + end + end + return out +end + +--[[ @getParamValuesFromAPI: Generate VD parameter values bases on restrictions in API +-- This is a wrapper for 'm.getParamValues()' function +--! @parameters: +--! @return: table with VD parameters and values +--]] +local function getParamValuesFromAPI() + local viSchema = api.hmi.interface["VehicleInfo"] + local cmnSchema = api.hmi.interface["Common"] + local params = viSchema.type.response.functions.GetVehicleData.param + local paramValues = m.getParamValues(params, cmnSchema) + -- print not defined in API parameters + for k in pairs(m.vd) do + if not paramValues[k] then + m.cprint(color.magenta, "Not found in API VD parameter:", k) + end + end + -- remove disabled parameters + for k in pairs(paramValues) do + if not m.vd[k] then + paramValues[k] = nil + m.cprint(color.magenta, "Disabled VD parameter:", k) + end + end + return paramValues +end + +m.vdValues = getParamValuesFromAPI() + +--[[ @getMandatoryParamsFromAPI: Return VD parameters and values which has mandatory sub-parameters defined in API +--! @parameters: +--! @return: table with VD parameters and values +--]] +local function getMandatoryParamsFromAPI() + local out = {} + local viSchema = api.hmi.interface["VehicleInfo"] + local cmnSchema = api.hmi.interface["Common"] + local params = viSchema.type.response.functions.GetVehicleData.param + for k, v in pairs(params) do + local iface = split(v.type)[1] + local itype = split(v.type)[2] + if iface == "Common" then + if cmnSchema.struct[itype] ~= nil then + for k2, v2 in pairs(cmnSchema.struct[itype].param) do + if v2.mandatory == "true" and m.vd[k] then + if out[k] == nil then out[k] = { sub = {}, array = false } end + if v.array == "true" then out[k].array = true end + table.insert(out[k].sub, k2) + end + end + end + end + end + return out +end + +m.mandatoryVD = getMandatoryParamsFromAPI() + +--[[ @getVersioningParamsFromAPI: Return VD parameters and values which has version defined in API +--! @parameters: +--! @return: table with VD parameters and values +--]] +local function getVersioningParamsFromAPI() + local out = {} + local schema = api.mob.interface[next(api.mob.interface)] + local params = schema.type.request.functions.GetVehicleData.param + for k, v in pairs(params) do + if v.since ~= nil and m.vd[k] and v.deprecated ~= "true" then out[k] = v.since end + end + return out +end + +m.versioningVD = getVersioningParamsFromAPI() + +--[[ Common Functions ]] + +--[[ @updatePreloadedPTFile: Update preloaded file with additional permissions +--! @parameters: +--! pGroup: table with additional updates (optional) +--! @return: none +--]] +local function updatePreloadedPTFile(pGroup) + local params = { } + for param in pairs(m.vd) do + table.insert(params, param) + end + local rpcs = { "GetVehicleData", "OnVehicleData", "SubscribeVehicleData", "UnsubscribeVehicleData" } + local levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" } + local pt = actions.sdl.getPreloadedPT() + if not pGroup then + pGroup = { + rpcs = {} + } + for _, rpc in pairs(rpcs) do + pGroup.rpcs[rpc] = { + hmi_levels = levels, + parameters = params + } + end + end + pt.policy_table.functional_groupings["VDGroup"] = pGroup + pt.policy_table.app_policies["default"].groups = { "Base-4", "VDGroup" } + pt.policy_table.functional_groupings["DataConsent-2"].rpcs = json.null + actions.sdl.setPreloadedPT(pt) +end + +--[[ @preconditions: Clean environment, optional backup and update of sdl_preloaded_pt.json file +--! @parameters: +--! pGroup: data for updating sdl_preloaded_pt.json file +--! @return: none +--]] +function m.preconditions(pGroup) + actions.preconditions() + updatePreloadedPTFile(pGroup) +end + +--[[ @setHashId: Set hashId value which is required during resumption +--! @parameters: +--! pHashValue: application hashId +--! pAppId: application number (1, 2, etc.) +--! @return: none +--]] +function m.setHashId(pHashValue, pAppId) + hashId[pAppId] = pHashValue +end + +--[[ @getHashId: Get hashId value of an app which is required during resumption +--! @parameters: +--! pAppId: application number (1, 2, etc.) +--! @return: app's hashId +--]] +function m.getHashId(pAppId) + return hashId[pAppId] +end + +--[[ @getVDParams: Return VD parameters and values +--! @parameters: +--! pIsSubscribable: true if parameter is available for subscription, otherwise - false +--! @return: table with VD parameters and values +--]] +function m.getVDParams(pIsSubscribable) + if pIsSubscribable == nil then return m.vdValues end + local out = {} + for param in pairs(m.vd) do + if pIsSubscribable == (m.vd[param] ~= "") then out[param] = m.vdValues[param] end + end + return out +end + +--[[ @getMandatoryOnlyCases: Return cases for VD parameter where only mandatory sub-parameters are defined +--! @parameters: +--! pParam: name of the VD parameter +--! @return: table with test cases where key is name of test case and value is VD parameter with value +--]] +function m.getMandatoryOnlyCases(pParam) + local out = {} + local value = utils.cloneTable(m.vdValues[pParam]) + local mnd = m.mandatoryVD[pParam] + local to_upd = value + if mnd.array then + value = { value[1] } + to_upd = value[1] + end + for k in pairs(to_upd) do + if not utils.isTableContains(mnd.sub, k) then + to_upd[k] = nil + end + end + out["mandatory"] = value + return out +end + +--[[ @getMandatoryMissingCases: Return cases for VD parameter where one mandatory sub-parameter is missing +--! @parameters: +--! pParam: name of the VD parameter +--! @return: table with test cases where key is name of test case and value is VD parameter with value +--]] +function m.getMandatoryMissingCases(pParam) + local out = {} + local mnd = m.mandatoryVD[pParam] + for _, k in pairs(mnd.sub) do + local value = utils.cloneTable(m.vdValues[pParam]) + local to_upd = value + if mnd.array then + value = { value[1] } + to_upd = value[1] + end + for j in pairs(to_upd) do + if j == k then to_upd[k] = nil end + end + out["missing_" .. k] = value + end + return out +end + +--[[ @getVehicleData: Successful processing of GetVehicleData RPC +--! @parameters: +--! pParam: name of the VD parameter +--! pValue: data for HMI response +--! @return: none +--]] +function m.getVehicleData(pParam, pValue) + if pValue == nil then pValue = m.vdValues[pParam] end + local cid = m.getMobileSession():SendRPC("GetVehicleData", { [pParam] = true }) + m.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", { [pParam] = true }) + :Do(function(_, data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { [pParam] = pValue }) + end) + m.getMobileSession():ExpectResponse(cid, + { success = true, resultCode = "SUCCESS", [pParam] = pValue }) +end + +--[[ @processRPCFailure: Processing VehicleData RPC with ERROR resultCode +--! @parameters: +--! pRPC: RPC for mobile request +--! pParam: name of the VD parameter +--! pResult: expected result code +--! pRequestValue: data for App request +--! @return: none +--]] +function m.processRPCFailure(pRPC, pParam, pResult, pRequestValue) + if pRequestValue == nil then pRequestValue = true end + local cid = m.getMobileSession():SendRPC(pRPC, { [pParam] = pRequestValue }) + m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC):Times(0) + m.getMobileSession():ExpectResponse(cid, { success = false, resultCode = pResult }) +end + +--[[ @processRPCgenericError: Processing VehicleData RPC with invalid HMI response +--! @parameters: +--! pRPC: RPC for mobile request +--! pParam: name of the VD parameter +--! pValue: data for HMI response +--! @return: none +--]] +function m.processRPCgenericError(pRPC, pParam, pValue) + local cid = m.getMobileSession():SendRPC(pRPC, { [pParam] = true }) + m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC, { [pParam] = true }) + :Do(function(_,data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { [pParam] = pValue }) + end) + m.getMobileSession():ExpectResponse(cid, { success = false, resultCode = "GENERIC_ERROR" }) +end + +--[[ @getInvalidData: Return invalid value bases on valid one +--! @parameters: +--! pData: valid value +--! @return: invalid value +--]] +function m.getInvalidData(pData) + if type(pData) == "boolean" then return 123 end + if type(pData) == "number" then return true end + if type(pData) == "string" then return false end + if type(pData) == "table" then + for k, v in pairs(pData) do + pData[k] = m.getInvalidData(v) + end + return pData + end +end + +--[[ @processSubscriptionRPC: Processing SubscribeVehicleData and UnsubscribeVehicleData RPCs +--! @parameters: +--! pRPC: RPC for mobile request +--! pParam: name of the VD parameter +--! pAppId: application number (1, 2, etc.) +--! isRequestOnHMIExpected: if true or omitted VI.Sub/UnsubscribeVehicleData request is expected on HMI, +--! otherwise - not expected +--! @return: none +--]] +function m.processSubscriptionRPC(pRPC, pParam, pAppId, isRequestOnHMIExpected) + if pAppId == nil then pAppId = 1 end + if isRequestOnHMIExpected == nil then isRequestOnHMIExpected = true end + local response = { + dataType = m.vd[pParam], + resultCode = "SUCCESS" + } + local responseParam = pParam + if pParam == "clusterModeStatus" then responseParam = "clusterModes" end + local cid = m.getMobileSession(pAppId):SendRPC(pRPC, { [pParam] = true }) + if isRequestOnHMIExpected == true then + m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC, { [pParam] = true }) + :Do(function(_,data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { [responseParam] = response }) + end) + else + m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRPC):Times(0) + end + m.getMobileSession(pAppId):ExpectResponse(cid, + { success = true, resultCode = "SUCCESS", [responseParam] = response }) + m.getMobileSession(pAppId):ExpectNotification("OnHashChange") + :Do(function(_, data) + m.setHashId(data.payload.hashID, pAppId) + end) +end + +--[[ @sendOnVehicleData: Processing OnVehicleData RPC +--! @parameters: +--! pParam: name of the VD parameter +--! pExpTime: number of notifications (0, 1 or more) +--! pValue: data for the notification +--! @return: none +--]] +function m.sendOnVehicleData(pParam, pExpTime, pValue) + if pExpTime == nil then pExpTime = 1 end + if pValue == nil then pValue = m.vdValues[pParam] end + m.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", { [pParam] = pValue }) + m.getMobileSession():ExpectNotification("OnVehicleData", { [pParam] = pValue }) + :Times(pExpTime) +end + +--[[ @sendOnVehicleDataTwoApps: Processing OnVehicleData RPC for two apps +--! @parameters: +--! pParam: name of the VD parameter +--! pExpTimesApp1: number of notifications for 1st app +--! pExpTimesApp2: number of notifications for 2nd app +--! @return: none +--]] +function m.sendOnVehicleDataTwoApps(pParam, pExpTimesApp1, pExpTimesApp2) + local value = m.vdValues[pParam] + m.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", { [pParam] = value }) + m.getMobileSession(1):ExpectNotification("OnVehicleData", { [pParam] = value }) + :Times(pExpTimesApp1) + m.getMobileSession(2):ExpectNotification("OnVehicleData", { [pParam] = value }) + :Times(pExpTimesApp2) +end + +--[[ @unexpectedDisconnect: Unexpected disconnect sequence +--! @parameters: +--! pParam: name of the VD parameter +--! @return: none +--]] +function m.unexpectedDisconnect(pParam) + m.getHMIConnection():ExpectNotification("BasicCommunication.OnAppUnregistered", { unexpectedDisconnect = true }) + :Times(actions.mobile.getAppsCount()) + if pParam then + m.getHMIConnection():ExpectRequest("VehicleInfo.UnsubscribeVehicleData", { [pParam] = true }) + end + actions.mobile.disconnect() + utils.wait(1000) +end + +--[[ @ignitionOff: Ignition Off sequence +--! @parameters: +--! pParam: name of the VD parameter +--! @return: none +--]] +function m.ignitionOff(pParam) + local isOnSDLCloseSent = false + m.getHMIConnection():SendNotification("BasicCommunication.OnExitAllApplications", { reason = "SUSPEND" }) + m.getHMIConnection():ExpectNotification("BasicCommunication.OnSDLPersistenceComplete") + :Do(function() + m.getHMIConnection():ExpectRequest("VehicleInfo.UnsubscribeVehicleData", { [pParam] = true }) + m.getHMIConnection():SendNotification("BasicCommunication.OnExitAllApplications", { reason = "IGNITION_OFF" }) + m.getHMIConnection():ExpectNotification("BasicCommunication.OnSDLClose") + :Do(function() + isOnSDLCloseSent = true + SDL.DeleteFile() + end) + end) + m.wait(3000) + :Do(function() + if isOnSDLCloseSent == false then m.cprint(color.magenta, "BC.OnSDLClose was not sent") end + for i = 1, actions.mobile.getAppsCount() do + actions.mobile.deleteSession(i) + end + StopSDL() + end) +end + +--[[ @registerAppWithResumption: Successful app registration with resumption +--! @parameters: +--! pParam: name of the VD parameter +--! pAppId: application number (1, 2, etc.) +--! isRequestOnHMIExpected: if true VD.SubscribeVehicleData request is expected on HMI, otherwise - not expected +--! @return: none +--]] +function m.registerAppWithResumption(pParam, pAppId, isRequestOnHMIExpected) + if not pAppId then pAppId = 1 end + local response = { + dataType = m.vd[pParam], + resultCode = "SUCCESS" + } + local responseParam = pParam + if pParam == "clusterModeStatus" then responseParam = "clusterModes" end + m.getMobileSession(pAppId):StartService(7) + :Do(function() + local appParams = utils.cloneTable(actions.app.getParams(pAppId)) + appParams.hashID = m.getHashId(pAppId) + local corId = m.getMobileSession(pAppId):SendRPC("RegisterAppInterface", appParams) + m.getHMIConnection():ExpectNotification("BasicCommunication.OnAppRegistered") + :Do(function() + if isRequestOnHMIExpected == true then + m.getHMIConnection():ExpectRequest("VehicleInfo.SubscribeVehicleData", { [pParam] = true }) + :Do(function(_, data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { [responseParam] = response }) + end) + else + m.getHMIConnection():ExpectRequest("VehicleInfo.SubscribeVehicleData"):Times(0) + end + end) + m.getMobileSession(pAppId):ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) + :Do(function() + m.getMobileSession(pAppId):ExpectNotification("OnPermissionsChange") + end) + end) +end + +--[[ @setAppVersion: Set application version based on VD parameter version +--! @parameters: +--! pParamVersion: version of the VD parameter +--! pOperator: operator to get target app version (increase or decrease) +--! @return: none +--]] +function m.setAppVersion(pParamVersion, pOperator) + m.cprint(color.magenta, "Param version:", pParamVersion) + local major = tonumber(split(pParamVersion)[1]) or 0 + local minor = tonumber(split(pParamVersion)[2]) or 0 + local patch = tonumber(split(pParamVersion)[3]) or 0 + local ver = (major*100 + minor*10 + patch) + pOperator + if ver < 450 then ver = 450 end + ver = tostring(ver) + major = tonumber(string.sub(ver, 1, 1)) + minor = tonumber(string.sub(ver, 2, 2)) + patch = tonumber(string.sub(ver, 3, 3)) + m.cprint(color.magenta, "App version:", major .. "." .. minor .. "." .. patch) + actions.app.getParams().syncMsgVersion.majorVersion = major + actions.app.getParams().syncMsgVersion.minorVersion = minor + actions.app.getParams().syncMsgVersion.patchVersion = patch +end + +return m diff --git a/test_scripts/API/VehicleData/commonVehicleData.lua b/test_scripts/API/VehicleData/commonVehicleData.lua deleted file mode 100644 index 6e63d42435..0000000000 --- a/test_scripts/API/VehicleData/commonVehicleData.lua +++ /dev/null @@ -1,394 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- VehicleData common module ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local actions = require("user_modules/sequences/actions") -local runner = require('user_modules/script_runner') -local utils = require("user_modules/utils") -local sdl = require("SDL") - ---[[ Test Configuration ]] -runner.testSettings.isSelfIncluded = false -config.defaultProtocolVersion = 2 - ---[[ Local Variables ]] -local m = {} - -m.allVehicleData = { - gps = { - value = { - longitudeDegrees = 100, - latitudeDegrees = 20.5, - utcYear = 2020, - utcMonth = 6, - utcDay = 3, - utcHours = 14, - utcMinutes = 4, - utcSeconds = 34, - pdop = 10, - hdop = 100, - vdop = 500, - actual = false, - compassDirection = "WEST", - dimension = "2D", - satellites = 5, - altitude = 10, - heading = 100.9, - speed = 40.5 - }, - type = "VEHICLEDATA_GPS" - }, - speed = { - value = 30.2, - type = "VEHICLEDATA_SPEED" - }, - rpm = { - value = 10, - type = "VEHICLEDATA_RPM" - }, - fuelLevel = { - value = -3, - type = "VEHICLEDATA_FUELLEVEL" - }, - fuelLevel_State = { - value = "NORMAL", - type = "VEHICLEDATA_FUELLEVEL_STATE" - }, - instantFuelConsumption = { - value = 1000.1, - type = "VEHICLEDATA_FUELCONSUMPTION" - }, - fuelRange = { - value = { { type = "GASOLINE" , range = 20 }, { type = "BATTERY", range = 100 } }, - type = "VEHICLEDATA_FUELRANGE" - }, - externalTemperature = { - value = 24.1, - type = "VEHICLEDATA_EXTERNTEMP" - }, - turnSignal = { - value = "OFF", - type = "VEHICLEDATA_TURNSIGNAL" - }, - vin = { - value = "SJFHSIGD4058569", - type = "VEHICLEDATA_VIN" - }, - prndl = { - value = "PARK", - type = "VEHICLEDATA_PRNDL" - }, - tirePressure = { - value = { - pressureTelltale = "OFF", - leftFront = { - status = "NORMAL", - tpms = "UNKNOWN", - pressure = 1000 - }, - rightFront = { - status = "NORMAL", - tpms = "UNKNOWN", - pressure = 1000 - }, - leftRear = { - status = "NORMAL", - tpms = "UNKNOWN", - pressure = 1000 - }, - rightRear = { - status = "NORMAL", - tpms = "UNKNOWN", - pressure = 1000 - }, - innerLeftRear = { - status = "NORMAL", - tpms = "UNKNOWN", - pressure = 1000 - }, - innerRightRear = { - status = "NORMAL", - tpms = "UNKNOWN", - pressure = 1000 - } - }, - type = "VEHICLEDATA_TIREPRESSURE" - }, - odometer = { - value = 10000, - type = "VEHICLEDATA_ODOMETER" - }, - beltStatus = { - value = { - driverBeltDeployed = "NO_EVENT", - passengerBeltDeployed = "NO_EVENT", - passengerBuckleBelted = "NO_EVENT", - driverBuckleBelted = "NO_EVENT", - leftRow2BuckleBelted = "YES", - passengerChildDetected = "YES", - rightRow2BuckleBelted = "YES", - middleRow2BuckleBelted = "NO", - middleRow3BuckleBelted = "NO", - leftRow3BuckleBelted = "NOT_SUPPORTED", - rightRow3BuckleBelted = "NOT_SUPPORTED", - leftRearInflatableBelted = "NOT_SUPPORTED", - rightRearInflatableBelted = "FAULT", - middleRow1BeltDeployed = "NO_EVENT", - middleRow1BuckleBelted = "NO_EVENT" - }, - type = "VEHICLEDATA_BELTSTATUS" - }, - bodyInformation = { - value = { - parkBrakeActive = true, - ignitionStableStatus = "IGNITION_SWITCH_STABLE", - ignitionStatus = "RUN", - driverDoorAjar = true, - passengerDoorAjar = false, - rearLeftDoorAjar = false, - rearRightDoorAjar = false - }, - type = "VEHICLEDATA_BODYINFO" - }, - deviceStatus = { - value = { - voiceRecOn = true, - btIconOn = false, - callActive = false, - phoneRoaming = true, - textMsgAvailable = false, - battLevelStatus = "NOT_PROVIDED", - stereoAudioOutputMuted = false, - monoAudioOutputMuted = false, - signalLevelStatus = "NOT_PROVIDED", - primaryAudioSource = "CD", - eCallEventActive = false - }, - type = "VEHICLEDATA_DEVICESTATUS" - }, - driverBraking = { - value = "NO_EVENT", - type = "VEHICLEDATA_BRAKING" - }, - wiperStatus = { - value = "AUTO_OFF", - type = "VEHICLEDATA_WIPERSTATUS" - }, - headLampStatus = { - value = { - ambientLightSensorStatus = "NIGHT", - highBeamsOn = true, - lowBeamsOn = false - }, - type = "VEHICLEDATA_HEADLAMPSTATUS" - }, - engineTorque = { - value = 24.5, - type = "VEHICLEDATA_ENGINETORQUE" - }, - accPedalPosition = { - value = 10, - type = "VEHICLEDATA_ACCPEDAL" - }, - steeringWheelAngle = { - value = -100, - type = "VEHICLEDATA_STEERINGWHEEL" - }, - engineOilLife = { - value = 10.5, - type = "VEHICLEDATA_ENGINEOILLIFE" - }, - electronicParkBrakeStatus = { - value = "OPEN", - type = "VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" - }, - cloudAppVehicleID = { - value = "GHF5848363FGHY90034847", - type = "VEHICLEDATA_CLOUDAPPVEHICLEID" - }, - eCallInfo = { - value = { - eCallNotificationStatus = "NOT_USED", - auxECallNotificationStatus = "NOT_USED", - eCallConfirmationStatus = "NORMAL" - }, - type = "VEHICLEDATA_ECALLINFO" - }, - airbagStatus = { - value = { - driverAirbagDeployed = "NO_EVENT", - driverSideAirbagDeployed = "NO_EVENT", - driverCurtainAirbagDeployed = "NO_EVENT", - passengerAirbagDeployed = "NO_EVENT", - passengerCurtainAirbagDeployed = "NO_EVENT", - driverKneeAirbagDeployed = "NO_EVENT", - passengerSideAirbagDeployed = "NO_EVENT", - passengerKneeAirbagDeployed = "NO_EVENT" - }, - type = "VEHICLEDATA_AIRBAGSTATUS" - }, - emergencyEvent = { - value = { - emergencyEventType = "NO_EVENT", - fuelCutoffStatus = "NORMAL_OPERATION", - rolloverEvent = "NO", - maximumChangeVelocity = 0, - multipleEvents = "NO" - }, - type = "VEHICLEDATA_EMERGENCYEVENT" - }, - clusterModeStatus = { - value = { - powerModeActive = true, - powerModeQualificationStatus = "POWER_MODE_OK", - carModeStatus = "NORMAL", - powerModeStatus = "KEY_APPROVED_0" - }, - type = "VEHICLEDATA_CLUSTERMODESTATUS" - }, - myKey = { - value = { e911Override = "ON" }, - type = "VEHICLEDATA_MYKEY" - } -} - -m.EMPTY_ARRAY = actions.json.EMPTY_ARRAY - ---[[ Shared Functions ]] -m.Title = runner.Title -m.Step = runner.Step -m.preconditions = actions.preconditions -m.postconditions = actions.postconditions -m.start = actions.start -m.activateApp = actions.activateApp -m.getMobileSession = actions.getMobileSession -m.getHMIConnection = actions.getHMIConnection -m.registerApp = actions.registerApp -m.registerAppWOPTU = actions.registerAppWOPTU -m.policyTableUpdate = actions.policyTableUpdate -m.getConfigAppParams = actions.getConfigAppParams -m.wait = utils.wait -m.extendedPolicy = sdl.buildOptions.extendedPolicy -m.setSDLIniParameter = actions.setSDLIniParameter -m.cloneTable = utils.cloneTable -m.cprint = utils.cprint -m.getPreloadedPT = actions.sdl.getPreloadedPT -m.setPreloadedPT = actions.sdl.setPreloadedPT - ---[[ Common Functions ]] -local function getVDParams() - local out = {} - for k in pairs(m.allVehicleData) do - table.insert(out, k) - end - return out -end - -function m.ptUpdate(pTbl) - pTbl.policy_table.app_policies[m.getConfigAppParams().fullAppID].groups = { "Base-4", "Emergency-1" } - local grp = pTbl.policy_table.functional_groupings["Emergency-1"] - for _, v in pairs(grp.rpcs) do - v.parameters = getVDParams() - end - pTbl.policy_table.vehicle_data = nil -end - -function m.ptUpdateMin(pTbl) - pTbl.policy_table.app_policies[m.getConfigAppParams().fullAppID].groups = { "Base-4", "Emergency-1" } - local grp = pTbl.policy_table.functional_groupings["Emergency-1"] - for _, v in pairs(grp.rpcs) do - v.parameters = { - "gps" - } - end - pTbl.policy_table.vehicle_data = nil -end - -function m.processRPCSubscriptionSuccess(pRpcName, pData) - local reqParams = { - [pData] = true - } - local respData - if pData == "clusterModeStatus" then - respData = "clusterModes" - else - respData = pData - end - local hmiResParams = { - [respData] = { - resultCode = "SUCCESS", - dataType = m.allVehicleData[pData].type - } - } - local cid = m.getMobileSession():SendRPC(pRpcName, reqParams) - m.getHMIConnection():ExpectRequest("VehicleInfo." .. pRpcName, reqParams) - :Do(function(_, data) - m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", hmiResParams) - end) - local mobResParams = m.cloneTable(hmiResParams) - mobResParams.success = true - mobResParams.resultCode = "SUCCESS" - m.getMobileSession():ExpectResponse(cid, mobResParams) -end - -function m.checkNotificationSuccess(pData) - local hmiNotParams = { [pData] = m.allVehicleData[pData].value } - local mobNotParams = m.cloneTable(hmiNotParams) - m.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", hmiNotParams) - m.getMobileSession():ExpectNotification("OnVehicleData", mobNotParams) -end - -function m.checkNotificationIgnored(pData) - local hmiNotParams = { [pData] = m.allVehicleData[pData].value } - m.getHMIConnection():SendNotification("VehicleInfo.OnVehicleData", hmiNotParams) - m.getMobileSession():ExpectNotification("OnVehicleData") - :Times(0) -end - -function m.updatePreloadedFile(pUpdateFunc) - local pt = m.getPreloadedPT() - pt.policy_table.functional_groupings["DataConsent-2"].rpcs = utils.json.null - pUpdateFunc(pt) - m.setPreloadedPT(pt) -end - -function m.processGetVDsuccess(pData) - local reqParams = { - [pData] = true - } - local hmiResParams = { - [pData] = m.allVehicleData[pData].value - } - local cid = m.getMobileSession():SendRPC("GetVehicleData", reqParams) - m.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", reqParams) - :Do(function(_, data) - m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", hmiResParams) - end) - local mobResParams = m.cloneTable(hmiResParams) - mobResParams.success = true - mobResParams.resultCode = "SUCCESS" - m.getMobileSession():ExpectResponse(cid, mobResParams) -end - -function m.processGetVDunsuccess(pData) - local reqParams = { - [pData] = true - } - local cid = m.getMobileSession():SendRPC("GetVehicleData", reqParams) - m.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", reqParams) :Times(0) - m.getMobileSession():ExpectResponse(cid, { resultCode = "INVALID_DATA", success = false }) -end - -function m.processGetVDwithCustomDataSuccess() - local cid = m.getMobileSession():SendRPC("GetVehicleData", { custom_vd_item1_integer = true }) - m.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", { OEM_REF_INT = true }) - :Do(function(_, data) - m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { OEM_REF_INT = 10 }) - end) - local mobResParams = { custom_vd_item1_integer = 10 } - mobResParams.success = true - mobResParams.resultCode = "SUCCESS" - m.getMobileSession():ExpectResponse(cid, mobResParams) -end - -return m diff --git a/test_sets/SDL5_0/audio_source_am_fm_xm.txt b/test_sets/SDL5_0/audio_source_am_fm_xm.txt index 8e8a16b590..2e38a4b5a4 100644 --- a/test_sets/SDL5_0/audio_source_am_fm_xm.txt +++ b/test_sets/SDL5_0/audio_source_am_fm_xm.txt @@ -5,5 +5,5 @@ ./test_scripts/RC/AUDIO_LIGHT_HMI_SETTINGS/SetInteriorVehicleData/011_Change_audio_source_in_BACKGROUND.lua ./test_scripts/RC/AUDIO_LIGHT_HMI_SETTINGS/SetInteriorVehicleData/012_Change_audio_source_in_FULL_rc_non_media_app.lua ./test_scripts/RC/AUDIO_LIGHT_HMI_SETTINGS/SetInteriorVehicleData/017_Change_audio_source_from_any_type_except_MOBILE_APP_keepContext_true.lua -./test_scripts/API/VehicleData/GetVehicleData/004_Success_deviceStatus_primaryAudioSource.lua -./test_scripts/API/VehicleData/OnVehicleData/005_Success_flow_deviceStatus_primaryAudioSource.lua +./test_scripts/API/VehicleData/AudioSource/001_Success_deviceStatus_primaryAudioSource.lua +./test_scripts/API/VehicleData/AudioSource/002_Success_flow_deviceStatus_primaryAudioSource.lua diff --git a/test_sets/SDL5_0/vehicle_data.txt b/test_sets/SDL5_0/vehicle_data.txt index 1a84d6bbce..5effd3f305 100644 --- a/test_sets/SDL5_0/vehicle_data.txt +++ b/test_sets/SDL5_0/vehicle_data.txt @@ -1,16 +1,36 @@ -./test_scripts/API/VehicleData/GetVehicleData/001_Success_flow.lua -./test_scripts/API/VehicleData/GetVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua -./test_scripts/API/VehicleData/GetVehicleData/003_GetVD_gps_mandatory_parameters.lua -./test_scripts/API/VehicleData/GetVehicleData/004_Success_deviceStatus_primaryAudioSource.lua -./test_scripts/API/VehicleData/OnVehicleData/001_Success_flow.lua -./test_scripts/API/VehicleData/OnVehicleData/002_NotificationForUnsubsribedParameter_Ignored_flow.lua -./test_scripts/API/VehicleData/OnVehicleData/003_NotificationParameterDisallowedByPolicies_Ignored_flow.lua -./test_scripts/API/VehicleData/OnVehicleData/004_OnVD_gps_mandatory_parameters.lua -./test_scripts/API/VehicleData/OnVehicleData/005_Success_flow_deviceStatus_primaryAudioSource.lua -./test_scripts/API/VehicleData/SubscribeVehicleData/001_Success_flow.lua -./test_scripts/API/VehicleData/SubscribeVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua -./test_scripts/API/VehicleData/SubscribeVehicleData/003_RPC_parameter_already_subscribed_Result_IGNORED_flow.lua -./test_scripts/API/VehicleData/UnsubscribeVehicleData/001_Success_flow.lua -./test_scripts/API/VehicleData/UnsubscribeVehicleData/002_RPC_parameter_not_yet_subscribed_IGNORED_flow.lua -./test_scripts/API/VehicleData/UnsubscribeVehicleData/003_RPC_parameter_already_unsubscribed_Result_IGNORED_flow.lua -./test_scripts/API/VehicleData/UnsubscribeVehicleData/004_RPC_parameter_disallowed_by_policies_Result_DISALLOWED_flow.lua +./test_scripts/API/VehicleData/AudioSource/001_Success_deviceStatus_primaryAudioSource.lua +./test_scripts/API/VehicleData/AudioSource/002_Success_flow_deviceStatus_primaryAudioSource.lua +./test_scripts/API/VehicleData/GetVehicleData/001_GetVD_Success_flow.lua +./test_scripts/API/VehicleData/GetVehicleData/002_GetVD_disallowed.lua +./test_scripts/API/VehicleData/GetVehicleData/003_GetVD_disallowed_after_PTU.lua +./test_scripts/API/VehicleData/GetVehicleData/004_GetVD_HMI_responds_with_invalid_data.lua +./test_scripts/API/VehicleData/GetVehicleData/005_GetVD_App_sends_invalid_request.lua +./test_scripts/API/VehicleData/GetVehicleData/006_GetVD_mandatory_parameters.lua +./test_scripts/API/VehicleData/GetVehicleData/007_GetVD_app_version_is_greater_than_parameter_version.lua +./test_scripts/API/VehicleData/GetVehicleData/008_GetVD_app_version_is_less_than_parameter_version.lua +./test_scripts/API/VehicleData/OnVehicleData/001_OnVD_Success.lua +;./test_scripts/API/VehicleData/OnVehicleData/002_OnVD_disallowed.lua https://github.com/smartdevicelink/sdl_core/issues/3365 +;./test_scripts/API/VehicleData/OnVehicleData/003_OnVD_disallowed_after_PTU.lua https://github.com/smartdevicelink/sdl_core/issues/3365 +./test_scripts/API/VehicleData/OnVehicleData/004_OnVD_with_invalid_data.lua +./test_scripts/API/VehicleData/OnVehicleData/005_OnVD_App_is_not_subscribed.lua +./test_scripts/API/VehicleData/OnVehicleData/006_OnVD_mandatory_parameters.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/001_SubscribeVD_Success.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/002_SubscribeVD_disallowed.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/003_SubscribeVD_disallowed_after_PTU.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/004_SubscribeVD_HMI_responds_with_invalid_data.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/005_SubscribeVD_App_sends_invalid_request.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/006_SubscribeVD_2nd_request_IGNORED.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/007_SubscribeVD_for_2_apps.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/008_SubscribeVD_HMI_responds_with_not_success_codes.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/009_SubscribeVD_Resumption_of_subscription_Unexpected_Disconnect.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/010_SubscribeVD_Resumption_of_subscription_Ignition_Cycle.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/011_SubscribeVD_Resumption_of_subscription_for_2_apps_Unexpected_Disconnect.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/012_SubscribeVD_Resumption_of_subscription_for_2_apps_Ignition_Cycle.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/001_UnsubscribeVD_Success.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/002_UnsubscribeVD_disallowed.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/003_UnsubscribeVD_disallowed_after_PTU.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/004_UnsubscribeVD_HMI_responds_with_invalid_data.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/005_UnsubscribeVD_App_sends_invalid_request.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/006_UnsubscribeVD_2nd_request_IGNORED.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/007_UnsubscribeVD_for_2_apps.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/008_UnsubscribeVD_HMI_responds_with_not_success_codes.lua diff --git a/test_sets/new_vehicle_data_hands_off_steering.txt b/test_sets/new_vehicle_data_hands_off_steering.txt deleted file mode 100644 index 24de82747f..0000000000 --- a/test_sets/new_vehicle_data_hands_off_steering.txt +++ /dev/null @@ -1,33 +0,0 @@ -./test_scripts/API/VehicleData/HandsOffSteering/001_GetVD_Success_flow.lua -./test_scripts/API/VehicleData/HandsOffSteering/002_GetVD_disallowed.lua -./test_scripts/API/VehicleData/HandsOffSteering/003_GetVD_disallowed_after_PTU.lua -./test_scripts/API/VehicleData/HandsOffSteering/004_GetVD_HMI_responds_with_invalid_data.lua -./test_scripts/API/VehicleData/HandsOffSteering/005_GetVD_App_sends_invalid_request.lua -./test_scripts/API/VehicleData/HandsOffSteering/006_SubscribeVD_Success.lua -./test_scripts/API/VehicleData/HandsOffSteering/007_SubscribeVD_disallowed.lua -./test_scripts/API/VehicleData/HandsOffSteering/008_SubscribeVD_disallowed_after_PTU.lua -;./test_scripts/API/VehicleData/HandsOffSteering/009_SubscribeVD_not_success_codes_for_handsOffSteering_data.lua https://github.com/smartdevicelink/sdl_core/issues/3384 -./test_scripts/API/VehicleData/HandsOffSteering/010_SubscribeVD_HMI_responds_with_invalid_data.lua -./test_scripts/API/VehicleData/HandsOffSteering/011_SubscribeVD_App_sends_invalid_request.lua -./test_scripts/API/VehicleData/HandsOffSteering/012_SubscribeVD_for_two_Apps.lua -./test_scripts/API/VehicleData/HandsOffSteering/013_UnsubscribeVD_Success.lua -./test_scripts/API/VehicleData/HandsOffSteering/014_UnsubscribeVD_disallowed.lua -./test_scripts/API/VehicleData/HandsOffSteering/015_UnsubscribeVD_disallowed_after_PTU.lua -;./test_scripts/API/VehicleData/HandsOffSteering/016_UnsubscribeVD_not_success_codes_for_handsOffSteering_data.lua https://github.com/smartdevicelink/sdl_core/issues/3384 -./test_scripts/API/VehicleData/HandsOffSteering/017_UnsubscribeVD_HMI_responds_with_invalid_data.lua -./test_scripts/API/VehicleData/HandsOffSteering/018_UnsubscribeVD_App_sends_invalid_request.lua -./test_scripts/API/VehicleData/HandsOffSteering/019_UnsubscribeVD_for_two_Apps.lua -./test_scripts/API/VehicleData/HandsOffSteering/020_OnVD_notification_Success.lua -;./test_scripts/API/VehicleData/HandsOffSteering/021_OnVD_notification_disallowed.lua https://github.com/smartdevicelink/sdl_core/issues/3365 -;./test_scripts/API/VehicleData/HandsOffSteering/022_OnVD_disallowed_after_PTU.lua https://github.com/smartdevicelink/sdl_core/issues/3365 -./test_scripts/API/VehicleData/HandsOffSteering/023_OnVD_notification_with_invalid_data.lua -./test_scripts/API/VehicleData/HandsOffSteering/024_OnVD_notification_App_is_not_subscribed.lua -./test_scripts/API/VehicleData/HandsOffSteering/025_OnVD_notification_for_two_Apps.lua -./test_scripts/API/VehicleData/HandsOffSteering/026_handsOffSteering_parameter_processing_in_case_app_version_is_greater_than_parameter_version.lua -./test_scripts/API/VehicleData/HandsOffSteering/027_handsOffSteering_parameter_processing_in_case_app_version_is_less_than_parameter_version.lua -./test_scripts/API/VehicleData/HandsOffSteering/028_SubscribeVD_during_resumption_unexpected_disconnect.lua -./test_scripts/API/VehicleData/HandsOffSteering/029_SubscribeVD_during_resumption_IGN_OFF_ON.lua -./test_scripts/API/VehicleData/HandsOffSteering/030_SubscribeVD_during_resumption_unexpected_disconnect_for_two_Apps.lua -./test_scripts/API/VehicleData/HandsOffSteering/031_SubscribeVD_during_resumption_IGN_OFF_ON_for_two_Apps.lua -./test_scripts/API/VehicleData/HandsOffSteering/032_SubscribeVD_IGNORED_app_already_subscribed.lua -./test_scripts/API/VehicleData/HandsOffSteering/033_UnsubscribeVD_IGNORED_app_already_unsubscribed.lua diff --git a/test_sets/vehicle_data.txt b/test_sets/vehicle_data.txt index 1a84d6bbce..5effd3f305 100644 --- a/test_sets/vehicle_data.txt +++ b/test_sets/vehicle_data.txt @@ -1,16 +1,36 @@ -./test_scripts/API/VehicleData/GetVehicleData/001_Success_flow.lua -./test_scripts/API/VehicleData/GetVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua -./test_scripts/API/VehicleData/GetVehicleData/003_GetVD_gps_mandatory_parameters.lua -./test_scripts/API/VehicleData/GetVehicleData/004_Success_deviceStatus_primaryAudioSource.lua -./test_scripts/API/VehicleData/OnVehicleData/001_Success_flow.lua -./test_scripts/API/VehicleData/OnVehicleData/002_NotificationForUnsubsribedParameter_Ignored_flow.lua -./test_scripts/API/VehicleData/OnVehicleData/003_NotificationParameterDisallowedByPolicies_Ignored_flow.lua -./test_scripts/API/VehicleData/OnVehicleData/004_OnVD_gps_mandatory_parameters.lua -./test_scripts/API/VehicleData/OnVehicleData/005_Success_flow_deviceStatus_primaryAudioSource.lua -./test_scripts/API/VehicleData/SubscribeVehicleData/001_Success_flow.lua -./test_scripts/API/VehicleData/SubscribeVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua -./test_scripts/API/VehicleData/SubscribeVehicleData/003_RPC_parameter_already_subscribed_Result_IGNORED_flow.lua -./test_scripts/API/VehicleData/UnsubscribeVehicleData/001_Success_flow.lua -./test_scripts/API/VehicleData/UnsubscribeVehicleData/002_RPC_parameter_not_yet_subscribed_IGNORED_flow.lua -./test_scripts/API/VehicleData/UnsubscribeVehicleData/003_RPC_parameter_already_unsubscribed_Result_IGNORED_flow.lua -./test_scripts/API/VehicleData/UnsubscribeVehicleData/004_RPC_parameter_disallowed_by_policies_Result_DISALLOWED_flow.lua +./test_scripts/API/VehicleData/AudioSource/001_Success_deviceStatus_primaryAudioSource.lua +./test_scripts/API/VehicleData/AudioSource/002_Success_flow_deviceStatus_primaryAudioSource.lua +./test_scripts/API/VehicleData/GetVehicleData/001_GetVD_Success_flow.lua +./test_scripts/API/VehicleData/GetVehicleData/002_GetVD_disallowed.lua +./test_scripts/API/VehicleData/GetVehicleData/003_GetVD_disallowed_after_PTU.lua +./test_scripts/API/VehicleData/GetVehicleData/004_GetVD_HMI_responds_with_invalid_data.lua +./test_scripts/API/VehicleData/GetVehicleData/005_GetVD_App_sends_invalid_request.lua +./test_scripts/API/VehicleData/GetVehicleData/006_GetVD_mandatory_parameters.lua +./test_scripts/API/VehicleData/GetVehicleData/007_GetVD_app_version_is_greater_than_parameter_version.lua +./test_scripts/API/VehicleData/GetVehicleData/008_GetVD_app_version_is_less_than_parameter_version.lua +./test_scripts/API/VehicleData/OnVehicleData/001_OnVD_Success.lua +;./test_scripts/API/VehicleData/OnVehicleData/002_OnVD_disallowed.lua https://github.com/smartdevicelink/sdl_core/issues/3365 +;./test_scripts/API/VehicleData/OnVehicleData/003_OnVD_disallowed_after_PTU.lua https://github.com/smartdevicelink/sdl_core/issues/3365 +./test_scripts/API/VehicleData/OnVehicleData/004_OnVD_with_invalid_data.lua +./test_scripts/API/VehicleData/OnVehicleData/005_OnVD_App_is_not_subscribed.lua +./test_scripts/API/VehicleData/OnVehicleData/006_OnVD_mandatory_parameters.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/001_SubscribeVD_Success.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/002_SubscribeVD_disallowed.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/003_SubscribeVD_disallowed_after_PTU.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/004_SubscribeVD_HMI_responds_with_invalid_data.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/005_SubscribeVD_App_sends_invalid_request.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/006_SubscribeVD_2nd_request_IGNORED.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/007_SubscribeVD_for_2_apps.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/008_SubscribeVD_HMI_responds_with_not_success_codes.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/009_SubscribeVD_Resumption_of_subscription_Unexpected_Disconnect.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/010_SubscribeVD_Resumption_of_subscription_Ignition_Cycle.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/011_SubscribeVD_Resumption_of_subscription_for_2_apps_Unexpected_Disconnect.lua +./test_scripts/API/VehicleData/SubscribeVehicleData/012_SubscribeVD_Resumption_of_subscription_for_2_apps_Ignition_Cycle.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/001_UnsubscribeVD_Success.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/002_UnsubscribeVD_disallowed.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/003_UnsubscribeVD_disallowed_after_PTU.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/004_UnsubscribeVD_HMI_responds_with_invalid_data.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/005_UnsubscribeVD_App_sends_invalid_request.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/006_UnsubscribeVD_2nd_request_IGNORED.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/007_UnsubscribeVD_for_2_apps.lua +./test_scripts/API/VehicleData/UnsubscribeVehicleData/008_UnsubscribeVD_HMI_responds_with_not_success_codes.lua