-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial scripts for SDL Passenger Mode feature
- Loading branch information
1 parent
5a103d0
commit f6589a4
Showing
10 changed files
with
488 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0119-SDL-passenger-mode.md | ||
-- Description: | ||
-- In case: | ||
-- 1) OnDriverDistraction notification is allowed by Policy for (FULL, LIMITED, BACKGROUND, NONE) HMILevel | ||
-- 2) In Policy "lock_screen_dismissal_enabled" parameter is defined with correct value (true) | ||
-- 3) App registered (HMI level NONE) | ||
-- 4) HMI sends OnDriverDistraction notification with all mandatory fields | ||
-- SDL does: | ||
-- 1) Send OnDriverDistraction notification to mobile with "lockScreenDismissalEnabled" parameter | ||
-- (value corresponds to the one defined in Policy) and all mandatory fields | ||
-- | ||
-- Note: Cover all HMI levels | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require('test_scripts/API/SDL_Passenger_Mode/commonPassengerMode') | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local lockScreenDismissalEnabled = true | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { lockScreenDismissalEnabled }) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("Register App", common.registerApp) | ||
|
||
runner.Title("Test") | ||
|
||
for _, level in common.pairs(common.hmiLevel) do | ||
runner.Step("Switch app's HMI level to " .. level.name, level.func) | ||
runner.Step("OnDriverDistraction ON/OFF true", common.onDriverDistraction, { lockScreenDismissalEnabled }) | ||
end | ||
|
||
runner.Title("Postconditions") | ||
runner.Step("Stop SDL", common.postconditions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0119-SDL-passenger-mode.md | ||
-- Description: | ||
-- In case: | ||
-- 1) OnDriverDistraction notification is allowed by Policy for (FULL, LIMITED, BACKGROUND, NONE) HMILevel | ||
-- 2) In Policy "lock_screen_dismissal_enabled" parameter is defined with correct value (false) | ||
-- 3) App registered (HMI level NONE) | ||
-- 4) HMI sends OnDriverDistraction notification with all mandatory fields | ||
-- SDL does: | ||
-- 1) Send OnDriverDistraction notification to mobile with "lockScreenDismissalEnabled" parameter | ||
-- (value corresponds to the one defined in Policy) and all mandatory fields | ||
-- | ||
-- Note: Cover all HMI levels | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require('test_scripts/API/SDL_Passenger_Mode/commonPassengerMode') | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local lockScreenDismissalEnabled = false | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { lockScreenDismissalEnabled }) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("Register App", common.registerApp) | ||
|
||
runner.Title("Test") | ||
|
||
for _, level in common.pairs(common.hmiLevel) do | ||
runner.Step("Switch app's HMI level to " .. level.name, level.func) | ||
runner.Step("OnDriverDistraction ON/OFF false", common.onDriverDistraction, { lockScreenDismissalEnabled }) | ||
end | ||
|
||
runner.Title("Postconditions") | ||
runner.Step("Stop SDL", common.postconditions) |
40 changes: 40 additions & 0 deletions
40
test_scripts/API/SDL_Passenger_Mode/003_OnDD_PT_missing.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0119-SDL-passenger-mode.md | ||
-- Description: | ||
-- In case: | ||
-- 1) OnDriverDistraction notification is allowed by Policy for (FULL, LIMITED, BACKGROUND, NONE) HMILevel | ||
-- 2) In Policy "lock_screen_dismissal_enabled" parameter is missing | ||
-- 3) App registered (HMI level NONE) | ||
-- 4) HMI sends OnDriverDistraction notification with all mandatory fields | ||
-- SDL does: | ||
-- 1) Send OnDriverDistraction notification to mobile without "lockScreenDismissalEnabled" parameter, | ||
-- but with all mandatory fields | ||
-- | ||
-- Note: Cover all HMI levels | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require('test_scripts/API/SDL_Passenger_Mode/commonPassengerMode') | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local lockScreenDismissalEnabled = nil | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { lockScreenDismissalEnabled }) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("Register App", common.registerApp) | ||
|
||
runner.Title("Test") | ||
|
||
for _, level in common.pairs(common.hmiLevel) do | ||
runner.Step("Switch app's HMI level to " .. level.name, level.func) | ||
runner.Step("OnDriverDistraction ON/OFF missing", common.onDriverDistraction, { lockScreenDismissalEnabled }) | ||
end | ||
|
||
runner.Title("Postconditions") | ||
runner.Step("Stop SDL", common.postconditions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0119-SDL-passenger-mode.md | ||
-- Description: | ||
-- In case: | ||
-- 1) OnDriverDistraction notification is allowed by Policy for (FULL, LIMITED, BACKGROUND, NONE) HMILevel | ||
-- 2) In Policy "lock_screen_dismissal_enabled" parameter is missing | ||
-- 3) App registered (HMI level NONE) | ||
-- 4) HMI sends OnDriverDistraction notification with all mandatory fields | ||
-- 5) Policy Table update ("lock_screen_dismissal_enabled" = true) | ||
-- 6) HMI sends OnDriverDistraction notification with all mandatory fields | ||
-- SDL does: | ||
-- 1) Send OnDriverDistraction notification to mobile without "lockScreenDismissalEnabled" before PTU | ||
-- 2) Send OnDriverDistraction notification to mobile with "lockScreenDismissalEnabled"=true after PTU | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require('test_scripts/API/SDL_Passenger_Mode/commonPassengerMode') | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local lockScreenDismissalEnabled = true | ||
|
||
--[[ Local Functions ]] | ||
local function ptUpdate(pPT) | ||
pPT.policy_table.module_config.lock_screen_dismissal_enabled = lockScreenDismissalEnabled | ||
end | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { nil }) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("Register App", common.registerApp) | ||
|
||
runner.Title("Test") | ||
runner.Step("OnDriverDistraction ON/OFF missing", common.onDriverDistraction, { nil }) | ||
runner.Step("Policy Table Update", common.policyTableUpdate, { ptUpdate }) | ||
runner.Step("OnDriverDistraction ON/OFF true", common.onDriverDistraction, { lockScreenDismissalEnabled }) | ||
|
||
runner.Title("Postconditions") | ||
runner.Step("Stop SDL", common.postconditions) |
43 changes: 43 additions & 0 deletions
43
test_scripts/API/SDL_Passenger_Mode/005_OnDD_PTU_false.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0119-SDL-passenger-mode.md | ||
-- Description: | ||
-- In case: | ||
-- 1) OnDriverDistraction notification is allowed by Policy for (FULL, LIMITED, BACKGROUND, NONE) HMILevel | ||
-- 2) In Policy "lock_screen_dismissal_enabled" parameter is missing | ||
-- 3) App registered (HMI level NONE) | ||
-- 4) HMI sends OnDriverDistraction notification with all mandatory fields | ||
-- 5) Policy Table update ("lock_screen_dismissal_enabled" = false) | ||
-- 6) HMI sends OnDriverDistraction notification with all mandatory fields | ||
-- SDL does: | ||
-- 1) Send OnDriverDistraction notification to mobile without "lockScreenDismissalEnabled" before PTU | ||
-- 2) Send OnDriverDistraction notification to mobile with "lockScreenDismissalEnabled"=false after PTU | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require('test_scripts/API/SDL_Passenger_Mode/commonPassengerMode') | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local lockScreenDismissalEnabled = false | ||
|
||
--[[ Local Functions ]] | ||
local function ptUpdate(pPT) | ||
pPT.policy_table.module_config.lock_screen_dismissal_enabled = lockScreenDismissalEnabled | ||
end | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { nil }) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("Register App", common.registerApp) | ||
|
||
runner.Title("Test") | ||
runner.Step("OnDriverDistraction ON/OFF missing", common.onDriverDistraction, { nil }) | ||
runner.Step("Policy Table Update", common.policyTableUpdate, { ptUpdate }) | ||
runner.Step("OnDriverDistraction ON/OFF false", common.onDriverDistraction, { lockScreenDismissalEnabled }) | ||
|
||
runner.Title("Postconditions") | ||
runner.Step("Stop SDL", common.postconditions) |
43 changes: 43 additions & 0 deletions
43
test_scripts/API/SDL_Passenger_Mode/006_OnDD_PTU_missing.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0119-SDL-passenger-mode.md | ||
-- Description: | ||
-- In case: | ||
-- 1) OnDriverDistraction notification is allowed by Policy for (FULL, LIMITED, BACKGROUND, NONE) HMILevel | ||
-- 2) In Policy "lock_screen_dismissal_enabled" parameter is missing | ||
-- 3) App registered (HMI level NONE) | ||
-- 4) HMI sends OnDriverDistraction notification with all mandatory fields | ||
-- 5) Policy Table update ("lock_screen_dismissal_enabled" = false) | ||
-- 6) HMI sends OnDriverDistraction notification with all mandatory fields | ||
-- SDL does: | ||
-- 1) Send OnDriverDistraction notification to mobile without "lockScreenDismissalEnabled" before PTU | ||
-- 2) Send OnDriverDistraction notification to mobile with "lockScreenDismissalEnabled"=false after PTU | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require('test_scripts/API/SDL_Passenger_Mode/commonPassengerMode') | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local lockScreenDismissalEnabled = nil | ||
|
||
--[[ Local Functions ]] | ||
local function ptUpdate(pPT) | ||
pPT.policy_table.module_config.lock_screen_dismissal_enabled = lockScreenDismissalEnabled | ||
end | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { true }) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("Register App", common.registerApp) | ||
|
||
runner.Title("Test") | ||
runner.Step("OnDriverDistraction ON/OFF true", common.onDriverDistraction, { true }) | ||
runner.Step("Policy Table Update", common.policyTableUpdate, { ptUpdate }) | ||
runner.Step("OnDriverDistraction ON/OFF missing", common.onDriverDistraction, { lockScreenDismissalEnabled }) | ||
|
||
runner.Title("Postconditions") | ||
runner.Step("Stop SDL", common.postconditions) |
66 changes: 66 additions & 0 deletions
66
test_scripts/API/SDL_Passenger_Mode/007_OnDD_hmiLevel_NONE_to_FULL_DD_OFF.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0119-SDL-passenger-mode.md | ||
-- Description: | ||
-- In case: | ||
-- 1) OnDriverDistraction notification is allowed by Policy for (FULL, LIMITED, BACKGROUND) HMILevel | ||
-- 2) In Policy "lock_screen_dismissal_enabled" parameter is defined with "true" value | ||
-- 3) App registered (HMI level NONE) | ||
-- 4) HMI sends OnDriverDistraction notification with all mandatory fields (state = "DD_OFF") | ||
-- 5) App activated (HMI level FULL) | ||
-- 6) HMI sends OnDriverDistraction notification with all mandatory fields | ||
-- SDL does: | ||
-- 1) Not send OnDriverDistraction notification to mobile when (HMI level NONE) | ||
-- 2) Send OnDriverDistraction notification to mobile once app is activated | ||
-- 3) Send OnDriverDistraction notification to mobile with "lockScreenDismissalEnabled"=true once HMI sends it to SDL | ||
-- when app is in FULL | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require('test_scripts/API/SDL_Passenger_Mode/commonPassengerMode') | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local lockScreenDismissalEnabled = true | ||
|
||
--[[ Local Functions ]] | ||
local function updatePreloadedPT() | ||
local function updatePT(pPT) | ||
pPT.policy_table.functional_groupings["Base-4"].rpcs.OnDriverDistraction.hmi_levels = { "FULL" } | ||
end | ||
common.updatePreloadedPT(lockScreenDismissalEnabled, updatePT) | ||
end | ||
|
||
local function registerApp() | ||
common.registerAppWOPTU() | ||
common.getMobileSession():ExpectNotification("OnDriverDistraction") | ||
:Times(0) | ||
end | ||
|
||
local function onDriverDistractionUnsuccess() | ||
common.getHMIConnection():SendNotification("UI.OnDriverDistraction", { state = "DD_OFF" }) | ||
common.getMobileSession():ExpectNotification("OnDriverDistraction") | ||
:Times(0) | ||
end | ||
|
||
local function activateApp() | ||
common.activateApp() | ||
common.getMobileSession():ExpectNotification("OnDriverDistraction", | ||
{ state = "DD_OFF" }) | ||
end | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Set LockScreenDismissalEnabled", updatePreloadedPT, { lockScreenDismissalEnabled }) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("App registration HMI level NONE", registerApp) | ||
|
||
runner.Title("Test") | ||
runner.Step("OnDriverDistraction OFF not transfered", onDriverDistractionUnsuccess) | ||
runner.Step("App activation HMI level FULL", activateApp) | ||
runner.Step("OnDriverDistraction OFF true", common.onDriverDistraction, { lockScreenDismissalEnabled }) | ||
|
||
runner.Title("Postconditions") | ||
runner.Step("Stop SDL", common.postconditions) |
66 changes: 66 additions & 0 deletions
66
test_scripts/API/SDL_Passenger_Mode/008_OnDD_hmiLevel_NONE_to_FULL_DD_ON.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0119-SDL-passenger-mode.md | ||
-- Description: | ||
-- In case: | ||
-- 1) OnDriverDistraction notification is allowed by Policy for (FULL, LIMITED, BACKGROUND) HMILevel | ||
-- 2) In Policy "lock_screen_dismissal_enabled" parameter is defined with "true" value | ||
-- 3) App registered (HMI level NONE) | ||
-- 4) HMI sends OnDriverDistraction notification with all mandatory fields (state = "DD_ON") | ||
-- 5) App activated (HMI level FULL) | ||
-- 6) HMI sends OnDriverDistraction notification with all mandatory fields | ||
-- SDL does: | ||
-- 1) Not send OnDriverDistraction notification to mobile when (HMI level NONE) | ||
-- 2) Send OnDriverDistraction notification to mobile with "lockScreenDismissalEnabled"=true once app is activated | ||
-- 3) Send OnDriverDistraction notification to mobile with "lockScreenDismissalEnabled"=true once HMI sends it to SDL | ||
-- when app is in FULL | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require('test_scripts/API/SDL_Passenger_Mode/commonPassengerMode') | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local lockScreenDismissalEnabled = true | ||
|
||
--[[ Local Functions ]] | ||
local function updatePreloadedPT() | ||
local function updatePT(pPT) | ||
pPT.policy_table.functional_groupings["Base-4"].rpcs.OnDriverDistraction.hmi_levels = { "FULL" } | ||
end | ||
common.updatePreloadedPT(lockScreenDismissalEnabled, updatePT) | ||
end | ||
|
||
local function registerApp() | ||
common.registerAppWOPTU() | ||
common.getMobileSession():ExpectNotification("OnDriverDistraction") | ||
:Times(0) | ||
end | ||
|
||
local function onDriverDistractionUnsuccess() | ||
common.getHMIConnection():SendNotification("UI.OnDriverDistraction", { state = "DD_ON" }) | ||
common.getMobileSession():ExpectNotification("OnDriverDistraction") | ||
:Times(0) | ||
end | ||
|
||
local function activateApp() | ||
common.activateApp() | ||
common.getMobileSession():ExpectNotification("OnDriverDistraction", | ||
{ state = "DD_ON", lockScreenDismissalEnabled = lockScreenDismissalEnabled }) | ||
end | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Set LockScreenDismissalEnabled", updatePreloadedPT, { lockScreenDismissalEnabled }) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("App registration HMI level NONE", registerApp) | ||
|
||
runner.Title("Test") | ||
runner.Step("OnDriverDistraction ON not transfered", onDriverDistractionUnsuccess) | ||
runner.Step("App activation HMI level FULL", activateApp) | ||
runner.Step("OnDriverDistraction ON true", common.onDriverDistraction, { lockScreenDismissalEnabled }) | ||
|
||
runner.Title("Postconditions") | ||
runner.Step("Stop SDL", common.postconditions) |
Oops, something went wrong.