Skip to content

Commit b252583

Browse files
committed
Reworked scripts for VechicleData incl handsOffSteering
1 parent e500340 commit b252583

95 files changed

Lines changed: 2182 additions & 3303 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

test_scripts/API/VehicleData/GetVehicleData/004_Success_deviceStatus_primaryAudioSource.lua renamed to test_scripts/API/VehicleData/AudioSource/001_Success_deviceStatus_primaryAudioSource.lua

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---------------------------------------------------------------------------------------------------
22
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0182-audio-source-am-fm-xm.md
3-
-- User story: TBD
4-
-- Use case: TBD
5-
--
6-
-- Requirement summary:TBD
73
--
84
-- Description:
95
-- In case:
@@ -15,7 +11,7 @@
1511
---------------------------------------------------------------------------------------------------
1612

1713
--[[ Required Shared libraries ]]
18-
local common = require('test_scripts/API/VehicleData/commonVehicleData')
14+
local common = require('test_scripts/API/VehicleData/common')
1915

2016
--[[ Local Variables ]]
2117
local audioSources = {
@@ -74,8 +70,6 @@ common.Title("Preconditions")
7470
common.Step("Clean environment", common.preconditions)
7571
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
7672
common.Step("RAI", common.registerApp)
77-
common.Step("PTU", common.policyTableUpdate, { common.ptUpdate })
78-
common.Step("Activate App", common.activateApp)
7973

8074
common.Title("Test")
8175
for _, source in pairs(audioSources) do

test_scripts/API/VehicleData/OnVehicleData/005_Success_flow_deviceStatus_primaryAudioSource.lua renamed to test_scripts/API/VehicleData/AudioSource/002_Success_flow_deviceStatus_primaryAudioSource.lua

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---------------------------------------------------------------------------------------------------
22
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0182-audio-source-am-fm-xm.md
3-
-- User story: TBD
4-
-- Use case: TBD
5-
--
6-
-- Requirement summary:TBD
73
--
84
-- Description:
95
-- In case:
@@ -14,7 +10,7 @@
1410
---------------------------------------------------------------------------------------------------
1511

1612
--[[ Required Shared libraries ]]
17-
local common = require('test_scripts/API/VehicleData/commonVehicleData')
13+
local common = require('test_scripts/API/VehicleData/common')
1814

1915
--[[ Local Variables ]]
2016
local audioSources = {
@@ -90,8 +86,6 @@ common.Title("Preconditions")
9086
common.Step("Clean environment", common.preconditions)
9187
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
9288
common.Step("RAI", common.registerApp)
93-
common.Step("PTU", common.policyTableUpdate, { common.ptUpdate })
94-
common.Step("Activate App", common.activateApp)
9589

9690
common.Title("Test")
9791
common.Step("RPC " .. rpc1.name, processRPCSubscribeSuccess)

test_scripts/API/VehicleData/HandsOffSteering/001_GetVD_Success_flow.lua renamed to test_scripts/API/VehicleData/GetVehicleData/001_GetVD_Success_flow.lua

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
---------------------------------------------------------------------------------------------------
2-
-- Proposal:https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0257-New-vehicle-data-HandsOffSteering.md
3-
--
4-
-- Description: Check that SDL processes GetVehicleData RPC with 'handsOffSteering' parameter
2+
-- Description: Check that SDL processes GetVehicleData RPC with <vd_param> parameter
53
--
64
-- Preconditions:
75
-- 1) SDL and HMI are started
8-
-- 2) RPC GetVehicleData and handsOffSteering parameter are allowed by policies
6+
-- 2) GetVehicleData RPC and <vd_param> parameter are allowed by policies
97
-- 3) App is registered
108
--
119
-- In case:
12-
-- 1) App sends valid GetVehicleData(handsOffSteering=true) request to SDL
10+
-- 1) App sends valid GetVehicleData(<vd_param>=true) request to SDL
1311
-- SDL does:
1412
-- - a) transfer this request to HMI
15-
-- 2) HMI sends VehicleInfo.GetVehicleData response with handsOffSteering data to SDL
13+
-- 2) HMI sends VehicleInfo.GetVehicleData response with <vd_param> data to SDL
1614
-- SDL does:
1715
-- - a) send GetVehicleData response with (success = true, resultCode = "SUCCESS",
18-
-- handsOffSteering = <data received from HMI>) to App
16+
-- <vd_param> = <data received from HMI>) to App
1917
---------------------------------------------------------------------------------------------------
2018
--[[ Required Shared libraries ]]
21-
local common = require('test_scripts/API/VehicleData/HandsOffSteering/common')
22-
23-
--[[ Local Variable ]]
24-
local handsOffSteeringValues = { true, false }
19+
local common = require('test_scripts/API/VehicleData/common')
2520

2621
--[[ Scenario ]]
2722
common.Title("Preconditions")
@@ -30,8 +25,9 @@ common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
3025
common.Step("Register App", common.registerApp)
3126

3227
common.Title("Test")
33-
for _, value in pairs(handsOffSteeringValues) do
34-
common.Step("RPC GetVehicleData with handsOffSteering " .. tostring(value), common.getVehicleData, { value })
28+
for param in common.spairs(common.getVDParams()) do
29+
common.Title("VD parameter: " .. param)
30+
common.Step("RPC " .. common.rpc.get, common.getVehicleData, { param })
3531
end
3632

3733
common.Title("Postconditions")

