Skip to content

Commit

Permalink
Merge pull request #2661 from smartdevicelink/develop
Browse files Browse the repository at this point in the history
Release 8.1.0
  • Loading branch information
jacobkeeler authored Apr 13, 2022
2 parents 2594ac9 + 349dc61 commit 03495e9
Show file tree
Hide file tree
Showing 121 changed files with 5,131 additions and 577 deletions.
70 changes: 50 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,64 @@ This repository contains ATF scripts and data to run it.
## Manual usage:

* [Setup SDL](https://github.com/smartdevicelink/sdl_core).
* Later the SDL sources destination directory is referenced as `<sdl_core>`
* [Setup ATF](https://github.com/smartdevicelink/sdl_atf)
* Later the ATF sources destination directory is referenced as `<sdl_atf>`
* Later the SDL sources destination directory is referenced as `<sdl_core>`
* [Setup ATF](https://github.com/smartdevicelink/sdl_atf).
* Later the ATF sources destination directory is referenced as `<sdl_atf>`
* Later the ATF build destination directory is referenced as `<atf_build>`
* Clone [sdl_atf_test_scripts](https://github.com/smartdevicelink/sdl_atf)
* Later the atf test scripts destination directory is referenced as `<sdl_atf_test_scripts>`
* Later the atf test scripts destination directory is referenced as `<sdl_atf_test_scripts>`

``` git clone https://github.com/smartdevicelink/sdl_atf_test_scripts <sdl_atf_test_scripts>```
* Copy all files from `<sdl_atf_test_scripts>` to `<sdl_atf>` :
```bash
git clone https://github.com/smartdevicelink/sdl_atf_test_scripts <sdl_atf_test_scripts>
```

* Create symlinks in the build `bin` directory to certain directories in `<sdl_atf_test_scripts>`:

```bash
cd <atf_build>/bin
ln -s <sdl_atf_test_scripts>/files
ln -s <sdl_atf_test_scripts>/test_sets
ln -s <sdl_atf_test_scripts>/test_scripts
ln -s <sdl_atf_test_scripts>/user_modules
```

* In your `<sdl_atf>/modules/configuration/base_config.lua`
* Include the path to your local SDL Core binary (ex. `<sdl_build>/bin/`):
```lua
--- Define path to SDL binary
-- Example: "/home/user/sdl_build/bin"
config.pathToSDL = "/home/user/sdl_build/bin"
```

* Include the path to your local SDL Core Source directory (ex. `<sdl_core>/`):
```lua
--- Define path to SDL source
-- Example: "/home/user/sdl_core"
config.pathToSDLSource = "<sdl_core>"
```
ATF will use the provided path to derive the location of the MOBILE_API.xml and HMI_API.xml files within the directory.

* Instead of including the path to your local SDL Core Source directory, you can alternatively include the paths to your local directories containing the HMI_API and MOBILE_API files:

```lua
--- Define path to SDL MOBILE interface
-- Example: "/home/user/sdl_core/tools/rpc_spec"
config.pathToSDLMobileInterface = "/home/user/sdl_core/tools/rpc_spec"
--- Define path to SDL HMI interface
-- Example: "/home/user/sdl_core/src/components/interfaces"
config.pathToSDLHMIInterface = "/home/user/sdl_core/src/components/interfaces"
```
**NOTE:** If both `pathToSDLSource` and `pathToSDLMobileInterface`/`pathToSDLHMIInterface` are defined in the config file, the paths provided in `pathToSDLMobileInterface`/`pathToSDLHMIInterface` will override the paths derived from `pathToSDLSource`.

``` cp -r <sdl_atf_test_scripts>/* <sdl_atf>/ ```
* Include the path to your local HMI_API.xml, MOBILE_API.xml (ex. `<sdl_core>/src/components/interfaces/`) and the path to your local SDL Core binary (ex. `<sdl_build>/bin/`) in your `<sdl_atf>/modules/config.lua` :

```
--- Define path to SDL binary
-- Example: "/home/user/sdl_build/bin"
config.pathToSDL = "/home/user/sdl_build/bin"
--- Define path to SDL interfaces
-- Example: "/home/user/sdl_panasonic/src/components/interfaces"
config.pathToSDLInterfaces = "/home/user/sdl_core/src/components/interfaces"
```
* Run ATF.

_Mandatory options:_
* Pass path to test script as first command line parameter
```
cd <sdl_atf>/
./start.sh ./test_scripts/Smoke/API/021_Speak_PositiveCase_SUCCESS.lua
```
```
cd <atf_build>/bin
./start.sh ./test_scripts/Smoke/API/021_Speak_PositiveCase_SUCCESS.lua
```

You can get additional help of usage ATF:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
]
},
"appId": "553426",
"appId": "553425",
"development": false,
"iconUrl": "http://i.imgur.com/R3a11YFAk3.png",
"name": "Rap music App"
Expand Down Expand Up @@ -72,4 +72,4 @@
"iconUrl": "http://i.imgur.com/R3a11YFAk3.png"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,6 @@
},
"app_policies": {
"default": {
"memory_kb":1500,
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
Expand All @@ -2143,7 +2142,6 @@
"groups": ["DataConsent-2"]
},
"pre_DataConsent": {
"memory_kb":200,
"keep_context": false,
"steal_focus": false,
"priority": "NORMAL",
Expand Down
1 change: 0 additions & 1 deletion files/jsons/Policies/Policy_Table_Update/ptu_18190.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"default_hmi": "NONE",
"groups": ["Base-4", "Base-6"],
"heart_beat_timeout_ms": 0,
"memory_kb": 0,
"nicknames": ["Test Application"],
"RequestType": []
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"default_hmi": "NONE",
"groups": ["Base-4", "Base-6"],
"heart_beat_timeout_ms": 0,
"memory_kb": 0,
"nicknames": ["Test Application"],
"RequestType": []
},
Expand Down
1 change: 0 additions & 1 deletion files/ptu_heart_beat_timeout_ms_app_1234567.json
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,6 @@
"groups": [
"Base-4"
],
"memory_kb":1000,
"RequestType":[
"TRAFFIC_MESSAGE_CHANNEL",
"PROPRIETARY",
Expand Down
1 change: 0 additions & 1 deletion files/ptu_memory_kb_app_1234567.json
Original file line number Diff line number Diff line change
Expand Up @@ -2211,7 +2211,6 @@
"groups": [
"Base-4"
],
"memory_kb":300,
"RequestType":[
"TRAFFIC_MESSAGE_CHANNEL",
"PROPRIETARY",
Expand Down
12 changes: 6 additions & 6 deletions test_scripts/API/ATF_OnAppInterfaceUnregistered.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,7 @@ local function TC_APPLINK_18428_AppPermissionIsNull()
EXPECT_HMINOTIFICATION("SDL.OnAppPermissionChanged", {appID = self.applications["AppNullPermission"], appRevoked = true, priority = "EMERGENCY"})
:Do(function(_,data)
--hmi side: sending SDL.GetUserFriendlyMessage request to SDL
local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"AppUnsupported"}})
local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"AppUnauthorized"}})

