-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extending coverage for 2238 issue (#2556)
- Loading branch information
1 parent
58ebffa
commit 7a8a1a7
Showing
7 changed files
with
410 additions
and
10 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
...ubscribeVD_Resumption_of_subscription_for_2_apps_Unexpected_Disconnect_different_data.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2283 | ||
-- | ||
-- Description: Check that SDL resumes the subscription for different <vd_param> parameters for two Apps | ||
-- after unexpected disconnect | ||
-- | ||
-- Precondition: | ||
-- 1) Two apps are registered and activated | ||
-- 2) App_1 is subscribed to <vd_param_1> parameter | ||
-- 3) App_2 is subscribed to <vd_param_2> parameter | ||
-- 4) Unexpected disconnect and reconnect are performed | ||
-- | ||
-- In case: | ||
-- 1) App_1 registers with actual hashID | ||
-- SDL does: | ||
-- a) start data resumption for App_1 | ||
-- b) start to resume the subscription and sends VI.SubscribeVehicleData(<vd_param_1>) request to HMI | ||
-- c) after success response from HMI SDL resumes the subscription | ||
-- 2) App_2 registers with actual hashID | ||
-- SDL does: | ||
-- a) start data resumption for App_2 | ||
-- b) start to resume the subscription and sends VI.SubscribeVehicleData(<vd_param_2>) request to HMI | ||
-- c) after success response from HMI SDL resumes the subscription | ||
-- 3) HMI sends OnVehicleData notification with <vd_param_1> parameter | ||
-- SDL does: | ||
-- a) resend OnVehicleData notification to mobile App_1 | ||
-- 4) HMI sends OnVehicleData notification with <vd_param_2> parameter | ||
-- SDL does: | ||
-- a) resend OnVehicleData notification to mobile App_2 | ||
-------------------------------------------------------------------------------------------------- | ||
--[[ 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 | ||
|
||
--[[ Scenario ]] | ||
for param1 in common.spairs(common.getVDParams(true)) do | ||
local param2 = common.getAnotherSubVDParam(param1) | ||
common.runner.Title("VD parameters: " .. param1 .. ", " .. param2) | ||
common.runner.Title("Preconditions") | ||
common.runner.Step("Clean environment", common.preconditions) | ||
common.runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
common.runner.Step("Register App1", common.registerAppWOPTU, { common.app[1] }) | ||
common.runner.Step("Register App2", common.registerAppWOPTU, { common.app[2] }) | ||
common.runner.Step("App1 subscribes to VD " .. param1, common.processSubscriptionRPC, | ||
{ common.rpc.sub, param1, common.app[1], common.isExpectedSubscription }) | ||
common.runner.Step("App2 subscribes to VD " .. param2, common.processSubscriptionRPC, | ||
{ common.rpc.sub, param2, common.app[2], common.isExpectedSubscription }) | ||
|
||
common.runner.Title("Test") | ||
common.runner.Step("Unexpected disconnect", common.unexpectedDisconnect, { param1, param2 }) | ||
common.runner.Step("Connect mobile", common.connectMobile) | ||
common.runner.Step("Re-register App1 resumption data", common.registerAppWithResumption, | ||
{ param1, common.app[1], common.isExpectedSubscription }) | ||
common.runner.Step("Re-register App2 resumption data", common.registerAppWithResumption, | ||
{ param2, common.app[2], common.isExpectedSubscription }) | ||
common.runner.Step("OnVehicleData for App_1", common.sendOnVehicleDataTwoApps, | ||
{ param1, common.isExpected, common.isNotExpected }) | ||
common.runner.Step("OnVehicleData for App_2", common.sendOnVehicleDataTwoApps, | ||
{ param2, common.isNotExpected, common.isExpected }) | ||
|
||
common.runner.Title("Postconditions") | ||
common.runner.Step("Stop SDL", common.postconditions) | ||
end |
66 changes: 66 additions & 0 deletions
66
...a/014_SubscribeVD_Resumption_of_subscription_for_2_apps_Ignition_Cycle_different_data.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2283 | ||
-- | ||
-- Description: Check that SDL resumes the subscription for different <vd_param> parameter for two Apps | ||
-- after Ignition Cycle | ||
-- | ||
-- Precondition: | ||
-- 1) Two apps are registered and activated | ||
-- 2) App_1 is subscribed to <vd_param_1> parameter | ||
-- 3) App_2 is subscribed to <vd_param_2> parameter | ||
-- 4) Ignition cycle is performed | ||
-- | ||
-- In case: | ||
-- 1) App_1 registers with actual hashID | ||
-- SDL does: | ||
-- a) start data resumption for App_1 | ||
-- b) start to resume the subscription and sends VI.SubscribeVehicleData request to HMI | ||
-- c) after success response from HMI SDL resumes the subscription | ||
-- 2) App_2 registers with actual hashID | ||
-- SDL does: | ||
-- a) start data resumption for App_2 | ||
-- b) start to resume the subscription and sends VI.SubscribeVehicleData request to HMI | ||
-- 3) HMI sends OnVehicleData notification with <vd_param_1> parameter | ||
-- SDL does: | ||
-- a) resend OnVehicleData notification to mobile App_1 | ||
-- 4) HMI sends OnVehicleData notification with <vd_param_2> parameter | ||
-- SDL does: | ||
-- a) resend OnVehicleData notification to mobile App_2 | ||
-------------------------------------------------------------------------------------------------- | ||
--[[ 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 | ||
|
||
--[[ Scenario ]] | ||
for param1 in common.spairs(common.getVDParams(true)) do | ||
local param2 = common.getAnotherSubVDParam(param1) | ||
common.runner.Title("VD parameters: " .. param1 .. ", " .. param2) | ||
common.runner.Title("Preconditions") | ||
common.runner.Step("Clean environment", common.preconditions) | ||
common.runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
common.runner.Step("Register App1", common.registerAppWOPTU, { common.app[1] }) | ||
common.runner.Step("Register App2", common.registerAppWOPTU, { common.app[2] }) | ||
common.runner.Step("App1 subscribes to VD " .. param1, common.processSubscriptionRPC, | ||
{ common.rpc.sub, param1, common.app[1], common.isExpectedSubscription }) | ||
common.runner.Step("App1 subscribes to VD " .. param2, common.processSubscriptionRPC, | ||
{ common.rpc.sub, param2, common.app[2], common.isExpectedSubscription }) | ||
|
||
common.runner.Title("Test") | ||
common.runner.Step("Ignition Off", common.ignitionOff, { param1, param2 }) | ||
common.runner.Step("Ignition On", common.start) | ||
common.runner.Step("Re-register App1 resumption data", common.registerAppWithResumption, | ||
{ param1, common.app[1], common.isExpectedSubscription }) | ||
common.runner.Step("Re-register App2 resumption data", common.registerAppWithResumption, | ||
{ param2, common.app[2], common.isExpectedSubscription }) | ||
common.runner.Step("OnVehicleData for App_1", common.sendOnVehicleDataTwoApps, | ||
{ param1, common.isExpected, common.isNotExpected }) | ||
common.runner.Step("OnVehicleData for App_2", common.sendOnVehicleDataTwoApps, | ||
{ param2, common.isNotExpected, common.isExpected }) | ||
|
||
common.runner.Title("Postconditions") | ||
common.runner.Step("Stop SDL", common.postconditions) | ||
end |
71 changes: 71 additions & 0 deletions
71
...ts/API/VehicleData/UnsubscribeVehicleData/009_UnsubscribeVD_for_2_apps_different_data.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2283 | ||
-- | ||
-- Description: Check that SDL processes UnsubscribeVehicleData RPC for two Apps with different <vd_param> parameters | ||
-- | ||
-- Preconditions: | ||
-- 1) SDL and HMI are started | ||
-- 2) Two apps are registered and activated | ||
-- 3) SubscribeVehicleData, UnsubscribeVehicleData RPCs and <vd_param> parameter are allowed by policies | ||
-- 4) App_1 is subscribed to <vd_param_1> parameter | ||
-- 5) App_2 is subscribed to <vd_param_2> parameter | ||
-- | ||
-- In case: | ||
-- 1) App_1 sends valid UnsubscribeVehicleData(<vd_param_1>=true) request to SDL | ||
-- SDL does: | ||
-- - a) transfer this request to HMI | ||
-- 2) HMI sends VI.UnsubscribeVehicleData response with <vd_param_1> data to SDL | ||
-- SDL does: | ||
-- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", | ||
-- <vd_param_1> = <data received from HMI>) to App_1 | ||
-- 3) App_2 sends valid UnsubscribeVehicleData(<vd_param_2>=true) request to SDL | ||
-- SDL does: | ||
-- - a) transfer this request to HMI | ||
-- 4) HMI sends VI.UnsubscribeVehicleData response with <vd_param_2> data to SDL | ||
-- SDL does: | ||
-- - a) send UnsubscribeVehicleData response with (success = true, resultCode = "SUCCESS", | ||
-- <vd_param_2> = <data received from HMI>) to App_2 | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ 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 | ||
|
||
--[[ Scenario ]] | ||
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_1", common.registerApp, { common.app[1] }) | ||
common.runner.Step("Register App_2", common.registerAppWOPTU, { common.app[2] }) | ||
|
||
common.runner.Title("Test") | ||
for param1 in common.spairs(common.getVDParams(true)) do | ||
local param2 = common.getAnotherSubVDParam(param1) | ||
common.runner.Title("VD parameters: " .. param1 .. ", " .. param2) | ||
common.runner.Step("App1 subscribes to VD " .. param1, | ||
common.processSubscriptionRPC, { common.rpc.sub, param1, common.app[1], common.isExpectedSubscription }) | ||
common.runner.Step("App2 subscribes to VD " .. param2, | ||
common.processSubscriptionRPC, { common.rpc.sub, param2, common.app[2], common.isExpectedSubscription }) | ||
common.runner.Step("OnVehicleData for App_1", common.sendOnVehicleDataTwoApps, | ||
{ param1, common.isExpected, common.isNotExpected }) | ||
common.runner.Step("OnVehicleData for App_2", common.sendOnVehicleDataTwoApps, | ||
{ param2, common.isNotExpected, common.isExpected }) | ||
common.runner.Step("App1 unsubscribes from VD " .. param1, | ||
common.processSubscriptionRPC, { common.rpc.unsub, param1, common.app[1], common.isExpectedSubscription }) | ||
common.runner.Step("Absence of OnVehicleData for App_1", common.sendOnVehicleDataTwoApps, | ||
{ param1, common.isNotExpected, common.isNotExpected }) | ||
common.runner.Step("OnVehicleData for App_2", common.sendOnVehicleDataTwoApps, | ||
{ param2, common.isNotExpected, common.isExpected }) | ||
common.runner.Step("App2 unsubscribes from VD " .. param2, | ||
common.processSubscriptionRPC, { common.rpc.unsub, param2, common.app[2], common.isExpectedSubscription }) | ||
common.runner.Step("Absence of OnVehicleData for App_1", common.sendOnVehicleDataTwoApps, | ||
{ param1, common.isNotExpected, common.isNotExpected }) | ||
common.runner.Step("Absence of OnVehicleData for App_2", common.sendOnVehicleDataTwoApps, | ||
{ param2, common.isNotExpected, common.isNotExpected }) | ||
end | ||
|
||
common.runner.Title("Postconditions") | ||
common.runner.Step("Stop SDL", common.postconditions) |
51 changes: 51 additions & 0 deletions
51
...I/VehicleData/UnsubscribeVehicleData/010_UnsubscribeVD_for_2_apps_Expected_Disconnect.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2283 | ||
-- | ||
-- Description: Check that SDL processes UnsubscribeVehicleData RPC for two Apps with <vd_param> parameters | ||
-- during an unregistration of App | ||
-- | ||
-- Preconditions: | ||
-- 1) SDL and HMI are started | ||
-- 2) Two apps are registered and activated | ||
-- 3) SubscribeVehicleData, UnsubscribeVehicleData RPCs and <vd_param> parameter are allowed by policies | ||
-- 4) Apps are subscribed to <vd_param> parameter data | ||
-- | ||
-- In case: | ||
-- 1) App_1 sends UnregisterAppInterface request to SDL | ||
-- SDL does: | ||
-- a) not send UnsubscribeVehicleData request to HMI during the unregistration of App1 | ||
-- 2) App_2 sends UnregisterAppInterface request to SDL | ||
-- SDL does: | ||
-- a) send UnsubscribeVehicleData request to HMI during the unregistration of App2 | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local common = require('test_scripts/API/VehicleData/common') | ||
|
||
--[[ Scenario ]] | ||
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.Title("Test") | ||
for param in common.spairs(common.getVDParams(true)) do | ||
common.runner.Step("Register App_1", common.registerApp, { common.app[1] }) | ||
common.runner.Step("Register App_2", common.registerAppWOPTU, { common.app[2] }) | ||
common.runner.Title("VD parameters: " .. param) | ||
common.runner.Step("App1 subscribes to VD " .. param, | ||
common.processSubscriptionRPC, { common.rpc.sub, param, common.app[1], common.isExpectedSubscription }) | ||
common.runner.Step("App2 subscribes to VD " .. param, | ||
common.processSubscriptionRPC, { common.rpc.sub, param, common.app[2], common.isNotExpectedSubscription }) | ||
common.runner.Step("OnVehicleData for both apps", common.sendOnVehicleDataTwoApps, | ||
{ param, common.isExpected, common.isExpected }) | ||
common.runner.Step("Unregister App1 without unsubscribes from VD " .. param, | ||
common.unregisterAppWithUnsubscription, { param, common.app[1], common.isNotExpectedSubscription }) | ||
common.runner.Step("OnVehicleData for both apps", common.sendOnVehicleDataTwoApps, | ||
{ param, common.isNotExpected, common.isExpected }) | ||
common.runner.Step("Unregister App2 with unsubscribes from VD " .. param, | ||
common.unregisterAppWithUnsubscription, { param, common.app[2], common.isExpectedSubscription }) | ||
common.runner.Step("OnVehicleData for both apps", common.sendOnVehicleDataTwoApps, | ||
{ param, common.isNotExpected, common.isNotExpected }) | ||
end | ||
|
||
common.runner.Title("Postconditions") | ||
common.runner.Step("Stop SDL", common.postconditions) |
64 changes: 64 additions & 0 deletions
64
...nsubscribeVehicleData/011_UnsubscribeVD_for_2_apps_Expected_Disconnect_different_data.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2283 | ||
-- | ||
-- Description: Check that SDL processes UnsubscribeVehicleData RPC for two Apps with different <vd_param> parameters | ||
-- during an unregistration of App | ||
-- | ||
-- Preconditions: | ||
-- 1) SDL and HMI are started | ||
-- 2) Two apps are registered and activated | ||
-- 3) SubscribeVehicleData, UnsubscribeVehicleData RPCs and <vd_param> parameter are allowed by policies | ||
-- 4) App_1 is subscribed to <vd_param_1> parameter | ||
-- 5) App_2 is subscribed to <vd_param_2> parameter | ||
-- | ||
-- In case: | ||
-- 1) App_1 sends UnregisterAppInterface request to SDL | ||
-- SDL does: | ||
-- a) send UnsubscribeVehicleData request with <vd_param_1> to HMI during the unregistration of App1 | ||
-- 2) App_2 sends UnregisterAppInterface request to SDL | ||
-- SDL does: | ||
-- a) send UnsubscribeVehicleData request with <vd_param_2> to HMI during the unregistration of App2 | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ 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 | ||
|
||
--[[ Scenario ]] | ||
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.Title("Test") | ||
for param1 in common.spairs(common.getVDParams(true)) do | ||
local param2 = common.getAnotherSubVDParam(param1) | ||
common.runner.Step("Register App_1", common.registerApp, { common.app[1] }) | ||
common.runner.Step("Register App_2", common.registerAppWOPTU, { common.app[2] }) | ||
common.runner.Title("VD parameters: " .. param1 .. ", " .. param2) | ||
common.runner.Step("App1 subscribes to VD " .. param1, | ||
common.processSubscriptionRPC, { common.rpc.sub, param1, common.app[1], common.isExpectedSubscription }) | ||
common.runner.Step("App2 subscribes to VD " .. param2, | ||
common.processSubscriptionRPC, { common.rpc.sub, param2, common.app[2], common.isExpectedSubscription }) | ||
common.runner.Step("OnVehicleData for App_1", common.sendOnVehicleDataTwoApps, | ||
{ param1, common.isExpected, common.isNotExpected }) | ||
common.runner.Step("OnVehicleData for App_2", common.sendOnVehicleDataTwoApps, | ||
{ param2, common.isNotExpected, common.isExpected }) | ||
common.runner.Step("Unregister App1 with unsubscribes from VD " .. param1, | ||
common.unregisterAppWithUnsubscription, { param1, common.app[1], common.isExpectedSubscription }) | ||
common.runner.Step("Absence of OnVehicleData for App_1", common.sendOnVehicleDataTwoApps, | ||
{ param1, common.isNotExpected, common.isNotExpected }) | ||
common.runner.Step("OnVehicleData for App_2", common.sendOnVehicleDataTwoApps, | ||
{ param2, common.isNotExpected, common.isExpected }) | ||
common.runner.Step("Unregister App2 with unsubscribes from VD " .. param2, | ||
common.unregisterAppWithUnsubscription, { param2, common.app[2], common.isExpectedSubscription }) | ||
common.runner.Step("Absence of OnVehicleData for App_1", common.sendOnVehicleDataTwoApps, | ||
{ param1, common.isNotExpected, common.isNotExpected }) | ||
common.runner.Step("Absence of OnVehicleData for App_2", common.sendOnVehicleDataTwoApps, | ||
{ param2, common.isNotExpected, common.isNotExpected }) | ||
end | ||
|
||
common.runner.Title("Postconditions") | ||
common.runner.Step("Stop SDL", common.postconditions) |
Oops, something went wrong.