Skip to content

Commit 1bb65f0

Browse files
KrupenichOlegGetmanetsIrina
authored andcommitted
ATF script for defect 1846
1 parent 67f11b7 commit 1bb65f0

2 files changed

Lines changed: 89 additions & 0 deletions

File tree

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---------------------------------------------------------------------------------------------------
2+
-- User story: https://github.com/SmartDeviceLink/sdl_core/issues/1846
3+
--
4+
-- Description:
5+
-- Mismatch for mandatory parameter between MOBILE_API and HMI_API
6+
--
7+
-- Preconditions:
8+
-- 1) Clear environment
9+
-- 2) SDL started, HMI and mobile session connected
10+
-- 3) Registered and activated app
11+
-- 5) PTU
12+
--
13+
-- Steps:
14+
-- 1) send mobile RPC "ShowConstantTBT" without "distanceToManeuver" param
15+
-- and recieve resultCode = "INVALID_DATA"
16+
-- 2) send mobile RPC "ShowConstantTBT" without "distanceToManeuverScale" param
17+
-- and recieve resultCode = "INVALID_DATA"
18+
-- 3) send mobile RPC "ShowConstantTBT" with "distanceToManeuver" and
19+
-- "distanceToManeuverScale" params and recieve resultCode = "SUCCESS"
20+
--
21+
-- Expected:
22+
-- Params "distanceToManeuver" and "distanceToManeuverScale" of the mobile RPC "ShowConstantTBT"
23+
-- should be mandatory
24+
---------------------------------------------------------------------------------------------------
25+
26+
--[[ Required Shared libraries ]]
27+
local runner = require('user_modules/script_runner')
28+
local common = require('user_modules/sequences/actions')
29+
30+
--[[ Test Configuration ]]
31+
runner.testSettings.isSelfIncluded = false
32+
33+
--[[ Local Variables ]]
34+
local params = {
35+
distanceToManeuver = 50.1,
36+
distanceToManeuverScale = 100.2
37+
}
38+
39+
--[[ Local Functions ]]
40+
local function ptuFunc(tbl)
41+
tbl.policy_table.app_policies["0000001"].groups = {"Base-4", "Navigation-1"}
42+
end
43+
44+
local function checkShowConstantTBTPositive(pParams)
45+
local cid = common.getMobileSession():SendRPC("ShowConstantTBT", pParams)
46+
47+
common.getHMIConnection():ExpectRequest("Navigation.ShowConstantTBT", pParams)
48+
:Do(function(_, data)
49+
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {})
50+
end)
51+
52+
common.getMobileSession():ExpectResponse(cid, {
53+
success = true,
54+
resultCode = "SUCCESS"
55+
})
56+
end
57+
58+
local function checkShowConstantTBTNegative(pParams)
59+
local cid = common.getMobileSession():SendRPC("ShowConstantTBT", pParams)
60+
61+
common.getHMIConnection():ExpectRequest("Navigation.ShowConstantTBT", pParams)
62+
:Times(0)
63+
64+
common.getMobileSession():ExpectResponse(cid, {
65+
success = false,
66+
resultCode = "INVALID_DATA"
67+
})
68+
end
69+
70+
--[[ Scenario ]]
71+
runner.Title("Preconditions")
72+
runner.Step("Clean environment", common.preconditions)
73+
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
74+
runner.Step("RAI", common.registerApp)
75+
runner.Step("Activate App", common.activateApp)
76+
runner.Step("PTU", common.policyTableUpdate, { ptuFunc })
77+
78+
runner.Title("Test")
79+
runner.Step("Negative check mandatory parameter distanceToManeuver", checkShowConstantTBTNegative, {{
80+
distanceToManeuverScale = params.distanceToManeuver
81+
}})
82+
runner.Step("Negative check mandatory parameter distanceToManeuverScale", checkShowConstantTBTNegative, {{
83+
distanceToManeuver = params.distanceToManeuver
84+
}})
85+
runner.Step("Positive case for ShowConstantTBT", checkShowConstantTBTPositive, {params})
86+
87+
runner.Title("Postconditions")
88+
runner.Step("Stop SDL", common.postconditions)

test_sets/Defects/Defects_release_7_1.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@
3131
./test_scripts/Defects/7_1/3640_PTU_all_flows_Protected_Mode_v3.lua
3232
./test_scripts/Defects/7_1/3659_OnSystemRequest_1st_frame_non-encrypted.lua
3333
./test_scripts/Defects/7_1/3667_Revert_RC_SetGlobalProperties_on_failed_resumption.lua
34+
./test_scripts/Defects/7_1/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua

0 commit comments

Comments
 (0)