test_scripts/API/VehicleData/GetVehicleData/001_Success_flow.lua

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---------------------------------------------------------------------------------------------------
2+
-- Description: Check that SDL rejects GetVehicleData request with resultCode "DISALLOWED"
3+
-- if <vd_param> parameter is not allowed by policy
4+
--
5+
-- Preconditions:
6+
-- 1) SDL and HMI are started
7+
-- 2) <vd_param> parameter is not allowed by policies
8+
-- 3) App is registered
9+
--
10+
-- In case:
11+
-- 1) App sends valid GetVehicleData(<vd_param>=true) request to SDL
12+
-- SDL does:
13+
-- - a) send GetVehicleData response with (success = false, resultCode = "DISALLOWED") to App
14+
-- - b) not transfer this request to HMI
15+
---------------------------------------------------------------------------------------------------
16+
--[[ Required Shared libraries ]]
17+
local common = require('test_scripts/API/VehicleData/common')
18+
19+
--[[ Local Variables ]]
20+
local result = "DISALLOWED"
21+
22+
--[[ Local Functions ]]
23+
local function getVDGroup(pDisallowedParam)
24+
local params = {}
25+
for param in pairs(common.getVDParams()) do
26+
if param ~= pDisallowedParam then table.insert(params, param) end
27+
end
28+
return {
29+
rpcs = {
30+
[common.rpc.get] = {
31+
hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" },
32+
parameters = params
33+
}
34+
}
35+
}
36+
end
37+
38+
--[[ Scenario ]]
39+
for param in common.spairs(common.getVDParams()) do
40+
common.Title("VD parameter: " .. param)
41+
common.Title("Preconditions")
42+
common.Step("Clean environment and update preloaded_pt file", common.preconditions, { getVDGroup(param) })
43+
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
44+
common.Step("Register App", common.registerApp)
45+
46+
common.Title("Test")
47+
common.Step("RPC " .. common.rpc.get .. " DISALLOWED", common.processRPCFailure,
48+
{ common.rpc.get, param, result })
49+
50+
common.Title("Postconditions")
51+
common.Step("Stop SDL", common.postconditions)
52+
end

test_scripts/API/VehicleData/GetVehicleData/002_RPC_parameter_DISALLOWED_by_policies_flow.lua

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---------------------------------------------------------------------------------------------------
2+
-- Description: Check that SDL rejects GetVehicleData request with resultCode "DISALLOWED"
3+
-- if <vd_param> parameter is not allowed by policy after PTU
4+
--
5+
-- Preconditions:
6+
-- 1) SDL and HMI are started
7+
-- 2) GetVehicleData RPC and <vd_param> parameter are allowed by policies
8+
-- 3) App is registered
9+
--
10+
-- In case:
11+
-- 1) App sends valid GetVehicleData(<vd_param>=true) request to SDL
12+
-- SDL does:
13+
-- - a) transfer this request to HMI
14+
-- 2) HMI sends VehicleInfo.GetVehicleData response with <vd_param> data to SDL
15+
-- SDL does:
16+
-- - a) send GetVehicleData response with (success = true, resultCode = "SUCCESS",
17+
-- <vd_param> = <data received from HMI>) to App
18+
-- 3) PTU is performed with disabling permissions for <vd_param> parameter
19+
-- 4) App sends valid GetVehicleData(<vd_param>=true) request to SDL
20+
-- SDL does:
21+
-- - a) send GetVehicleData response with (success = false, resultCode = "DISALLOWED") to App
22+
-- - b) not transfer this request to HMI
23+
---------------------------------------------------------------------------------------------------
24+
--[[ Required Shared libraries ]]
25+
local common = require('test_scripts/API/VehicleData/common')
26+
27+
--[[ Local Variables ]]
28+
local result = "DISALLOWED"
29+
30+
--[[ Local Function ]]
31+
local function getVDGroup(pDisallowedParam)
32+
local params = {}
33+
for param in pairs(common.getVDParams()) do
34+
if param ~= pDisallowedParam then table.insert(params, param) end
35+
end
36+
return {
37+
rpcs = {
38+
[common.rpc.get] = {
39+
hmi_levels = { "NONE", "BACKGROUND", "LIMITED", "FULL" },
40+
parameters = params
41+
}
42+
}
43+
}
44+
end
45+
46+
local function policyTableUpdate(pDisallowedParam)
47+
local function ptUpdate(pt)
48+
pt.policy_table.functional_groupings["NewTestCaseGroup"] = getVDGroup(pDisallowedParam)
49+
pt.policy_table.app_policies[common.getAppParams().fullAppID].groups = { "Base-4", "NewTestCaseGroup" }
50+
end
51+
common.policyTableUpdate(ptUpdate)
52+
end
53+
54+
--[[ Scenario ]]
55+
for param in common.spairs(common.getVDParams()) do
56+
common.Title("VD parameter: " .. param)
57+
common.Title("Preconditions")
58+
common.Step("Clean environment and update preloaded_pt file", common.preconditions)
59+
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
60+
common.Step("Register App", common.registerApp)
61+
common.Step("RPC GetVehicleData, SUCCESS", common.getVehicleData, { param })
62+
63+
common.Title("Test")
64+
common.Step("PTU with disabling permissions for VD parameter", policyTableUpdate, { param })
65+
common.Step("RPC " .. common.rpc.get .. " DISALLOWED after PTU", common.processRPCFailure,
66+
{ common.rpc.get, param, result })
67+
68+
common.Title("Postconditions")
69+
common.Step("Stop SDL", common.postconditions)
70+
end

0 commit comments

Comments
 (0)