--hmi side: expect BC.ActivateApp
EXPECT_HMICALL("BasicCommunication.ActivateApp",{appID=self.applications["AppNullPermission"],level="NONE",priority="NONE"})
Expand All @@ -1752,10 +1752,10 @@ local function TC_APPLINK_18428_AppPermissionIsNull()
self.hmiConnection:SendResponse(data.id,data.method, "SUCCESS",{})
end)
EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage", messages = {{
line1 = "Not Supported",
messageCode = "AppUnsupported",
textBody = "Your version of %appName% is not supported by SYNC.",
ttsString = "This version of %appName% is not supported by SYNC."}}}})
line1 = "Not Authorized",
messageCode = "AppUnauthorized",
textBody = "This version of %appName% is no longer authorized to work with AppLink. Please update to the latest version of %appName%.",
ttsString = "This version of %appName% is not authorized and will not work with SYNC."}}}})
end)
--mobile side: expect notification
EXPECT_NOTIFICATION("OnHMIStatus", {hmiLevel = "NONE", systemContext = "MAIN"})
Expand All @@ -1774,4 +1774,4 @@ commonFunctions:newTestCasesGroup("****************************** END TEST BLOCK
-----------------------------------------TEST BLOCK VII---------------------------------------
--------------------------------------Different HMIStatus-------------------------------------
----------------------------------------------------------------------------------------------
--All HMILevel is checked on TCs on TEST BLOCK VI
--All HMILevel is checked on TCs on TEST BLOCK VI
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ function m.reRegisterAppSuccess(pAppId, pCheckResumptionData, pExpTime)
local params = m.cloneTable(m.getConfigAppParams(pAppId))
params.hashID = m.hashId[pAppId]
local corId = mobSession:SendRPC("RegisterAppInterface", params)
mobSession:ExpectNotification("OnHMIStatus", { hmiLevel = "NONE" }, { hmiLevel = "FULL" }):Times(2)
m.getHMIConnection():ExpectNotification("BasicCommunication.OnAppRegistered",
{ application = { appName = m.getConfigAppParams(pAppId).appName } })
mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ local function systemRequest(pParams, pFile)
if pParams.fileName then pParams.fileName = "/tmp/fs/mp/images/ivsu_cache/" .. pParams.fileName end
EXPECT_HMICALL("BasicCommunication.SystemRequest",pParams)
:Times(0)
mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" })
-- will be rejected because not UPDATING
mobSession:ExpectResponse(cid, { success = false, resultCode = "REJECTED" })
end

--[[ Scenario ]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ local params = {
fileName = "action.png"
}

local paramsProprietary = {
requestType = "PROPRIETARY",
fileName = "action.png"
}
--[[ Local Functions ]]
local function ptuFuncRPC(tbl)
tbl.policy_table.app_policies[config.application1.registerAppInterfaceParams.fullAppID].RequestType = nil
Expand Down Expand Up @@ -61,12 +57,8 @@ runner.Title("Test")
runner.Step("Policy table update", policyUpdate)
runner.Step("SystemRequest with request type OEM_SPECIFIC", common.systemRequest,
{params, usedFile})
runner.Step("SystemRequest with request type PROPRIETARY", common.systemRequest,
{paramsProprietary, usedFile})
runner.Step("onSystemRequest with request type OEM_SPECIFIC", common.onSystemRequest,
{params})
runner.Step("onSystemRequest with request type PROPRIETARY", common.onSystemRequest,
{paramsProprietary})

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ local function registerApp()
end

local function onDriverDistractionUnsuccess()
common.getHMIConnection():SendNotification("UI.OnDriverDistraction", { state = "DD_OFF" })
common.getHMIConnection():SendNotification("UI.OnDriverDistraction", { state = "DD_OFF", lockScreenDismissalEnabled = lockScreenDismissalEnabled })
common.getMobileSession():ExpectNotification("OnDriverDistraction")
:Times(0)
end

local function activateApp()
common.expOnDriverDistraction("DD_OFF", nil)
common.expOnDriverDistraction("DD_OFF", lockScreenDismissalEnabled)
common.activateApp()
end

Expand All @@ -62,7 +62,7 @@ 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 missing", common.onDriverDistraction, { "DD_OFF", nil })
runner.Step("OnDriverDistraction OFF missing", common.onDriverDistraction, { "DD_OFF", lockScreenDismissalEnabled })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
20 changes: 4 additions & 16 deletions test_scripts/API/SDL_Passenger_Mode/009_OnDD_PTU_several_apps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,21 @@ local function onDriverDistractionTwoApps(pLockScreenDismissalEnabled)
common.getHMIConnection():SendNotification("UI.OnDriverDistraction", { state = "DD_OFF" })
common.getHMIConnection():SendNotification("UI.OnDriverDistraction", { state = "DD_ON" })
common.getMobileSession():ExpectNotification("OnDriverDistraction",
{ state = "DD_OFF" },
{ state = "DD_OFF", lockScreenDismissalEnabled = pLockScreenDismissalEnabled },
{ state = "DD_ON", lockScreenDismissalEnabled = pLockScreenDismissalEnabled })
:ValidIf(function(e, d)
if e.occurences == 1 and d.payload.lockScreenDismissalEnabled ~= nil then
return false, d.payload.state .. ": " .. msg(d.payload.lockScreenDismissalEnabled)
end
return true
end)
:ValidIf(function(e, d)
if e.occurences == 2 and pLockScreenDismissalEnabled == nil and d.payload.lockScreenDismissalEnabled ~= nil then
if pLockScreenDismissalEnabled == nil and d.payload.lockScreenDismissalEnabled ~= nil then
return false, d.payload.state .. ": " .. msg(d.payload.lockScreenDismissalEnabled)
end
return true
end)
:Times(2)

common.getMobileSession(2):ExpectNotification("OnDriverDistraction",
{ state = "DD_OFF" },
{ state = "DD_OFF", lockScreenDismissalEnabled = pLockScreenDismissalEnabled },
{ state = "DD_ON", lockScreenDismissalEnabled = pLockScreenDismissalEnabled })
:ValidIf(function(e, d)
if e.occurences == 1 and d.payload.lockScreenDismissalEnabled ~= nil then
return false, d.payload.state .. ": " .. msg(d.payload.lockScreenDismissalEnabled)
end
return true
end)
:ValidIf(function(e, d)
if e.occurences == 2 and pLockScreenDismissalEnabled == nil and d.payload.lockScreenDismissalEnabled ~= nil then
if pLockScreenDismissalEnabled == nil and d.payload.lockScreenDismissalEnabled ~= nil then
return false, d.payload.state .. ": " .. msg(d.payload.lockScreenDismissalEnabled)
end
return true
Expand Down
11 changes: 3 additions & 8 deletions test_scripts/API/SDL_Passenger_Mode/commonPassengerMode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,11 @@ end
function c.expOnDriverDistraction(pState, pLockScreenDismissalEnabled, pAppId)
c.getMobileSession(pAppId):ExpectNotification("OnDriverDistraction", { state = pState })
:ValidIf(function(_, d)
if d.payload.state == "DD_OFF" and d.payload.lockScreenDismissalEnabled ~= nil then
if pLockScreenDismissalEnabled == nil and d.payload.lockScreenDismissalEnabled ~= nil then
return false, d.payload.state .. ": Parameter `lockScreenDismissalEnabled` is not expected"
end
if d.payload.state == "DD_ON" then
if pLockScreenDismissalEnabled == nil and d.payload.lockScreenDismissalEnabled ~= nil then
return false, d.payload.state .. ": Parameter `lockScreenDismissalEnabled` is not expected"
end
if pLockScreenDismissalEnabled ~= d.payload.lockScreenDismissalEnabled then
return false, d.payload.state .. ": Parameter `lockScreenDismissalEnabled` is not the same as expected"
end
if pLockScreenDismissalEnabled ~= d.payload.lockScreenDismissalEnabled then
return false, d.payload.state .. ": Parameter `lockScreenDismissalEnabled` is not the same as expected"
end
return true
end)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---------------------------------------------------------------------------------------------------
-- Description: Check that SDL cuts off param from GetVehicleData request/response
-- in case <vd_param> parameter is not allowed by policy after PTU
--
-- Preconditions:
-- 1) SDL and HMI are started
-- 2) GetVehicleData RPC and <vd_param> parameter is disallowed by policies
-- 3) App is registered
--
-- In case:
-- 1) App sends valid GetVehicleData request to SDL (with all VD params incl. <vd_param>)
-- SDL does:
-- - a) cut off <vd_param>
-- - b) transfer request to HMI
-- 2) HMI sends VI.GetVehicleData response data to SDL (with all VD params incl. <vd_param>)
-- SDL does:
-- - a) cut off <vd_param>
-- - b) transfer response to App:
-- (success = true, resultCode = "SUCCESS", <vd_param> = <data received from HMI>)
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require('test_scripts/API/VehicleData/common')

--[[ Conditions to skip test ]]
if #common.restrictedVDParams == 1 then
common.runner.skipTest("Test is not applicable for one restricted VD parameter")
end

--[[ Local Variables ]]
local all_params = {}
for param in pairs(common.getVDParams(true)) do
table.insert(all_params, param)
end
if #all_params == 0 then all_params = common.json.EMPTY_ARRAY end

--[[ 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
if #params == 0 then params = common.json.EMPTY_ARRAY 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.runner.Title("VD parameter: " .. param)
common.runner.Title("Preconditions")
common.runner.Step("Clean environment and update preloaded_pt file", common.preconditions)
common.runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
common.runner.Step("Register App", common.registerApp)
common.runner.Step("RPC GetVehicleData, SUCCESS", common.getVehicleDataMultipleParams, { all_params })

common.runner.Title("Test")
common.runner.Step("PTU with disabling permissions for VD parameter", policyTableUpdate, { param })
common.runner.Step("RPC " .. common.rpc.get .. " filtered after PTU", common.getVehicleDataMultipleParams,
{ all_params, nil, param })

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

0 comments on commit 03495e9

Please sign in to comment.