-
Notifications
You must be signed in to change notification settings - Fork 60
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 PTU check for allow_unknown_rpc_passthrough #2187
Add PTU check for allow_unknown_rpc_passthrough #2187
Conversation
test_scripts/AppServices/RPCPassThrough/005_PTU_allow_unknown_rpc_passthrough.lua
Outdated
Show resolved
Hide resolved
--------------------------------------------------------------------------------------------------- | ||
-- Precondition: | ||
-- 1) app1, app2 and app3 are registered on SDL. | ||
-- 2) AppServiceProvider permissions(with NAVIGATION AppService permissions to handle rpc SendLocation) are assigned for <app1ID> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 2) AppServiceProvider permissions(with NAVIGATION AppService permissions to handle rpc SendLocation) are assigned for <app1ID> | |
-- 2) AppServiceProvider permissions(with NAVIGATION AppService permissions to handle rpc FutureRequest) are assigned for <app1ID> |
-- Precondition: | ||
-- 1) app1, app2 and app3 are registered on SDL. | ||
-- 2) AppServiceProvider permissions(with NAVIGATION AppService permissions to handle rpc SendLocation) are assigned for <app1ID> | ||
-- 3) AppServiceProvider permissions(with MEDIA AppService permissions to handle rpc SendLocation) are assigned for <app2ID> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 3) AppServiceProvider permissions(with MEDIA AppService permissions to handle rpc SendLocation) are assigned for <app2ID> | |
-- 3) AppServiceProvider permissions(with MEDIA AppService permissions to handle rpc FutureRequest) are assigned for <app2ID> |
-- 2) AppServiceProvider permissions(with NAVIGATION AppService permissions to handle rpc SendLocation) are assigned for <app1ID> | ||
-- 3) AppServiceProvider permissions(with MEDIA AppService permissions to handle rpc SendLocation) are assigned for <app2ID> | ||
-- 4) Base-4 permissions are assigned for <app3ID> | ||
-- 5) pt_entry.allow_unknown_rpc_passthrough = false policy assigned for <app3ID> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 5) pt_entry.allow_unknown_rpc_passthrough = false policy assigned for <app3ID> | |
-- 5) allow_unknown_rpc_passthrough = false policy assigned for <app3ID> |
-- 3) AppServiceProvider permissions(with MEDIA AppService permissions to handle rpc SendLocation) are assigned for <app2ID> | ||
-- 4) Base-4 permissions are assigned for <app3ID> | ||
-- 5) pt_entry.allow_unknown_rpc_passthrough = false policy assigned for <app3ID> | ||
-- 6) app1 sends a PublishAppService (with {serviceType=NAVIGATION, handledRPC=SendLocation} in the manifest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 6) app1 sends a PublishAppService (with {serviceType=NAVIGATION, handledRPC=SendLocation} in the manifest) | |
-- 6) app1 sends a PublishAppService (with {serviceType=NAVIGATION, handledRPC=FutureRequest} in the manifest) |
-- 4) Base-4 permissions are assigned for <app3ID> | ||
-- 5) pt_entry.allow_unknown_rpc_passthrough = false policy assigned for <app3ID> | ||
-- 6) app1 sends a PublishAppService (with {serviceType=NAVIGATION, handledRPC=SendLocation} in the manifest) | ||
-- 7) app2 sends a PublishAppService (with {serviceType=MEDIA, handledRPC=SendLocation} in the manifest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 7) app2 sends a PublishAppService (with {serviceType=MEDIA, handledRPC=SendLocation} in the manifest) | |
-- 7) app2 sends a PublishAppService (with {serviceType=MEDIA, handledRPC=FutureRequest} in the manifest) |
local manifest2 = { | ||
serviceName = config.application2.registerAppInterfaceParams.appName, | ||
serviceType = "MEDIA", | ||
handledRPCs = { 109 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handledRPCs = { 109 }, | |
handledRPCs = { rpcRequest.funcId }, |
local manifest = { | ||
serviceName = config.application1.registerAppInterfaceParams.appName, | ||
serviceType = "NAVIGATION", | ||
handledRPCs = { 109 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handledRPCs = { 109 }, | |
handledRPCs = { rpcRequest.funcId }, |
local function PTUfunc(tbl) | ||
--Add permissions for app1 | ||
local pt_entry = common.getAppServiceProducerConfig(1) | ||
pt_entry.app_services.NAVIGATION = { handled_rpcs = {{function_id = 109}} } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pt_entry.app_services.NAVIGATION = { handled_rpcs = {{function_id = 109}} } | |
pt_entry.app_services.NAVIGATION = { handled_rpcs = {{function_id = rpcRequest.funcId}} } |
tbl.policy_table.app_policies[common.getConfigAppParams(1).fullAppID] = pt_entry | ||
--Add permissions for app2 | ||
pt_entry = common.getAppServiceProducerConfig(2) | ||
pt_entry.app_services.MEDIA.handled_rpcs = {{function_id = 109}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pt_entry.app_services.MEDIA.handled_rpcs = {{function_id = 109}} | |
pt_entry.app_services.MEDIA.handled_rpcs = {{function_id = rpcRequest.funcId}} |
@@ -0,0 +1,126 @@ | |||
--------------------------------------------------------------------------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps rename the file to indicate that allow_unknown_rpc_passthrough
had been set to false. Maybe something like 009_UnknownRPC_Passthrough_Disallowed
@@ -0,0 +1,126 @@ | |||
--------------------------------------------------------------------------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an outdated version of one of my tests: https://github.com/smartdevicelink/sdl_atf_test_scripts/pull/2188/files#diff-a0d996330af833ecde62a2071206c093
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see how it is different, using allow_unknown_rpc_passthrough
as false. Still, I might suggest using the latest version of https://github.com/smartdevicelink/sdl_atf_test_scripts/pull/2188/files#diff-aecc1389162e76ba570ab26084cb9d94 as a base for this.
...vices/RPCPassThrough/009_UnknownRPC_Consumer_UNSUPPORTED_REQUEST_policy_allow_flag_false.lua
Outdated
Show resolved
Hide resolved
…r_UNSUPPORTED_REQUEST_policy_allow_flag_false.lua Co-Authored-By: JackLivio <jack@livio.io>
...vices/RPCPassThrough/009_UnknownRPC_Consumer_UNSUPPORTED_REQUEST_policy_allow_flag_false.lua
Outdated
Show resolved
Hide resolved
-- | ||
-- Expected: | ||
-- 1) Core does not forward the request to any provider application | ||
-- 2) core responds to app3 with { success = false, resultCode = "UNSUPPORTED_REQUEST" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 2) core responds to app3 with { success = false, resultCode = "UNSUPPORTED_REQUEST" } | |
-- 2) Core responds to app3 with { success = false, resultCode = "UNSUPPORTED_REQUEST" } |
…r_UNSUPPORTED_REQUEST_policy_allow_flag_false.lua Co-Authored-By: JackLivio <jack@livio.io>
This PR is not ready for review.
Summary
Add tests for app policy field
allow_unknown_rpc_passthrough
WIP, more tests being added
CLA