Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test scripts to support HTTP and EXT SDL's policy modes #2212

Merged
merged 2 commits into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ local commonFunctions = require("user_modules/shared_testcases/commonFunctions")
local utils = require("user_modules/utils")
local events = require("events")
local json = require("modules/json")
local runner = require('user_modules/script_runner')

-- Set applicalbe SDL policy mode
runner.testSettings.restrictions.sdlBuildOptions = { { extendedPolicy = { "PROPRIETARY", "EXTERNAL_PROPRIETARY" } } }

--[[ General configuration parameters ]]
config.defaultProtocolVersion = 2
Expand Down
4 changes: 2 additions & 2 deletions test_scripts/API/ServiceStatusUpdateToHMI/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function m.policyTableUpdateSuccess(pPTUpdateFunc)
:Times(AtMost(1))
m.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", { odometer = true })
end
m.getHMIConnection():ExpectRequest("BasicCommunication.PolicyUpdate")
m.isPTUStarted()
:Do(function(e, data)
if e.occurences == 1 then
m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { })
Expand All @@ -123,7 +123,7 @@ function m.policyTableUpdateUnsuccess()
common.getHMIConnection():ExpectRequest("BasicCommunication.DecryptCertificate")
:Times(0)
end
common.getHMIConnection():ExpectRequest("BasicCommunication.PolicyUpdate")
m.isPTUStarted()
:Do(function(e, data)
if e.occurences == 1 then
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", { })
Expand Down
4 changes: 4 additions & 0 deletions test_scripts/API/VehicleData/DOP/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@ function m.checkAbsenceOfParam(pParam, pData)
return true
end

function m.ptUpdate(pTbl)
pTbl.policy_table.functional_groupings["Location-1"].user_consent_prompt = nil
end

return m
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ m.gpsParams = {
--[[ Functions ]]
function m.pTUpdateFunc(tbl)
tbl.policy_table.app_policies[config.application1.registerAppInterfaceParams.fullAppID].groups = {"Base-4", "Location-1"}
tbl.policy_table.functional_groupings["Location-1"].user_consent_prompt = nil
end

function m.checkShifted(data, pShiftValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ local common = require('test_scripts/AppServices/commonAppServices')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false
runner.testSettings.restrictions.sdlBuildOptions = { { extendedPolicy = { "PROPRIETARY", "EXTERNAL_PROPRIETARY" } } }

--[[ Local Functions ]]
local function PTUfunc(tbl)
Expand Down
11 changes: 2 additions & 9 deletions test_scripts/AppServices/commonAppServices.lua
Original file line number Diff line number Diff line change
Expand Up @@ -459,16 +459,9 @@ function commonAppServices.getRpcPassThroughTimeoutFromINI()
return tonumber(RpcPassThroughTimeout)
end

function commonAppServices:Request_PTU()
local is_test_fail = false
local hmi_app1_id = config.application1.registerAppInterfaceParams.appName
function commonAppServices:Request_PTU()
commonAppServices.getHMIConnection():SendNotification("SDL.OnPolicyUpdate", {} )
EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"})

EXPECT_HMICALL("BasicCommunication.PolicyUpdate",{ file = "/tmp/fs/mp/images/ivsu_cache/sdl_snapshot.json" })
:Do(function(_,data)
commonAppServices.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {})
end)
commonAppServices.isPTUStarted()
end

function commonAppServices.GetPolicySnapshot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions'

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false
runner.testSettings.restrictions.sdlBuildOptions = { { extendedPolicy = { "PROPRIETARY", "EXTERNAL_PROPRIETARY" } } }

--[[ Local Variables ]]
local rpc = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions'

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false
runner.testSettings.restrictions.sdlBuildOptions = { { extendedPolicy = { "PROPRIETARY", "EXTERNAL_PROPRIETARY" } } }

--[[ Local Variables ]]
local rpc = {
Expand Down
1 change: 1 addition & 0 deletions test_scripts/CloudAppRPCs/010_get_icon_url.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local common = require('test_scripts/CloudAppRPCs/commonCloudAppRPCs')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false
runner.testSettings.restrictions.sdlBuildOptions = { { extendedPolicy = { "PROPRIETARY", "EXTERNAL_PROPRIETARY" } } }

--[[ Local Variables ]]
local cloud_app_id = "cloudAppID123"
Expand Down
11 changes: 2 additions & 9 deletions test_scripts/CloudAppRPCs/commonCloudAppRPCs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,9 @@ function commonCloudAppRPCs.getCloudAppStoreConfig()
}
end

function commonCloudAppRPCs:Request_PTU()
local is_test_fail = false
local hmi_app1_id = config.application1.registerAppInterfaceParams.appName
function commonCloudAppRPCs:Request_PTU()
commonCloudAppRPCs.getHMIConnection():SendNotification("SDL.OnPolicyUpdate", {} )
EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"})

EXPECT_HMICALL("BasicCommunication.PolicyUpdate",{ file = "/tmp/fs/mp/images/ivsu_cache/sdl_snapshot.json" })
:Do(function(_,data)
commonCloudAppRPCs.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {})
end)
commonCloudAppRPCs.isPTUStarted()
end

function commonCloudAppRPCs.test_assert(condition, msg)
Expand Down
3 changes: 3 additions & 0 deletions test_scripts/SDL5_0/FullAppID/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ local sdl = require("SDL")
local commonSteps = require("user_modules/shared_testcases/commonSteps")
local commonSmoke = require('test_scripts/Smoke/commonSmoke')

-- Set applicalbe SDL policy mode
runner.testSettings.restrictions.sdlBuildOptions = { { extendedPolicy = { "PROPRIETARY" } } }
jacobkeeler marked this conversation as resolved.
Show resolved Hide resolved

--[[ Local Variables ]]

local m = commonSteps
Expand Down
11 changes: 4 additions & 7 deletions test_scripts/Security/SSLHandshakeFlow/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function m.defaultExpNotificationFunc()
m.getHMIConnection():ExpectRequest("BasicCommunication.DecryptCertificate")
:Do(function(_, d)
m.getHMIConnection():SendResponse(d.id, d.method, "SUCCESS", { })
utils.wait(1000) -- time for SDL to save certificates
utils.wait(1000) -- time for SDL to save certificates
end)
:Times(AnyNumber())
m.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", { odometer = true })
Expand All @@ -217,12 +217,9 @@ function m.policyTableUpdate(pPTUpdateFunc, pExpNotificationFunc)
end

function m.policyTableUpdateSuccess(pPTUpdateFunc)
m.getHMIConnection():ExpectRequest("BasicCommunication.PolicyUpdate")
:Do(function(e, d)
if e.occurences == 1 then
m.getHMIConnection():SendResponse(d.id, d.method, "SUCCESS", { })
m.policyTableUpdate(pPTUpdateFunc)
end
m.isPTUStarted()
:Do(function()
m.policyTableUpdate(pPTUpdateFunc)
end)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ runner.Step("Set DTLS protocol in SDL", common.setSDLIniParameter, { "Protocol",
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("Connect two mobile devices to SDL", common.connectMobDevices, {devices})
runner.Step("Register App1 from device 1", common.registerAppEx, {1, appParams[1], 1})
runner.Step("Register App2 from device 2", common.registerAppEx, {2, appParams[2], 2}, true)
runner.Step("Register App2 from device 2", common.registerAppEx, {2, appParams[2], 2, true})
runner.Step("Policy Table Update Certificate", common.policyTableUpdate, { common.ptUpdate })
runner.Step("Activate App 1", common.activateApp, { 1 })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ runner.Step("Set DTLS protocol in SDL", common.setSDLIniParameter, { "Protocol",
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("Connect two mobile devices to SDL", common.connectMobDevices, {devices})
runner.Step("Register App1 from device 1", common.registerAppEx, {1, appParams[1], 1})
runner.Step("Register App2 from device 2", common.registerAppEx, {2, appParams[2], 2}, true)
runner.Step("Register App2 from device 2", common.registerAppEx, {2, appParams[2], 2, true})
runner.Step("Policy Table Update Certificate", common.policyTableUpdate, { common.ptUpdate })
runner.Step("Activate App 1", common.activateApp, { 1 })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ runner.Step("Set DTLS protocol in SDL", common.setSDLIniParameter, { "Protocol",
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("Connect two mobile devices to SDL", common.connectMobDevices, {devices})
runner.Step("Register App1 from device 1", common.registerAppEx, {1, appParams[1], 1})
runner.Step("Register App2 from device 2", common.registerAppEx, {2, appParams[2], 2}, true)
runner.Step("Register App2 from device 2", common.registerAppEx, {2, appParams[2], 2, true})
runner.Step("Policy Table Update Certificate", common.policyTableUpdate, { common.ptUpdate })
runner.Step("Activate App 1", common.activateApp, { 1 })

Expand Down
5 changes: 1 addition & 4 deletions test_scripts/TheSameApp/commonTheSameApp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ function common.registerAppEx(pAppId, pAppParams, pMobConnId, pHasPTU)
:Do(function(_, d1)
common.app.setHMIId(d1.params.application.appID, pAppId)
if pHasPTU then
common.hmi.getConnection():ExpectRequest("BasicCommunication.PolicyUpdate")
:Do(function(_, d2)
common.hmi.getConnection():SendResponse(d2.id, d2.method, "SUCCESS", { })
end)
common.isPTUStarted()
end
end)
session:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" })
Expand Down
Loading