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

Improve stability of scripts - Release 8.0 #2595

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
7 changes: 6 additions & 1 deletion test_scripts/Defects/5_0/2405/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ function m.policyTableUpdate(pGrp)
table.insert(pTbl.policy_table.app_policies[appId].groups, pGrp[i].name)
end
end
ptuOrig(ptUpdate)
local function expMsgs()
common.getMobileSession():ExpectNotification("OnPermissionsChange")
common.hmi.getConnection():ExpectRequest("VehicleInfo.GetVehicleData", { odometer = true })
common.hmi.getConnection():ExpectNotification("SDL.OnStatusUpdate", { status = "UP_TO_DATE" })
end
ptuOrig(ptUpdate, expMsgs)
end

local function getGroupId(pData, pGrpName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ local function policyTableUpdateHttp()
ptuTable.policy_table.app_policies[common.app.getPolicyAppId(i)] = common.ptu.getAppData(i)
end
utils.tableToJsonFile(ptuTable, ptuFileName)
local cid = common.getMobileSession(ptuAppNum):SendRPC("SystemRequest",
{ requestType = "HTTP", fileName = "PolicyTableUpdate" }, ptuFileName)
if not pExpNotificationFunc then
common.getHMIConnection():ExpectRequest("VehicleInfo.GetVehicleData", { odometer = true })
common.getHMIConnection():ExpectNotification("SDL.OnStatusUpdate", { status = "UP_TO_DATE" })
common.getHMIConnection():ExpectNotification("SDL.OnStatusUpdate",
{ status = "UPDATE_NEEDED" }, { status = "UPDATING" }, { status = "UP_TO_DATE" }):Times(3)
end
local cid = common.getMobileSession(ptuAppNum):SendRPC("SystemRequest",
{ requestType = "HTTP", fileName = "PolicyTableUpdate" }, ptuFileName)
common.getMobileSession(ptuAppNum):ExpectResponse(cid, { success = true, resultCode = "SUCCESS" })
:Do(function() os.remove(ptuFileName) end)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ require("user_modules/AppTypes")
commonFunctions:newTestCasesGroup("Preconditions")

function Test:Precondition_ActivateApp()
EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"}, {status = "UPDATING"}):Times(2)
local requestId1 = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications["Test Application"] })
EXPECT_HMIRESPONSE(requestId1)
:Do(function(_, data1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ for option,appHMIType in pairs(common.appHMITypesByOption) do
runner.Step("Set resumption config for " .. option, common.write_parameter_to_smart_device_link_ini, { option .. "TransportRequiredForResumption", "TCP_WIFI" })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("App registration", common.registerAppWOPTU)
runner.Step("Pin OnHashChange", common.pinOnHashChange)
runner.Step("App activation", common.activateApp)
runner.Step("App activation", common.activateApp)
for i = 1,3 do
runner.Step("AddCommand" .. i, common.addCommand, { common.getAddCommandParams(i) })
end
Expand All @@ -53,4 +52,4 @@ for option,appHMIType in pairs(common.appHMITypesByOption) do
runner.Title("Postconditions")
runner.Step("Clean sessions", common.cleanSessions)
runner.Step("Stop SDL", common.postconditions)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ for option,appHMIType in pairs(common.appHMITypesByOption) do
runner.Step("Set HMI level config for " .. option, common.writeLowBandwidthResumptionLevel, { option, "NONE" })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("App registration", common.registerAppWOPTU)
runner.Step("Pin OnHashChange", common.pinOnHashChange)
runner.Step("App activation", common.activateApp)
runner.Step("App activation", common.activateApp)
for i = 1,3 do
runner.Step("AddCommand" .. i, common.addCommand, { common.getAddCommandParams(i) })
end
Expand All @@ -56,4 +55,4 @@ for option,appHMIType in pairs(common.appHMITypesByOption) do
runner.Title("Postconditions")
runner.Step("Clean sessions", common.cleanSessions)
runner.Step("Stop SDL", common.postconditions)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ runner.Step("Set resumption config for " .. option, common.write_parameter_to_sm
runner.Step("Set HMI level config for " .. option, common.writeLowBandwidthResumptionLevel, { option, "LIMITED" })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("App registration", common.registerAppWOPTU)
runner.Step("Pin OnHashChange", common.pinOnHashChange)
runner.Step("App activation", common.activateApp)
for i = 1,3 do
runner.Step("AddCommand" .. i, common.addCommand, { common.getAddCommandParams(i) })
Expand All @@ -58,4 +57,4 @@ runner.Step("App resumption", common.registrationWithResumption,
{ 1, resumptionLevelNavi, common.resumptionDataAddCommands })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ runner.Step("Set resumption config for " .. option, common.write_parameter_to_sm
runner.Step("Set HMI level config for " .. option, common.writeLowBandwidthResumptionLevel, { option, "BACKGROUND" })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("App registration", common.registerAppWOPTU)
runner.Step("Pin OnHashChange", common.pinOnHashChange)
runner.Step("App activation", common.activateApp)
for i = 1,3 do
runner.Step("AddCommand" .. i, common.addCommand, { common.getAddCommandParams(i) })
Expand All @@ -58,4 +57,4 @@ runner.Step("App resumption", common.registrationWithResumption,
{ 1, resumptionLevelProjection, common.resumptionDataAddCommands })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ runner.Step("Set resumption config for " .. option, common.write_parameter_to_sm
runner.Step("Set HMI level config for " .. option, common.writeMediaLowBandwidthResumptionLevel, { "FULL" })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("App registration", common.registerAppWOPTU)
runner.Step("Pin OnHashChange", common.pinOnHashChange)
runner.Step("App activation", common.activateApp)
for i = 1,3 do
runner.Step("AddCommand" .. i, common.addCommand, { common.getAddCommandParams(i) })
Expand All @@ -57,4 +56,4 @@ runner.Step("App resumption", common.registrationWithResumption,
{ 1, resumptionLevelMedia, common.resumptionDataAddCommands })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ runner.Step("Set HMI level config for " .. option, common.writeLowBandwidthResum
runner.Step("Set HMI level config for " .. option, common.writeMediaLowBandwidthResumptionLevel, { "FULL" })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("App registration", common.registerAppWOPTU)
runner.Step("Pin OnHashChange", common.pinOnHashChange)
runner.Step("App activation", common.activateApp)
for i = 1,3 do
runner.Step("AddCommand" .. i, common.addCommand, { common.getAddCommandParams(i) })
Expand All @@ -60,4 +59,4 @@ runner.Step("App resumption", common.registrationWithResumption,
{ 1, resumptionLevelMedia, common.resumptionDataAddCommands })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
runner.Step("Stop SDL", common.postconditions)
14 changes: 4 additions & 10 deletions test_scripts/SDL5_0/ConditionalResumption/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,6 @@ function common.preconditions()
common.hashID = nil
end

function common.pinOnHashChange(pAppId)
if not pAppId then pAppId = 1 end
common.getMobileSession(pAppId):ExpectNotification("OnHashChange")
:Pin()
:Times(AnyNumber())
:Do(function(_, data)
common.hashId = data.payload.hashID
end)
end

function common.cleanSessions()
for i = 1, common.getAppsCount() do
test.mobileSession[i]:StopRPC()
Expand Down Expand Up @@ -165,6 +155,10 @@ function common.addCommand(pParams, pAppId)
end)
end
mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS"})
common.getMobileSession(pAppId):ExpectNotification("OnHashChange")
:Do(function(_, data)
common.hashId = data.payload.hashID
end)
end


Expand Down