From 1bb65f066c9ecade144a5df8720caff5554a9903 Mon Sep 17 00:00:00 2001 From: Oleg Krupenich Date: Thu, 18 Oct 2018 12:02:42 +0300 Subject: [PATCH 1/2] ATF script for defect 1846 --- ...rameter_between_MOBILE_API_and_HMI_API.lua | 88 +++++++++++++++++++ test_sets/Defects/Defects_release_7_1.txt | 1 + 2 files changed, 89 insertions(+) create mode 100644 test_scripts/Defects/7_1/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua diff --git a/test_scripts/Defects/7_1/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua b/test_scripts/Defects/7_1/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua new file mode 100644 index 0000000000..cd512e836c --- /dev/null +++ b/test_scripts/Defects/7_1/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua @@ -0,0 +1,88 @@ +--------------------------------------------------------------------------------------------------- +-- User story: https://github.com/SmartDeviceLink/sdl_core/issues/1846 +-- +-- Description: +-- Mismatch for mandatory parameter between MOBILE_API and HMI_API +-- +-- Preconditions: +-- 1) Clear environment +-- 2) SDL started, HMI and mobile session connected +-- 3) Registered and activated app +-- 5) PTU +-- +-- Steps: +-- 1) send mobile RPC "ShowConstantTBT" without "distanceToManeuver" param +-- and recieve resultCode = "INVALID_DATA" +-- 2) send mobile RPC "ShowConstantTBT" without "distanceToManeuverScale" param +-- and recieve resultCode = "INVALID_DATA" +-- 3) send mobile RPC "ShowConstantTBT" with "distanceToManeuver" and +-- "distanceToManeuverScale" params and recieve resultCode = "SUCCESS" +-- +-- Expected: +-- Params "distanceToManeuver" and "distanceToManeuverScale" of the mobile RPC "ShowConstantTBT" +-- should be mandatory +--------------------------------------------------------------------------------------------------- + +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('user_modules/sequences/actions') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local params = { + distanceToManeuver = 50.1, + distanceToManeuverScale = 100.2 +} + +--[[ Local Functions ]] +local function ptuFunc(tbl) + tbl.policy_table.app_policies["0000001"].groups = {"Base-4", "Navigation-1"} +end + +local function checkShowConstantTBTPositive(pParams) + local cid = common.getMobileSession():SendRPC("ShowConstantTBT", pParams) + + common.getHMIConnection():ExpectRequest("Navigation.ShowConstantTBT", pParams) + :Do(function(_, data) + common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) + end) + + common.getMobileSession():ExpectResponse(cid, { + success = true, + resultCode = "SUCCESS" + }) +end + +local function checkShowConstantTBTNegative(pParams) + local cid = common.getMobileSession():SendRPC("ShowConstantTBT", pParams) + + common.getHMIConnection():ExpectRequest("Navigation.ShowConstantTBT", pParams) + :Times(0) + + common.getMobileSession():ExpectResponse(cid, { + success = false, + resultCode = "INVALID_DATA" + }) +end + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +runner.Step("RAI", common.registerApp) +runner.Step("Activate App", common.activateApp) +runner.Step("PTU", common.policyTableUpdate, { ptuFunc }) + +runner.Title("Test") +runner.Step("Negative check mandatory parameter distanceToManeuver", checkShowConstantTBTNegative, {{ + distanceToManeuverScale = params.distanceToManeuver + }}) +runner.Step("Negative check mandatory parameter distanceToManeuverScale", checkShowConstantTBTNegative, {{ + distanceToManeuver = params.distanceToManeuver + }}) +runner.Step("Positive case for ShowConstantTBT", checkShowConstantTBTPositive, {params}) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_sets/Defects/Defects_release_7_1.txt b/test_sets/Defects/Defects_release_7_1.txt index 26d82689df..61038200dc 100644 --- a/test_sets/Defects/Defects_release_7_1.txt +++ b/test_sets/Defects/Defects_release_7_1.txt @@ -31,3 +31,4 @@ ./test_scripts/Defects/7_1/3640_PTU_all_flows_Protected_Mode_v3.lua ./test_scripts/Defects/7_1/3659_OnSystemRequest_1st_frame_non-encrypted.lua ./test_scripts/Defects/7_1/3667_Revert_RC_SetGlobalProperties_on_failed_resumption.lua +./test_scripts/Defects/7_1/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua From 03b5b9931beb10a40aea7e641f9235bd4425b911 Mon Sep 17 00:00:00 2001 From: IGetmanets Date: Tue, 6 Apr 2021 16:36:48 +0300 Subject: [PATCH 2/2] fixup! ATF script for defect 1846 --- ...for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_scripts/Defects/7_1/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua b/test_scripts/Defects/7_1/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua index cd512e836c..18c684545e 100644 --- a/test_scripts/Defects/7_1/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua +++ b/test_scripts/Defects/7_1/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua @@ -8,7 +8,7 @@ -- 1) Clear environment -- 2) SDL started, HMI and mobile session connected -- 3) Registered and activated app --- 5) PTU +-- 4) PTU -- -- Steps: -- 1) send mobile RPC "ShowConstantTBT" without "distanceToManeuver" param @@ -77,7 +77,7 @@ runner.Step("PTU", common.policyTableUpdate, { ptuFunc }) runner.Title("Test") runner.Step("Negative check mandatory parameter distanceToManeuver", checkShowConstantTBTNegative, {{ - distanceToManeuverScale = params.distanceToManeuver + distanceToManeuverScale = params.distanceToManeuverScale }}) runner.Step("Negative check mandatory parameter distanceToManeuverScale", checkShowConstantTBTNegative, {{ distanceToManeuver = params.distanceToManeuver