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

Add tests for handling OnWayPointChange from mobile #2486

Merged
merged 4 commits into from
Dec 9, 2020
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 @@ -60,7 +60,7 @@ local function PTUfunc(tbl)
end

--[[ Local Functions ]]
local function processRPCSuccess(self)
local function processRPCSuccess()
local mobileSession = common.getMobileSession(1)
local mobileSession2 = common.getMobileSession(2)
local service_id = common.getAppServiceID(2)
Expand Down Expand Up @@ -89,6 +89,7 @@ runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI", common.registerApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("RAI w/o PTU", common.registerAppWOPTU, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })
runner.Step("Activate App", common.activateApp)
runner.Step("Publish App Service", common.publishMobileAppService, { manifest })
runner.Step("Publish App Service 2", common.publishSecondMobileAppService, { manifest, manifest2, 2 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ local function PTUfunc(tbl)
end

--[[ Local Functions ]]
local function processRPCSuccess(self)
local function processRPCSuccess()
local mobileSession = common.getMobileSession(1)
local mobileSession2 = common.getMobileSession(2)
local service_id = common.getAppServiceID(2)
Expand All @@ -91,7 +91,7 @@ local function processRPCSuccess(self)
mobileSession2:ExpectNotification("OnSystemCapabilityUpdated", combinedParams):Times(AtLeast(1))
end

local function disconnectDefaultService(self)
local function disconnectDefaultService()
local mobileSession = common.getMobileSession(2)
local cid = mobileSession:SendRPC("UnregisterAppInterface", {})
mobileSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" })
Expand All @@ -107,7 +107,7 @@ local function disconnectDefaultService(self)

end

local function republishDefaultApp(self)
local function republishDefaultApp()
local mobileSession = common.getMobileSession(2)
local cid = mobileSession:SendRPC("PublishAppService", {
appServiceManifest = manifest2
Expand Down Expand Up @@ -145,6 +145,7 @@ runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI", common.registerApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("RAI w/o PTU", common.registerAppWOPTU, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })
runner.Step("Activate App", common.activateApp)
runner.Step("Publish App Service", common.publishMobileAppService, { manifest })
runner.Step("Publish App Service 2", common.publishSecondMobileAppService, { manifest, manifest2, 2 })
Expand All @@ -158,8 +159,9 @@ runner.Step("Stop SDL", common.postconditions)
runner.Step("Clean environment", commonFunctions.SDLForceStop)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI w/o PTU", common.registerAppWOPTU, { 1 })
runner.Step("RAI w/o PTU App 2", common.registerAppWOPTU, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })
runner.Step("Activate App", common.activateApp)
runner.Step("RAI w/o PTU", common.registerAppWOPTU, { 2 })
runner.Step("Publish App Service", common.publishMobileAppService, { manifest })
runner.Step("Reconnect Default Service App", republishDefaultApp)

Expand Down
5 changes: 3 additions & 2 deletions test_scripts/AppServices/GetFile/003_GetFile_Mobile_ASP.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI App 1", common.registerApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("Putfile", common.putFileInStorage, {1, putFileParams, result})
runner.Step("Activate App 1", common.activateApp)
runner.Step("PutFile", common.putFileInStorage, {1, putFileParams, result})
runner.Step("PublishAppService", common.publishMobileAppService, { manifest, 1 })
runner.Step("RAI App 2", common.registerAppWOPTU, { 2 })
runner.Step("Activate App", common.activateApp, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })

runner.Title("Test")
runner.Step("Getfile", common.getFileFromService, {2, 1, getFileParams, result})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ local function PTUfunc(tbl)
end

--[[ Local Functions ]]
local function processRPCFailure(self)
local function processRPCFailure()
local mobileSession = common.getMobileSession(1)
local mobileSession2 = common.getMobileSession(2)
local service_id = common.getAppServiceID()
Expand All @@ -86,7 +86,9 @@ runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI", common.registerApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("Activate App 1", common.activateApp)
runner.Step("RAI w/o PTU", common.registerAppWOPTU, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })
runner.Step("Publish Embedded Service", common.publishEmbeddedAppService, { hmiManifest })
runner.Step("Publish App Service", common.publishMobileAppService, { manifest })
runner.Step("Subscribe App Service Data", common.mobileSubscribeAppServiceData, { 0, manifest.serviceType, 2 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ local function PTUfunc(tbl)
end

--[[ Local Functions ]]
local function processRPCFailure(self)
local function processRPCFailure()
local mobileSession = common.getMobileSession(1)
local mobileSession2 = common.getMobileSession(2)
local notificationParams = expectedNotification
Expand All @@ -77,6 +77,7 @@ runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI", common.registerApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("Activate App", common.activateApp)
runner.Step("RAI w/o PTU", common.registerAppWOPTU, { 2 })
runner.Step("Publish App Service", common.publishMobileAppService, { manifest })
runner.Step("Subscribe App Service Data", common.mobileSubscribeAppServiceData, { 1, manifest.serviceType, 2 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ local function PTUfunc(tbl)
end

--[[ Local Functions ]]
local function processRPCFailure(self)
local function processRPCFailure()
local mobileSession = common.getMobileSession(1)
local mobileSession2 = common.getMobileSession(2)
local notificationParams = expectedNotification
Expand All @@ -87,6 +87,7 @@ runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI", common.registerApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("RAI w/o PTU", common.registerAppWOPTU, { 2 })
runner.Step("Activate App", common.activateApp)
runner.Step("Publish App Service", common.publishMobileAppService, { manifest })
runner.Step("Publish Embedded Service", common.publishEmbeddedAppService, { hmiManifest })
runner.Step("Subscribe App Service Data", common.mobileSubscribeAppServiceData, { 0, hmiManifest.serviceType, 2 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ local function PTUfunc(tbl)
end

--[[ Local Functions ]]
local function processRPCSuccess(self)
local function processRPCSuccess()
local mobileSession = common.getMobileSession(1)
local mobileSession2 = common.getMobileSession(2)
local service_id = common.getAppServiceID()
Expand All @@ -79,10 +79,10 @@ local function processRPCSuccess(self)
})
end)
local serviceParams = common.appServiceCapability("ACTIVATED", manifest)
mobileSession:ExpectNotification("OnSystemCapabilityUpdated"):ValidIf(function(self, data)
mobileSession:ExpectNotification("OnSystemCapabilityUpdated"):ValidIf(function(_, data)
return common.findCapabilityUpdate(serviceParams, data.payload)
end)
EXPECT_HMINOTIFICATION("BasicCommunication.OnSystemCapabilityUpdated"):ValidIf(function(self, data)
EXPECT_HMINOTIFICATION("BasicCommunication.OnSystemCapabilityUpdated"):ValidIf(function(_, data)
return common.findCapabilityUpdate(serviceParams, data.params)
end)

Expand All @@ -101,6 +101,9 @@ runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI", common.registerApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("RAI w/o PTU", common.registerAppWOPTU, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })
runner.Step("Activate App 1", common.activateApp)
runner.Step("Dectivate App to Background", common.deactivateAppToBackground)
runner.Step("Publish Embedded Service", common.publishEmbeddedAppService, { hmiManifest })
runner.Step("Publish App Service", common.publishMobileAppService, { manifest })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ local function PTUfunc(tbl)
end

--[[ Local Functions ]]
local function processRPCSuccess(self)
local function processRPCSuccess()
local mobileSession = common.getMobileSession(1)
local mobileSession2 = common.getMobileSession(2)
local service_id = common.getAppServiceID()
Expand All @@ -75,10 +75,10 @@ local function processRPCSuccess(self)
-- Should not prompt user if app is in foreground
EXPECT_HMICALL("AppService.GetActiveServiceConsent", { serviceID = service_id }):Times(0)
local serviceParams = common.appServiceCapability("ACTIVATED", manifest)
mobileSession:ExpectNotification("OnSystemCapabilityUpdated"):ValidIf(function(self, data)
mobileSession:ExpectNotification("OnSystemCapabilityUpdated"):ValidIf(function(_, data)
return common.findCapabilityUpdate(serviceParams, data.payload)
end)
EXPECT_HMINOTIFICATION("BasicCommunication.OnSystemCapabilityUpdated"):ValidIf(function(self, data)
EXPECT_HMINOTIFICATION("BasicCommunication.OnSystemCapabilityUpdated"):ValidIf(function(_, data)
return common.findCapabilityUpdate(serviceParams, data.params)
end)

Expand All @@ -96,8 +96,9 @@ runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI", common.registerApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("Activate App 1", common.activateApp)
runner.Step("RAI w/o PTU", common.registerAppWOPTU, { 2 })
runner.Step("Activate App", common.activateApp, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })
runner.Step("Publish Embedded Service", common.publishEmbeddedAppService, { hmiManifest })
runner.Step("Publish App Service", common.publishMobileAppService, { manifest })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ local function PTUfunc(tbl)
end

--[[ Local Functions ]]
local function processRPCSuccess(self)
local function processRPCSuccess()
local mobileSession = common.getMobileSession()
local service_id = common.getAppServiceID()
local requestParams = rpc.params
requestParams.serviceID = service_id
local cid = common.getHMIConnection():SendRequest(rpc.hmiName, requestParams)
local serviceParams = common.appServiceCapability("ACTIVATED", manifest)
mobileSession:ExpectNotification("OnSystemCapabilityUpdated"):ValidIf(function(self, data)
mobileSession:ExpectNotification("OnSystemCapabilityUpdated"):ValidIf(function(_, data)
return common.findCapabilityUpdate(serviceParams, data.payload)
end)
EXPECT_HMINOTIFICATION("BasicCommunication.OnSystemCapabilityUpdated"):ValidIf(function(self, data)
EXPECT_HMINOTIFICATION("BasicCommunication.OnSystemCapabilityUpdated"):ValidIf(function(_, data)
return common.findCapabilityUpdate(serviceParams, data.params)
end)
local passedRequestParams = requestParams
Expand All @@ -97,6 +97,8 @@ runner.Step("Clean environment", common.preconditions)
runner.Step("Set HMI Origin ID", common.setSDLIniParameter, { "HMIOriginID", hmiOriginID })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI", common.registerApp)
runner.Step("Activate App", common.activateApp)
runner.Step("Dectivate App to Background", common.deactivateAppToBackground)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("Publish Embedded Service", common.publishEmbeddedAppService, { hmiManifest })
runner.Step("Publish App Service", common.publishMobileAppService, { manifest })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ end

--[[ Local Functions ]]

local function processRPCRejected(self)
local function processRPCRejected()
local mobileSession = common.getMobileSession(2)
local cid = mobileSession:SendRPC(rpc.name, rpc.params)

Expand All @@ -79,9 +79,10 @@ runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI", common.registerApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("RAI w/o PTU", common.registerAppWOPTU, { 2 })
runner.Step("Activate App", common.activateApp)
runner.Step("Activate App 1", common.activateApp)
runner.Step("Publish App Service", common.publishMobileAppService, { manifest })
runner.Step("RAI w/o PTU", common.registerAppWOPTU, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })

runner.Title("Test")
runner.Step("RPC " .. rpc.name .. "_resultCode_REJECTED", processRPCRejected)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local manifest = {
handledRPCs = {39},
allowAppConsumers = true,
rpcSpecVersion = config.application1.registerAppInterfaceParams.syncMsgVersion,
navigationServiceManifest = {}
navigationServiceManifest = {acceptsWayPoints = true}
}

local successResponse = {
Expand Down Expand Up @@ -88,10 +88,11 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI App 1", common.registerApp)
runner.Step("Activate App 1", common.activateApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("PublishAppService", common.publishMobileAppService, { manifest, 1 })
runner.Step("RAI App 2", common.registerAppWOPTU, { 2 })
runner.Step("Activate App", common.activateApp, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })

runner.Title("Test")
runner.Step("RPCPassThroughTest_SUCCESS", RPCPassThruTest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local manifest = {
handledRPCs = {39},
allowAppConsumers = true,
rpcSpecVersion = config.application1.registerAppInterfaceParams.syncMsgVersion,
navigationServiceManifest = {}
navigationServiceManifest = {acceptsWayPoints = true}
}

local unsupportedResponse = {
Expand Down Expand Up @@ -96,10 +96,11 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI App 1", common.registerApp)
runner.Step("Activate App 1", common.activateApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("PublishAppService", common.publishMobileAppService, { manifest, 1 })
runner.Step("RAI App 2", common.registerAppWOPTU, { 2 })
runner.Step("Activate App", common.activateApp, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })

runner.Title("Test")
runner.Step("RPCPassThroughTest_UNSUPPORTED", RPCPassThruTest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local manifest = {
handledRPCs = { 39 },
allowAppConsumers = true,
rpcSpecVersion = config.application1.registerAppInterfaceParams.syncMsgVersion,
navigationServiceManifest = {}
navigationServiceManifest = {acceptsWayPoints = true}
}

local successResponse = {
Expand Down Expand Up @@ -97,10 +97,11 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI App 1", common.registerApp)
runner.Step("Activate App 1", common.activateApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("PublishAppService", common.publishMobileAppService, { manifest, 1 })
runner.Step("RAI App 2", common.registerAppWOPTU, { 2 })
runner.Step("Activate App", common.activateApp, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })

runner.Title("Test")
runner.Step("RPCPassThroughTest_TIMEOUT", RPCPassThruTest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ local manifest = {
handledRPCs = { 39 },
allowAppConsumers = true,
rpcSpecVersion = config.application1.registerAppInterfaceParams.syncMsgVersion,
navigationServiceManifest = {}
navigationServiceManifest = {acceptsWayPoints = true}
}

local manifest2 = {
Expand Down Expand Up @@ -127,12 +127,14 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI App 1", common.registerApp)
runner.Step("Activate App 1", common.activateApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("Publish NAVIGATION AppService", common.publishMobileAppService, { manifest, 1 })
runner.Step("RAI App 2", common.registerAppWOPTU, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })
runner.Step("Publish MEDIA AppService", common.publishMobileAppService, { manifest2, 2 })
runner.Step("RAI App 3", common.registerAppWOPTU, { 3 })
runner.Step("Activate App", common.activateApp, { 3 })
runner.Step("Activate App 3", common.activateApp, { 3 })

runner.Title("Test")
runner.Step("RPCPassThroughTest_MultipleAS", RPCPassThruTest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ local manifest = {
handledRPCs = {39},
allowAppConsumers = true,
rpcSpecVersion = config.application1.registerAppInterfaceParams.syncMsgVersion,
navigationServiceManifest = {}
navigationServiceManifest = {acceptsWayPoints = true}
}

local disallowedResponse = {
Expand Down Expand Up @@ -76,10 +76,11 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI App 1", common.registerApp)
runner.Step("Activate App 1", common.activateApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("PublishAppService", common.publishMobileAppService, { manifest, 1 })
runner.Step("RAI App 2", common.registerAppWOPTU, { 2 })
runner.Step("Activate App", common.activateApp, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })

runner.Title("Test")
runner.Step("RPCPassThroughTest_DISALLOWED", RPCPassThruTest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI App 1", common.registerApp)
runner.Step("Activate App 1", common.activateApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("PublishAppService", common.publishMobileAppService, { manifest, 1 })
runner.Step("RAI App 2", common.registerAppWOPTU, { 2 })
runner.Step("Activate App", common.activateApp, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })

runner.Title("Test")
runner.Step("RPCPassThroughTest_SUCCESS", RPCPassThruTest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI App 1", common.registerApp)
runner.Step("Activate App 1", common.activateApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("PublishAppService", common.publishMobileAppService, { manifest, 1 })
runner.Step("RAI App 2", common.registerAppWOPTU, { 2 })
runner.Step("Activate App", common.activateApp, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })

runner.Title("Test")
runner.Step("RPCPassThroughTest_DISALLOWED", RPCPassThruTest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI App 1", common.registerApp)
runner.Step("Activate App 1", common.activateApp)
runner.Step("PTU", common.policyTableUpdate, { PTUfunc })
runner.Step("PublishAppService", common.publishMobileAppService, { manifest, 1 })
runner.Step("RAI App 2", common.registerAppWOPTU, { 2 })
runner.Step("Activate App", common.activateApp, { 2 })
runner.Step("Activate App 2", common.activateApp, { 2 })

runner.Title("Test")
runner.Step("RPCPassThroughTest_UNSUPPORTED", RPCPassThruTest)
Expand Down
Loading