From 847e82f14d659e629f7728953cddad2055f06642 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Mon, 5 Feb 2018 18:08:25 +0200 Subject: [PATCH 01/30] Add test sets for Release 4.5 issues --- test_sets/Defects/4_5/1206.txt | 1 + test_sets/Defects/4_5/1211.txt | 1 + test_sets/Defects/4_5/1225.txt | 1 + test_sets/Defects/4_5/1376.txt | 1 + test_sets/Defects/4_5/1395.txt | 1 + test_sets/Defects/4_5/1772.txt | 1 + test_sets/Defects/4_5/1873.txt | 1 + test_sets/Defects/4_5/1881.txt | 1 + test_sets/Defects/4_5/1888.txt | 6 ++++++ test_sets/Defects/4_5/1891.txt | 4 ++++ test_sets/Defects/4_5/1892.txt | 1 + test_sets/Defects/4_5/1893.txt | 1 + test_sets/Defects/4_5/1894.txt | 4 ++++ test_sets/Defects/4_5/1912.txt | 1 + test_sets/Defects/4_5/1921.txt | 1 + test_sets/Defects/4_5/1922.txt | 2 ++ test_sets/Defects/4_5/1923.txt | 2 ++ test_sets/Defects/4_5/1924.txt | 2 ++ test_sets/Defects/4_5/1925.txt | 7 +++++++ 19 files changed, 39 insertions(+) create mode 100644 test_sets/Defects/4_5/1206.txt create mode 100644 test_sets/Defects/4_5/1211.txt create mode 100644 test_sets/Defects/4_5/1225.txt create mode 100644 test_sets/Defects/4_5/1376.txt create mode 100644 test_sets/Defects/4_5/1395.txt create mode 100644 test_sets/Defects/4_5/1772.txt create mode 100644 test_sets/Defects/4_5/1873.txt create mode 100644 test_sets/Defects/4_5/1881.txt create mode 100644 test_sets/Defects/4_5/1888.txt create mode 100644 test_sets/Defects/4_5/1891.txt create mode 100644 test_sets/Defects/4_5/1892.txt create mode 100644 test_sets/Defects/4_5/1893.txt create mode 100644 test_sets/Defects/4_5/1894.txt create mode 100644 test_sets/Defects/4_5/1912.txt create mode 100644 test_sets/Defects/4_5/1921.txt create mode 100644 test_sets/Defects/4_5/1922.txt create mode 100644 test_sets/Defects/4_5/1923.txt create mode 100644 test_sets/Defects/4_5/1924.txt create mode 100644 test_sets/Defects/4_5/1925.txt diff --git a/test_sets/Defects/4_5/1206.txt b/test_sets/Defects/4_5/1206.txt new file mode 100644 index 0000000000..0856370c86 --- /dev/null +++ b/test_sets/Defects/4_5/1206.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1206_REQUEST_PTU_Trigger_PTU_failed_previous_IGN_ON.lua diff --git a/test_sets/Defects/4_5/1211.txt b/test_sets/Defects/4_5/1211.txt new file mode 100644 index 0000000000..863be6622a --- /dev/null +++ b/test_sets/Defects/4_5/1211.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1211_ATF_Check_count_of_removals_for_bad_behavior_REQUEST_WHILE_IN_NONE_HMI_LEVEL.lua diff --git a/test_sets/Defects/4_5/1225.txt b/test_sets/Defects/4_5/1225.txt new file mode 100644 index 0000000000..93dcf47269 --- /dev/null +++ b/test_sets/Defects/4_5/1225.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1225_FACTORY_DEFAULTS.lua diff --git a/test_sets/Defects/4_5/1376.txt b/test_sets/Defects/4_5/1376.txt new file mode 100644 index 0000000000..223dc60ed4 --- /dev/null +++ b/test_sets/Defects/4_5/1376.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1376_PTU_all_flows.lua diff --git a/test_sets/Defects/4_5/1395.txt b/test_sets/Defects/4_5/1395.txt new file mode 100644 index 0000000000..1cc644ccab --- /dev/null +++ b/test_sets/Defects/4_5/1395.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1395_Resumption_data_IGN_OFF.lua diff --git a/test_sets/Defects/4_5/1772.txt b/test_sets/Defects/4_5/1772.txt new file mode 100644 index 0000000000..61200271c7 --- /dev/null +++ b/test_sets/Defects/4_5/1772.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1772_update_default_section.lua diff --git a/test_sets/Defects/4_5/1873.txt b/test_sets/Defects/4_5/1873.txt new file mode 100644 index 0000000000..86ab6b61eb --- /dev/null +++ b/test_sets/Defects/4_5/1873.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1873_Parameters_empty_in_policy_table.lua diff --git a/test_sets/Defects/4_5/1881.txt b/test_sets/Defects/4_5/1881.txt new file mode 100644 index 0000000000..699188cfb9 --- /dev/null +++ b/test_sets/Defects/4_5/1881.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1881_OnDriverDistraction_After_changing_HMIlevel_from_NONE.lua diff --git a/test_sets/Defects/4_5/1888.txt b/test_sets/Defects/4_5/1888.txt new file mode 100644 index 0000000000..29e7a8d790 --- /dev/null +++ b/test_sets/Defects/4_5/1888.txt @@ -0,0 +1,6 @@ +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_1_navi.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_2_non-navi.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_3_navi_audio_force_off.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_4_navi_video_force_off.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_5_navi_audio_force_on.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_6_navi_video_force_on.lua diff --git a/test_sets/Defects/4_5/1891.txt b/test_sets/Defects/4_5/1891.txt new file mode 100644 index 0000000000..8e3ed29a89 --- /dev/null +++ b/test_sets/Defects/4_5/1891.txt @@ -0,0 +1,4 @@ +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_1_navi.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_2_non-navi.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_3_navi_audio.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_4_navi_video.lua diff --git a/test_sets/Defects/4_5/1892.txt b/test_sets/Defects/4_5/1892.txt new file mode 100644 index 0000000000..8972d7a1be --- /dev/null +++ b/test_sets/Defects/4_5/1892.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1892_HB_from_SDL_after_receiving_HB_from_mobile.lua diff --git a/test_sets/Defects/4_5/1893.txt b/test_sets/Defects/4_5/1893.txt new file mode 100644 index 0000000000..ec150d4cca --- /dev/null +++ b/test_sets/Defects/4_5/1893.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1893_ATF_HeartBeat_App_does_not_send_HB_and_does_not_respond.lua diff --git a/test_sets/Defects/4_5/1894.txt b/test_sets/Defects/4_5/1894.txt new file mode 100644 index 0000000000..e3816b8435 --- /dev/null +++ b/test_sets/Defects/4_5/1894.txt @@ -0,0 +1,4 @@ +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_1_navi.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_2_non-navi.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_3_navi_audio.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_4_navi_video.lua diff --git a/test_sets/Defects/4_5/1912.txt b/test_sets/Defects/4_5/1912.txt new file mode 100644 index 0000000000..54baf1ab3e --- /dev/null +++ b/test_sets/Defects/4_5/1912.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1912_Video_service_start_via_2_protocol.lua diff --git a/test_sets/Defects/4_5/1921.txt b/test_sets/Defects/4_5/1921.txt new file mode 100644 index 0000000000..465c1d44ee --- /dev/null +++ b/test_sets/Defects/4_5/1921.txt @@ -0,0 +1 @@ +./test_scripts/Defects/4_5/1921_Invalid_PT_after_cutting_unknow_values.lua diff --git a/test_sets/Defects/4_5/1922.txt b/test_sets/Defects/4_5/1922.txt new file mode 100644 index 0000000000..63fb569e6a --- /dev/null +++ b/test_sets/Defects/4_5/1922.txt @@ -0,0 +1,2 @@ +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_1_navi_audio.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_2_navi_video-navi.lua diff --git a/test_sets/Defects/4_5/1923.txt b/test_sets/Defects/4_5/1923.txt new file mode 100644 index 0000000000..4e2a0af4d5 --- /dev/null +++ b/test_sets/Defects/4_5/1923.txt @@ -0,0 +1,2 @@ +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_1_navi_audio.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_2_navi_video-navi.lua diff --git a/test_sets/Defects/4_5/1924.txt b/test_sets/Defects/4_5/1924.txt new file mode 100644 index 0000000000..6121278f51 --- /dev/null +++ b/test_sets/Defects/4_5/1924.txt @@ -0,0 +1,2 @@ +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1924_1_non-navi.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1924_2_navi.lua diff --git a/test_sets/Defects/4_5/1925.txt b/test_sets/Defects/4_5/1925.txt new file mode 100644 index 0000000000..2012dcba5d --- /dev/null +++ b/test_sets/Defects/4_5/1925.txt @@ -0,0 +1,7 @@ +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_1_navi_no_cert_new_app.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_2_navi_no_cert_existing_app.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_3_navi_cert_new_app.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_4_navi_cert_existing_app.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_5_non-navi_no_cert_new_app.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_6_non-navi_no_cert_existing_app.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_7_non-navi_cert_new_app.lua From 68917c3979d1ac94b8fb89332716e7a64a5d4a56 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Fri, 9 Feb 2018 15:36:56 +0200 Subject: [PATCH 02/30] Fix cast to string in common module for Resumption --- user_modules/shared_testcases/commonStepsResumption.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_modules/shared_testcases/commonStepsResumption.lua b/user_modules/shared_testcases/commonStepsResumption.lua index 882d5471b3..2ceb439571 100644 --- a/user_modules/shared_testcases/commonStepsResumption.lua +++ b/user_modules/shared_testcases/commonStepsResumption.lua @@ -90,7 +90,7 @@ function commonStepsResumption:RegisterApp(app, additional_expectations , resume return true end end - return false, "The value of " .. pA .. " (".. tostring(pA) .. ") is not as expected (" .. pE .. ")" + return false, "The value of " .. pA .. " (".. tostring(pA) .. ") is not as expected (" .. tostring(pE) .. ")" end) Test.mobileSession:ExpectResponse(correlation_id, { success = true}) local exp = additional_expectations(Test, app) @@ -188,4 +188,4 @@ function commonStepsResumption:Expect_Resumption_Data(app) Test.mobileSession:ExpectNotification("OnHashChange") end -return commonStepsResumption \ No newline at end of file +return commonStepsResumption From b5c4e5a0a18dac56cc3230795ed00af578d0ecc5 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Tue, 13 Feb 2018 12:59:01 +0200 Subject: [PATCH 03/30] Fix obtaining of MAC address and Device Id --- .../Defects/4_5/1225_FACTORY_DEFAULTS.lua | 16 ++------ .../Defects/4_5/1376_PTU_all_flows.lua | 22 ++++++++-- ...912_Video_service_start_via_2_protocol.lua | 1 - .../4_5/Trigger_PTU_NO_Certificate/common.lua | 25 ++++++++++-- test_scripts/Defects/4_5/commonDefects.lua | 40 ++++++++++++++++--- 5 files changed, 78 insertions(+), 26 deletions(-) diff --git a/test_scripts/Defects/4_5/1225_FACTORY_DEFAULTS.lua b/test_scripts/Defects/4_5/1225_FACTORY_DEFAULTS.lua index 85ad93828a..0a7145a191 100644 --- a/test_scripts/Defects/4_5/1225_FACTORY_DEFAULTS.lua +++ b/test_scripts/Defects/4_5/1225_FACTORY_DEFAULTS.lua @@ -58,14 +58,6 @@ local function start(self) end) end --- Allow device from HMI -local function allowSDL(self) - -- sending notification OnAllowSDLFunctionality from HMI to allow connected device - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { - allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } - }) -end - -- Delay without expectation -- @tparam number pTime time to wait local function delayedExp(pTime, self) @@ -176,7 +168,7 @@ local function Check_user_consent_records_in_Snapshot(self) else -- Check presence of consented group for registered appID local pts = ptsToTable(pathToPTS) - local ucr = pts.policy_table.device_data[config.deviceMAC].user_consent_records + local ucr = pts.policy_table.device_data[commonDefects.getDeviceMAC()].user_consent_records if not (ucr[config.application1.registerAppInterfaceParams.appID]) then commonFunctions:printError("Error: user_consent_records.consent_groups.Location is not present in Snapshot") is_test_fail = true @@ -240,7 +232,7 @@ local function Check_no_user_consent_records_in_Snapshot(self) else -- Check absence of consented group for registered appID local pts = ptsToTable(pathToPTS) - local ucr = pts.policy_table.device_data[config.deviceMAC].user_consent_records + local ucr = pts.policy_table.device_data[commonDefects.getDeviceMAC()].user_consent_records if (ucr[config.application1.registerAppInterfaceParams.appID]) then commonFunctions:printError("Error: user_consent_records.consent_groups.Location was not reset in Snapshot") is_test_fail = true @@ -258,7 +250,7 @@ runner.Step("Clean environment", commonDefects.preconditions) -- Start SDL and HMI, establish connection between SDL and HMI, open mobile connection via TCP runner.Step("Start SDL, HMI, connect Mobile", start) -- Allow connected device on HMI -runner.Step("Allow SDL for device", allowSDL) +runner.Step("Allow SDL for device", commonDefects.allow_sdl) -- create mobile session, register application, perform PTU wit PT from ptUpdateFunc -- with "Location" group for registered application runner.Step("RAI, PTU", commonDefects.rai_ptu, { ptUpdateFunc}) @@ -280,7 +272,7 @@ runner.Step("Start SDL, HMI, connect Mobile", start) -- Check absence of records related to consent group and device in LPT after FACTORY_DEFAULTS runner.Step("Check_absence_of_user_consent_records_in_LPT", Check_no_user_consent_records_in_LPT) -- Make device consent -runner.Step("Allow SDL for device", allowSDL) +runner.Step("Allow SDL for device", commonDefects.allow_sdl) -- Create session, register application runner.Step("RAI", commonDefects.rai_n) -- Remove snapshot to make sure that SDL creates new one during PTU, trigger PTU to initiation of snapshot creation diff --git a/test_scripts/Defects/4_5/1376_PTU_all_flows.lua b/test_scripts/Defects/4_5/1376_PTU_all_flows.lua index d57ad1df72..d32051bc98 100644 --- a/test_scripts/Defects/4_5/1376_PTU_all_flows.lua +++ b/test_scripts/Defects/4_5/1376_PTU_all_flows.lua @@ -12,7 +12,7 @@ local sdl = require("SDL") local commonSteps = require("user_modules/shared_testcases/commonSteps") --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.mobileHost = "127.0.0.1" config.defaultProtocolVersion = 2 --[[ Local Variables ]] @@ -34,9 +34,25 @@ end -- Allow device from HMI local function allowSDL(self) + local function getDeviceName() + return config.mobileHost .. ":" .. config.mobilePort + end + local function getDeviceMAC() + local cmd = "echo -n " .. getDeviceName() .. " | sha256sum | awk '{printf $1}'" + local handle = io.popen(cmd) + local result = handle:read("*a") + handle:close() + return result + end -- sending notification OnAllowSDLFunctionality from HMI to allow connected device - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { + allowed = true, + source = "GUI", + device = { + id = getDeviceMAC(), + name = getDeviceName() + } + }) end -- Start SDL and HMI, establish connection between SDL and HMI, open mobile connection via TCP diff --git a/test_scripts/Defects/4_5/1912_Video_service_start_via_2_protocol.lua b/test_scripts/Defects/4_5/1912_Video_service_start_via_2_protocol.lua index 6485b340bc..04dc0eb469 100644 --- a/test_scripts/Defects/4_5/1912_Video_service_start_via_2_protocol.lua +++ b/test_scripts/Defects/4_5/1912_Video_service_start_via_2_protocol.lua @@ -18,7 +18,6 @@ local commonDefects = require('test_scripts/Defects/4_5/commonDefects') local events = require('events') --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 config.application1.registerAppInterfaceParams.appHMIType = {"NAVIGATION"} diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua index 4b77b7260e..cea6bbc133 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua @@ -2,7 +2,7 @@ -- Navigation common module --------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.mobileHost = "127.0.0.1" config.defaultProtocolVersion = 3 config.serverCertificatePath = "./files/Security/spt_credential.pem" @@ -150,9 +150,26 @@ end --[[ @allowSDL: sequence that allows SDL functionality --! @parameters: none --]] -local function allowSDL() - test.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) +local function allowSDL(self) + local function getDeviceName() + return config.mobileHost .. ":" .. config.mobilePort + end + local function getDeviceMAC() + local cmd = "echo -n " .. getDeviceName() .. " | sha256sum | awk '{printf $1}'" + local handle = io.popen(cmd) + local result = handle:read("*a") + handle:close() + return result + end + -- sending notification OnAllowSDLFunctionality from HMI to allow connected device + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { + allowed = true, + source = "GUI", + device = { + id = getDeviceMAC(), + name = getDeviceName() + } + }) end --[[ @registerStartSecureServiceFunc: register function to start secure service diff --git a/test_scripts/Defects/4_5/commonDefects.lua b/test_scripts/Defects/4_5/commonDefects.lua index 32c069d1e2..2fb70092d5 100644 --- a/test_scripts/Defects/4_5/commonDefects.lua +++ b/test_scripts/Defects/4_5/commonDefects.lua @@ -3,7 +3,7 @@ --------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -- define MAC address mobile device -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.mobileHost = "127.0.0.1" -- define 2nd version of SDL protocol by default config.defaultProtocolVersion = 2 -- switch off schema validation for output messages against APIs @@ -155,14 +155,41 @@ local function ptu(self, ptu_update_func) end) end +--[[ @getDeviceName: provides device name +--! @parameters: none +--! @return: device name +--]] +function commonDefect.getDeviceName() + return config.mobileHost .. ":" .. config.mobilePort +end + +--[[ @getDeviceMAC: provides device MAC address +--! @parameters: none +--! @return: device MAC address +--]] +function commonDefect.getDeviceMAC() + local cmd = "echo -n " .. commonDefect.getDeviceName() .. " | sha256sum | awk '{printf $1}'" + local handle = io.popen(cmd) + local result = handle:read("*a") + handle:close() + return result +end + --[[ @allow_sdl: sequence that allows SDL functionality --! @parameters: --! self - test object --! @return: none --]] -local function allow_sdl(self) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) +function commonDefect.allow_sdl(self) + -- sending notification OnAllowSDLFunctionality from HMI to allow connected device + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { + allowed = true, + source = "GUI", + device = { + id = commonDefect.getDeviceMAC(), + name = commonDefect.getDeviceName() + } + }) end --[[ @preconditions: precondition steps @@ -193,7 +220,7 @@ function commonDefect.start(self) self:connectMobile() :Do(function() commonFunctions:userPrint(35, "Mobile connected") - allow_sdl(self) + commonDefect.allow_sdl(self) end) end) end) @@ -246,12 +273,12 @@ function commonDefect.ignitionOff(self) self.hmiConnection:SendNotification("BasicCommunication.OnExitAllApplications", { reason = "SUSPEND" }) EXPECT_HMINOTIFICATION("BasicCommunication.OnSDLPersistenceComplete") :Do(function() + sdl:DeleteFile() self.hmiConnection:SendNotification("BasicCommunication.OnExitAllApplications", { reason = "IGNITION_OFF" }) self.mobileSession1:ExpectNotification("OnAppInterfaceUnregistered", { reason = "IGNITION_OFF" }) EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", { unexpectedDisconnect = false }) EXPECT_HMINOTIFICATION("BasicCommunication.OnSDLClose") :Do(function() - sdl:DeleteFile() sdl:StopSDL() end) end) @@ -319,6 +346,7 @@ function commonDefect.rai_ptu_n(id, ptu_update_func, self) { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) :Times(AtLeast(1)) self["mobileSession" .. id]:ExpectNotification("OnPermissionsChange") + :Times(AtLeast(1)) end) end) end From 0269b1ba52097ed5a30e930ea8fdf7aaee92b06f Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Tue, 13 Feb 2018 13:55:36 +0200 Subject: [PATCH 04/30] Fix file names --- test_sets/Defects/4_5/1922.txt | 2 +- test_sets/Defects/4_5/1923.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test_sets/Defects/4_5/1922.txt b/test_sets/Defects/4_5/1922.txt index 63fb569e6a..1bd6ca1e47 100644 --- a/test_sets/Defects/4_5/1922.txt +++ b/test_sets/Defects/4_5/1922.txt @@ -1,2 +1,2 @@ ./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_1_navi_audio.lua -./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_2_navi_video-navi.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_2_navi_video.lua diff --git a/test_sets/Defects/4_5/1923.txt b/test_sets/Defects/4_5/1923.txt index 4e2a0af4d5..0f719177aa 100644 --- a/test_sets/Defects/4_5/1923.txt +++ b/test_sets/Defects/4_5/1923.txt @@ -1,2 +1,2 @@ ./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_1_navi_audio.lua -./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_2_navi_video-navi.lua +./test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_2_navi_video.lua From 8abed626dedb7ede9a6830bd64e245ca2ad31546 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Tue, 13 Feb 2018 14:08:54 +0200 Subject: [PATCH 05/30] Add additional expectation for PTU sequence --- test_scripts/Defects/4_5/commonDefects.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test_scripts/Defects/4_5/commonDefects.lua b/test_scripts/Defects/4_5/commonDefects.lua index 2fb70092d5..9b106fd952 100644 --- a/test_scripts/Defects/4_5/commonDefects.lua +++ b/test_scripts/Defects/4_5/commonDefects.lua @@ -347,6 +347,7 @@ function commonDefect.rai_ptu_n(id, ptu_update_func, self) :Times(AtLeast(1)) self["mobileSession" .. id]:ExpectNotification("OnPermissionsChange") :Times(AtLeast(1)) + EXPECT_HMICALL("VehicleInfo.GetVehicleData", { odometer = true }) end) end) end @@ -386,6 +387,7 @@ function commonDefect.rai_ptu_n_without_OnPermissionsChange(id, ptu_update_func, self["mobileSession" .. id]:ExpectNotification("OnHMIStatus", { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) :Times(AtLeast(1)) + EXPECT_HMICALL("VehicleInfo.GetVehicleData", { odometer = true }) end) end) end From 5aa6337d260527c9ecaa5fbf23d01b6bf2dc109b Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Mon, 26 Feb 2018 18:22:05 +0200 Subject: [PATCH 06/30] Create common module for security --- .../4_5/Trigger_PTU_NO_Certificate/common.lua | 566 +----------------- user_modules/sequences/actions.lua | 448 ++++++++++++++ user_modules/sequences/security.lua | 146 +++++ user_modules/utils.lua | 222 ++++--- 4 files changed, 737 insertions(+), 645 deletions(-) create mode 100644 user_modules/sequences/actions.lua create mode 100644 user_modules/sequences/security.lua diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua index cea6bbc133..6d7dff8f48 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua @@ -1,569 +1,31 @@ --------------------------------------------------------------------------------------------------- --- Navigation common module +-- Common module --------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.mobileHost = "127.0.0.1" config.defaultProtocolVersion = 3 -config.serverCertificatePath = "./files/Security/spt_credential.pem" -config.serverPrivateKeyPath = "./files/Security/spt_credential.pem" -config.serverCAChainCertPath = "./files/Security/spt_credential.pem" - --[[ Required Shared libraries ]] -local mobile_session = require("mobile_session") -local json = require("modules/json") -local commonFunctions = require("user_modules/shared_testcases/commonFunctions") -local commonSteps = require("user_modules/shared_testcases/commonSteps") -local commonTestCases = require("user_modules/shared_testcases/commonTestCases") -local events = require("events") -local test = require("user_modules/dummy_connecttest") -local expectations = require('expectations') -local Expectation = expectations.Expectation -local constants = require('protocol_handler/ford_protocol_constants') -local reporter = require("reporter") +local actions = require("user_modules/sequences/actions") +local security = require("user_modules/sequences/security") +local utils = require("user_modules/utils") +--[[ Module ]] local m = {} ---[[ Constants ]] -m.timeout = 2000 -m.minTimeout = 500 -m.appId1 = 1 -m.appId2 = 2 -m.frameInfo = constants.FRAME_INFO - ---[[ Variables ]] -local ptuTable = {} -local hmiAppIds = {} - ---[[ Functions ]] - ---[[ @getPTUFromPTS: create policy table update table (PTU) ---! @parameters: ---! pTbl - table with policy table snapshot (PTS) ---! @return: table with PTU ---]] -local function getPTUFromPTS(pTbl) - pTbl.policy_table.consumer_friendly_messages.messages = nil - pTbl.policy_table.device_data = nil - pTbl.policy_table.module_meta = nil - pTbl.policy_table.usage_and_error_counts = nil - pTbl.policy_table.functional_groupings["DataConsent-2"].rpcs = json.null - pTbl.policy_table.module_config.preloaded_pt = nil - pTbl.policy_table.module_config.preloaded_date = nil -end - ---[[ @jsonFileToTable: convert .json file to table ---! @parameters: ---! pFileName - file name ---! @return: table ---]] -local function jsonFileToTable(pFileName) - local f = io.open(pFileName, "r") - local content = f:read("*all") - f:close() - return json.decode(content) -end - ---[[ @tableToJsonFile: convert table to .json file ---! @parameters: ---! pTbl - table ---! pFileName - file name ---]] -local function tableToJsonFile(pTbl, pFileName) - local f = io.open(pFileName, "w") - f:write(json.encode(pTbl)) - f:close() -end - ---[[ @updatePTU: update PTU table with additional functional group for Navigation RPCs ---! @parameters: ---! pTbl - PTU table ---! pAppId - application number (1, 2, etc.) ---]] -function m.updatePTU(pTbl, pAppId) - pTbl.policy_table.app_policies[m.getAppID(pAppId)] = { - keep_context = false, - steal_focus = false, - priority = "NONE", - default_hmi = "NONE", - groups = { "Base-4", "Location-1" } - } -end - ---[[ @ptu: perform policy table update ---! @parameters: ---! pPTUpdateFunc - additional function for update ---! pAppId - application number (1, 2, etc.) ---]] -local function ptu(pPTUpdateFunc, pAppId) - if not pAppId then pAppId = 1 end - local pts_file_name = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" - .. commonFunctions:read_parameter_from_smart_device_link_ini("PathToSnapshot") - local ptu_file_name = os.tmpname() - local requestId = test.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(requestId) - :Do(function() - test.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", - { requestType = "PROPRIETARY", fileName = pts_file_name }) - getPTUFromPTS(ptuTable) - - m.updatePTU(ptuTable, pAppId) - - if pPTUpdateFunc then - pPTUpdateFunc(ptuTable) - end +-- Proxies for the inherited objects +utils.inheritObjects(m, actions) +utils.inheritObjects(m, security) - tableToJsonFile(ptuTable, ptu_file_name) - - local event = events.Event() - event.matches = function(e1, e2) return e1 == e2 end - EXPECT_EVENT(event, "PTU event") - - local function getAppsCount() - local count = 0 - for _ in pairs(hmiAppIds) do - count = count + 1 - end - return count - end - for id = 1, getAppsCount() do - local mobileSession = m.getMobileSession(id) - mobileSession:ExpectNotification("OnSystemRequest", { requestType = "PROPRIETARY" }) - :Do(function() - print("App ".. id .. " was used for PTU") - RAISE_EVENT(event, event, "PTU event") - local corIdSystemRequest = mobileSession:SendRPC("SystemRequest", - { requestType = "PROPRIETARY" }, ptu_file_name) - EXPECT_HMICALL("BasicCommunication.SystemRequest") - :Do(function(_, d3) - test.hmiConnection:SendResponse(d3.id, "BasicCommunication.SystemRequest", "SUCCESS", { }) - test.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { policyfile = d3.params.fileName }) - end) - mobileSession:ExpectResponse(corIdSystemRequest, { success = true, resultCode = "SUCCESS" }) - :Do(function() os.remove(ptu_file_name) end) - end) - :Times(AtMost(1)) - end - end) -end - ---[[ @allowSDL: sequence that allows SDL functionality ---! @parameters: none ---]] -local function allowSDL(self) - local function getDeviceName() - return config.mobileHost .. ":" .. config.mobilePort - end - local function getDeviceMAC() - local cmd = "echo -n " .. getDeviceName() .. " | sha256sum | awk '{printf $1}'" - local handle = io.popen(cmd) - local result = handle:read("*a") - handle:close() - return result - end - -- sending notification OnAllowSDLFunctionality from HMI to allow connected device - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { - allowed = true, - source = "GUI", - device = { - id = getDeviceMAC(), - name = getDeviceName() - } - }) -end - ---[[ @registerStartSecureServiceFunc: register function to start secure service ---! @parameters: ---! pMobSession - mobile session ---]] -local function registerStartSecureServiceFunc(pMobSession) - function pMobSession.mobile_session_impl.control_services:StartSecureService(pServiceId) - local msg = { - serviceType = pServiceId, - frameInfo = constants.FRAME_INFO.START_SERVICE, - sessionId = self.session.sessionId.get(), - encryption = true - } - self:Send(msg) - end - function pMobSession.mobile_session_impl:StartSecureService(pServiceId) - if not self.isSecuredSession then - self.security:registerSessionSecurity() - self.security:prepareToHandshake() - end - return self.control_services:StartSecureService(pServiceId) - end -end - ---[[ @registerExpectServiceEventFunc: register functions for expectations of control messages: ---! Service Start ACK/NACK and Handshake ---! @parameters: ---! pMobSession - mobile session ---]] -local function registerExpectServiceEventFunc(pMobSession) - function pMobSession:ExpectControlMessage(pServiceId, pData) - local session = self.mobile_session_impl.control_services.session - local event = events.Event() - event.matches = function(_, data) - return data.frameType == constants.FRAME_TYPE.CONTROL_FRAME and - data.serviceType == pServiceId and - (pServiceId == constants.SERVICE_TYPE.RPC or data.sessionId == session.sessionId.get()) and - (data.frameInfo == constants.FRAME_INFO.START_SERVICE_ACK or - data.frameInfo == constants.FRAME_INFO.START_SERVICE_NACK) - end - local ret = session:ExpectEvent(event, "StartService") - :Do(function(_, data) - if data.encryption == true and data.frameInfo == constants.FRAME_INFO.START_SERVICE_ACK then - session.security:registerSecureService(pServiceId) - end - end) - :ValidIf(function(_, data) - if data.encryption ~= pData.encryption then - return false, "Expected 'encryption' flag is '" .. tostring(pData.encryption) - .. "', actual is '" .. tostring(data.encryption) .. "'" - end - return true - end) - :ValidIf(function(_, data) - if data.frameInfo ~= pData.frameInfo then - return false, "Expected 'frameInfo' is '" .. tostring(pData.frameInfo) - .. "', actual is '" .. tostring(data.frameInfo) .. "'" - end - return true - end) - return ret - end - - function pMobSession:ExpectHandshakeMessage() - local session = self.mobile_session_impl.control_services.session - local event = events.Event() - event.matches = function(e1, e2) return e1 == e2 end - local ret = pMobSession:ExpectEvent(event, "Handshake") - local handshakeEvent = events.Event() - handshakeEvent.matches = function(_, data) - return data.frameType ~= constants.FRAME_TYPE.CONTROL_FRAME - and data.serviceType == constants.SERVICE_TYPE.CONTROL - and data.sessionId == session.sessionId.get() - and data.rpcType == constants.BINARY_RPC_TYPE.NOTIFICATION - and data.rpcFunctionId == constants.BINARY_RPC_FUNCTION_ID.HANDSHAKE - end - session:ExpectEvent(handshakeEvent, "Handshake internal") - :Do(function(_, data) - local binData = data.binaryData - local dataToSend = session.security:performHandshake(binData) - if dataToSend then - local handshakeMessage = { - frameInfo = 0, - serviceType = constants.SERVICE_TYPE.CONTROL, - encryption = false, - rpcType = constants.BINARY_RPC_TYPE.NOTIFICATION, - rpcFunctionId = constants.BINARY_RPC_FUNCTION_ID.HANDSHAKE, - rpcCorrelationId = data.rpcCorrelationId, - binaryData = dataToSend - } - session:Send(handshakeMessage) - end - end) - :Do(function() - if session.security:isHandshakeFinished() then - event_dispatcher:RaiseEvent(test.mobileConnection, event) - end - end) - :Times(AnyNumber()) - return ret - end -end - ---[[ @getAppID: return 'appID' from configuration file ---! @parameters: ---! pAppId - application number (1, 2, etc.) ---! @return: application identifier from configuration file ---]] -function m.getAppID(pAppId) - if not pAppId then pAppId = 1 end - return config["application" .. pAppId].registerAppInterfaceParams.appID -end - ---[[ @preconditions: precondition steps ---! @parameters: none ---]] -function m.preconditions() - commonFunctions:SDLForceStop() - commonSteps:DeletePolicyTable() - commonSteps:DeleteLogsFiles() -end - ---[[ @postconditions: postcondition steps ---! @parameters: none ---]] -function m.postconditions() - StopSDL() -end - ---[[ @activateApp: activate application ---! @parameters: ---! pAppId - application number (1, 2, etc.) ---]] -function m.activateApp(pAppId) - if not pAppId then pAppId = 1 end - local pHMIAppId = hmiAppIds[config["application" .. pAppId].registerAppInterfaceParams.appID] - local mobSession = m.getMobileSession(pAppId) - local requestId = test.hmiConnection:SendRequest("SDL.ActivateApp", { appID = pHMIAppId }) - EXPECT_HMIRESPONSE(requestId) - mobSession:ExpectNotification("OnHMIStatus", - { hmiLevel = "FULL", audioStreamingState = "AUDIBLE", systemContext = "MAIN" }) - commonTestCases:DelayedExp(m.minTimeout) -end - ---[[ @getHMIAppId: get HMI application identifier ---! @parameters: ---! pAppId - application number (1, 2, etc.) ---! @return: application identifier ---]] -function m.getHMIAppId(pAppId) - if not pAppId then pAppId = 1 end - return hmiAppIds[config["application" .. pAppId].registerAppInterfaceParams.appID] -end - ---[[ @getMobileSession: get mobile session ---! @parameters: ---! pAppId - application number (1, 2, etc.) ---! @return: mobile session ---]] -function m.getMobileSession(pAppId) - if not pAppId then pAppId = 1 end - local session - if not test["mobileSession" .. pAppId] then - session = mobile_session.MobileSession(test, test.mobileConnection) - test["mobileSession" .. pAppId] = session - registerStartSecureServiceFunc(session) - registerExpectServiceEventFunc(session) - if config.defaultProtocolVersion > 2 then - session.activateHeartbeat = true - session.sendHeartbeatToSDL = true - session.answerHeartbeatFromSDL = true - session.ignoreSDLHeartBeatACK = true - end - else - session = test["mobileSession" .. pAppId] - end - return session -end - ---[[ @registerApp: register mobile application ---! @parameters: ---! pAppId - application number (1, 2, etc.) ---]] -function m.registerApp(pAppId) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - mobSession:StartService(7) - :Do(function() - local corId = mobSession:SendRPC("RegisterAppInterface", - config["application" .. pAppId].registerAppInterfaceParams) - test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", - { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) - :Do(function(_, d1) - hmiAppIds[config["application" .. pAppId].registerAppInterfaceParams.appID] = d1.params.application.appID - test.hmiConnection:ExpectNotification("SDL.OnStatusUpdate", { status = "UPDATE_NEEDED" }, { status = "UPDATING" }) - :Times(2) - test.hmiConnection:ExpectRequest("BasicCommunication.PolicyUpdate") - :Do(function(_, d2) - test.hmiConnection:SendResponse(d2.id, d2.method, "SUCCESS", { }) - ptuTable = jsonFileToTable(d2.params.file) - end) - end) - mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) - :Do(function() - mobSession:ExpectNotification("OnHMIStatus", - { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) - mobSession:ExpectNotification("OnPermissionsChange") - end) - end) -end - ---[[ @registerAppWOPTU: register mobile application and do not perform PTU ---! @parameters: ---! pAppId - application number (1, 2, etc.) ---]] -function m.registerAppWOPTU(pAppId) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - mobSession:StartService(7) - :Do(function() - local corId = mobSession:SendRPC("RegisterAppInterface", - config["application" .. pAppId].registerAppInterfaceParams) - test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", - { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) - :Do(function(_, d1) - hmiAppIds[config["application" .. pAppId].registerAppInterfaceParams.appID] = d1.params.application.appID - end) - mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) - :Do(function() - mobSession:ExpectNotification("OnHMIStatus", - { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) - mobSession:ExpectNotification("OnPermissionsChange") - end) - end) -end - ---[[ @policyTableUpdate: perform PTU ---! @parameters: ---! pPTUpdateFunc - function with additional updates ---! pExpNotificationFunc - function with specific expectations which needs to be done during PTU ---! pAppId - application number (1, 2, etc.) ---]] -function m.policyTableUpdate(pPTUpdateFunc, pExpNotificationFunc, pAppId) - if not pAppId then pAppId = 1 end - if not pExpNotificationFunc then - test.hmiConnection:ExpectNotification("SDL.OnStatusUpdate", { status = "UP_TO_DATE" }) - test.hmiConnection:ExpectRequest("VehicleInfo.GetVehicleData", { odometer = true }) - else - pExpNotificationFunc() - end - ptu(pPTUpdateFunc, pAppId) -end - ---[[ @start: starting sequence: starting of SDL, initialization of HMI, connect mobile ---! @parameters: ---! pHMIParams - table with parameters for HMI initialization ---]] -function m.start(pHMIParams) - test:runSDL() - commonFunctions:waitForSDLStart(test) - :Do(function() - test:initHMI() - :Do(function() - commonFunctions:userPrint(35, "HMI initialized") - test:initHMI_onReady(pHMIParams) - :Do(function() - commonFunctions:userPrint(35, "HMI is ready") - test:connectMobile() - :Do(function() - commonFunctions:userPrint(35, "Mobile connected") - allowSDL(test) - end) - end) - end) - end) +function m.setForceProtectedServiceParam(pParamValue) + m.setSDLIniParameter("ForceProtectedService", pParamValue) end ---[[ @delayedExp: delay test step for specific timeout ---! @parameters: none ---]] function m.delayedExp(pTimeOut) - if not pTimeOut then pTimeOut = m.timeout end - commonTestCases:DelayedExp(pTimeOut) -end - ---[[ @readFile: read data from file ---! @parameters: ---! pPath - path to file --- @return: content of the file ---]] -function m.readFile(pPath) - local open = io.open - local file = open(pPath, "rb") - if not file then return nil end - local content = file:read "*a" - file:close() - return content -end - ---[[ @ExpectRequest: register expectation for request on HMI connection ---! @parameters: ---! pName - name of the request ---! ... - expected data ---]] -function test.hmiConnection:ExpectRequest(pName, ...) - local event = events.Event() - event.matches = function(_, data) return data.method == pName end - local args = table.pack(...) - local ret = Expectation("HMI call " .. pName, self) - if #args > 0 then - ret:ValidIf(function(e, data) - local arguments - if e.occurences > #args then - arguments = args[#args] - else - arguments = args[e.occurences] - end - reporter.AddMessage("EXPECT_HMICALL", - { ["Id"] = data.id, ["name"] = tostring(pName),["Type"] = "EXPECTED_RESULT" }, arguments) - reporter.AddMessage("EXPECT_HMICALL", - { ["Id"] = data.id, ["name"] = tostring(pName),["Type"] = "AVAILABLE_RESULT" }, data.params) - return compareValues(arguments, data.params, "params") - end) - end - ret.event = event - event_dispatcher:AddEvent(self, event, ret) - test:AddExpectation(ret) - return ret -end - ---[[ @ExpectNotification: register expectation for notification on HMI connection ---! @parameters: ---! pName - name of the notification ---! ... - expected data ---]] -function test.hmiConnection:ExpectNotification(pName, ...) - local event = events.Event() - event.matches = function(_, data) return data.method == pName end - local args = table.pack(...) - local ret = Expectation("HMI notification " .. pName, self) - if #args > 0 then - ret:ValidIf(function(e, data) - local arguments - if e.occurences > #args then - arguments = args[#args] - else - arguments = args[e.occurences] - end - local cid = test.notification_counter - test.notification_counter = test.notification_counter + 1 - reporter.AddMessage("EXPECT_HMINOTIFICATION", - { ["Id"] = cid, ["name"] = tostring(pName), ["Type"] = "EXPECTED_RESULT" }, arguments) - reporter.AddMessage("EXPECT_HMINOTIFICATION", - { ["Id"] = cid, ["name"] = tostring(pName), ["Type"] = "AVAILABLE_RESULT" }, data.params) - return compareValues(arguments, data.params, "params") - end) - end - ret.event = event - event_dispatcher:AddEvent(self, event, ret) - test:AddExpectation(ret) - return ret -end - ---[[ @getHMIConnection: return HMI connection object ---! @parameters: none ---! @return: HMI connection object ---]] -function m.getHMIConnection() - return test.hmiConnection -end - ---[[ @setForceProtectedServiceParam: set value of 'ForceProtectedService' parameter in SDL .ini file ---! @parameters: ---! pParamValue - value of the paramter ---]] -function m.setForceProtectedServiceParam(pParamValue) - local paramName = "ForceProtectedService" - commonFunctions:SetValuesInIniFile(paramName .. "%s-=%s-[%d,A-Z,a-z]-%s-\n", paramName, pParamValue) + utils.wait(pTimeOut) end ---[[ @protect: make table immutable ---! @parameters: ---! pTbl - mutable table ---! @return: immutable table ---]] -local function protect(pTbl) - local mt = { - __index = pTbl, - __newindex = function(_, k, v) - error("Attempting to change item " .. tostring(k) .. " to " .. tostring(v), 2) - end - } - return setmetatable({}, mt) +function m.readFile(pFilePath) + return utils.readFile(pFilePath) end -return protect(m) +return m diff --git a/user_modules/sequences/actions.lua b/user_modules/sequences/actions.lua new file mode 100644 index 0000000000..2dee196e31 --- /dev/null +++ b/user_modules/sequences/actions.lua @@ -0,0 +1,448 @@ +--------------------------------------------------------------------------------------------------- +-- Common actions module +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local mobileSession = require("mobile_session") +local json = require("modules/json") +local commonFunctions = require("user_modules/shared_testcases/commonFunctions") +local commonSteps = require("user_modules/shared_testcases/commonSteps") +local commonTestCases = require("user_modules/shared_testcases/commonTestCases") +local events = require("events") +local test = require("user_modules/dummy_connecttest") +local expectations = require('expectations') +local reporter = require("reporter") +local utils = require("user_modules/utils") + +--[[ Module ]] +local m = {} + +--[[ Constants ]] +m.minTimeout = 500 + +--[[ Variables ]] +local ptuTable = {} +local hmiAppIds = {} +local originalValuesInSDLIni = {} + +test.mobileSession = {} + +--[[ Functions ]] + +--[[ @getPTUFromPTS: create policy table update table (PTU) +--! @parameters: +--! pTbl - table with policy table snapshot (PTS) +--! @return: table with PTU +--]] +local function getPTUFromPTS(pTbl) + pTbl.policy_table.consumer_friendly_messages.messages = nil + pTbl.policy_table.device_data = nil + pTbl.policy_table.module_meta = nil + pTbl.policy_table.usage_and_error_counts = nil + pTbl.policy_table.functional_groupings["DataConsent-2"].rpcs = json.null + pTbl.policy_table.module_config.preloaded_pt = nil + pTbl.policy_table.module_config.preloaded_date = nil +end + +--[[ @updatePTU: update PTU table with additional functional group for Navigation RPCs +--! @parameters: +--! pTbl - PTU table +--! pAppId - application number (1, 2, etc.) +--! @return: none +--]] +function m.updatePTU(pTbl, pAppId) + pTbl.policy_table.app_policies[m.getAppID(pAppId)] = { + keep_context = false, + steal_focus = false, + priority = "NONE", + default_hmi = "NONE", + groups = { "Base-4", "Location-1" } + } +end + +--[[ @ptu: perform policy table update +--! @parameters: +--! pPTUpdateFunc - additional function for update +--! pAppId - application number (1, 2, etc.) +--! @return: none +--]] +local function ptu(pPTUpdateFunc, pAppId) + if not pAppId then pAppId = 1 end + local pts_file_name = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" + .. commonFunctions:read_parameter_from_smart_device_link_ini("PathToSnapshot") + local ptu_file_name = os.tmpname() + local requestId = test.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) + test.hmiConnection:ExpectResponse(requestId) + :Do(function() + test.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", + { requestType = "PROPRIETARY", fileName = pts_file_name }) + getPTUFromPTS(ptuTable) + + m.updatePTU(ptuTable, pAppId) + + if pPTUpdateFunc then + pPTUpdateFunc(ptuTable) + end + + utils.tableToJsonFile(ptuTable, ptu_file_name) + + local event = events.Event() + event.matches = function(e1, e2) return e1 == e2 end + EXPECT_EVENT(event, "PTU event") + + local function getAppsCount() + local count = 0 + for _ in pairs(hmiAppIds) do + count = count + 1 + end + return count + end + for id = 1, getAppsCount() do + local session = m.getMobileSession(id) + session:ExpectNotification("OnSystemRequest", { requestType = "PROPRIETARY" }) + :Do(function() + print("App ".. id .. " was used for PTU") + RAISE_EVENT(event, event, "PTU event") + local corIdSystemRequest = session:SendRPC("SystemRequest", + { requestType = "PROPRIETARY" }, ptu_file_name) + EXPECT_HMICALL("BasicCommunication.SystemRequest") + :Do(function(_, d3) + test.hmiConnection:SendResponse(d3.id, "BasicCommunication.SystemRequest", "SUCCESS", { }) + test.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { policyfile = d3.params.fileName }) + end) + session:ExpectResponse(corIdSystemRequest, { success = true, resultCode = "SUCCESS" }) + :Do(function() os.remove(ptu_file_name) end) + end) + :Times(AtMost(1)) + end + end) +end + +--[[ @allowSDL: allow SDL functionality for default device +--! @parameters: none +--! @return: none +--]] +local function allowSDL(self) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { + allowed = true, + source = "GUI", + device = { + id = utils.getDeviceMAC(), + name = utils.getDeviceName() + } + }) +end + +--[[ @getAppID: return 'appID' from configuration file +--! @parameters: +--! pAppId - application number (1, 2, etc.) +--! @return: application identifier from configuration file +--]] +function m.getAppID(pAppId) + if not pAppId then pAppId = 1 end + return config["application" .. pAppId].registerAppInterfaceParams.appID +end + +--[[ @preconditions: precondition steps +--! @parameters: none +--! @return: none +--]] +function m.preconditions() + commonFunctions:SDLForceStop() + commonSteps:DeletePolicyTable() + commonSteps:DeleteLogsFiles() +end + +--[[ @activateApp: activate application +--! @parameters: +--! pAppId - application number (1, 2, etc.) +--! @return: none +--]] +function m.activateApp(pAppId) + if not pAppId then pAppId = 1 end + local pHMIAppId = hmiAppIds[config["application" .. pAppId].registerAppInterfaceParams.appID] + local mobSession = m.getMobileSession(pAppId) + local requestId = test.hmiConnection:SendRequest("SDL.ActivateApp", { appID = pHMIAppId }) + test.hmiConnection:ExpectResponse(requestId) + mobSession:ExpectNotification("OnHMIStatus", + { hmiLevel = "FULL", audioStreamingState = "AUDIBLE", systemContext = "MAIN" }) + commonTestCases:DelayedExp(m.minTimeout) +end + +--[[ @getHMIAppId: get HMI application identifier +--! @parameters: +--! pAppId - application number (1, 2, etc.) +--! @return: application identifier +--]] +function m.getHMIAppId(pAppId) + if not pAppId then pAppId = 1 end + return hmiAppIds[m.getAppID(pAppId)] +end + +--[[ @getMobileSession: get mobile session +--! @parameters: +--! pAppId - application number (1, 2, etc.) +--! @return: mobile session object +--]] +function m.getMobileSession(pAppId) + if not pAppId then pAppId = 1 end + local session + if not test.mobileSession[pAppId] then + session = mobileSession.MobileSession(test, test.mobileConnection) + test.mobileSession[pAppId] = session + if config.defaultProtocolVersion > 2 then + session.activateHeartbeat = true + session.sendHeartbeatToSDL = true + session.answerHeartbeatFromSDL = true + session.ignoreSDLHeartBeatACK = true + end + else + session = test.mobileSession[pAppId] + end + return session +end + +--[[ @registerApp: register mobile application +--! @parameters: +--! pAppId - application number (1, 2, etc.) +--! @return: none +--]] +function m.registerApp(pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + mobSession:StartService(7) + :Do(function() + local corId = mobSession:SendRPC("RegisterAppInterface", + config["application" .. pAppId].registerAppInterfaceParams) + test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", + { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) + :Do(function(_, d1) + hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID + test.hmiConnection:ExpectNotification("SDL.OnStatusUpdate", { status = "UPDATE_NEEDED" }, { status = "UPDATING" }) + :Times(2) + test.hmiConnection:ExpectRequest("BasicCommunication.PolicyUpdate") + :Do(function(_, d2) + test.hmiConnection:SendResponse(d2.id, d2.method, "SUCCESS", { }) + ptuTable = utils.jsonFileToTable(d2.params.file) + end) + end) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) + :Do(function() + mobSession:ExpectNotification("OnHMIStatus", + { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) + mobSession:ExpectNotification("OnPermissionsChange") + end) + end) +end + +--[[ @registerAppWOPTU: register mobile application and do not perform PTU +--! @parameters: +--! pAppId - application number (1, 2, etc.) +--! @return: none +--]] +function m.registerAppWOPTU(pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + mobSession:StartService(7) + :Do(function() + local corId = mobSession:SendRPC("RegisterAppInterface", + config["application" .. pAppId].registerAppInterfaceParams) + test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", + { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) + :Do(function(_, d1) + hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID + end) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) + :Do(function() + mobSession:ExpectNotification("OnHMIStatus", + { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) + mobSession:ExpectNotification("OnPermissionsChange") + end) + end) +end + +--[[ @policyTableUpdate: perform PTU +--! @parameters: +--! pPTUpdateFunc - function with additional updates +--! pExpNotificationFunc - function with specific expectations which needs to be done during PTU +--! pAppId - application number (1, 2, etc.) +--! @return: none +--]] +function m.policyTableUpdate(pPTUpdateFunc, pExpNotificationFunc, pAppId) + if not pAppId then pAppId = 1 end + if not pExpNotificationFunc then + test.hmiConnection:ExpectNotification("SDL.OnStatusUpdate", { status = "UP_TO_DATE" }) + test.hmiConnection:ExpectRequest("VehicleInfo.GetVehicleData", { odometer = true }) + else + pExpNotificationFunc() + end + ptu(pPTUpdateFunc, pAppId) +end + +--[[ @start: starting sequence: starting of SDL, initialization of HMI, connect mobile +--! @parameters: +--! pHMIParams - table with parameters for HMI initialization +--! @return: none +--]] +function m.start(pHMIParams) + test:runSDL() + commonFunctions:waitForSDLStart(test) + :Do(function() + test:initHMI() + :Do(function() + commonFunctions:userPrint(35, "HMI initialized") + test:initHMI_onReady(pHMIParams) + :Do(function() + commonFunctions:userPrint(35, "HMI is ready") + test:connectMobile() + :Do(function() + commonFunctions:userPrint(35, "Mobile connected") + allowSDL(test) + end) + end) + end) + end) +end + +--[[ @ExpectRequest: register expectation for request on HMI connection +--! @parameters: +--! pName - name of the request +--! ... - expected data +--! @return: Expectation object +--]] +function test.hmiConnection:ExpectRequest(pName, ...) + local event = events.Event() + event.matches = function(_, data) return data.method == pName end + local args = table.pack(...) + local ret = expectations.Expectation("HMI call " .. pName, self) + if #args > 0 then + ret:ValidIf(function(e, data) + local arguments + if e.occurences > #args then + arguments = args[#args] + else + arguments = args[e.occurences] + end + reporter.AddMessage("EXPECT_HMICALL", + { ["Id"] = data.id, ["name"] = tostring(pName),["Type"] = "EXPECTED_RESULT" }, arguments) + reporter.AddMessage("EXPECT_HMICALL", + { ["Id"] = data.id, ["name"] = tostring(pName),["Type"] = "AVAILABLE_RESULT" }, data.params) + return compareValues(arguments, data.params, "params") + end) + end + ret.event = event + event_dispatcher:AddEvent(self, event, ret) + test:AddExpectation(ret) + return ret +end + +--[[ @ExpectNotification: register expectation for notification on HMI connection +--! @parameters: +--! pName - name of the notification +--! ... - expected data +--! @return: Expectation object +--]] +function test.hmiConnection:ExpectNotification(pName, ...) + local event = events.Event() + event.matches = function(_, data) return data.method == pName end + local args = table.pack(...) + local ret = expectations.Expectation("HMI notification " .. pName, self) + if #args > 0 then + ret:ValidIf(function(e, data) + local arguments + if e.occurences > #args then + arguments = args[#args] + else + arguments = args[e.occurences] + end + local cid = test.notification_counter + test.notification_counter = test.notification_counter + 1 + reporter.AddMessage("EXPECT_HMINOTIFICATION", + { ["Id"] = cid, ["name"] = tostring(pName), ["Type"] = "EXPECTED_RESULT" }, arguments) + reporter.AddMessage("EXPECT_HMINOTIFICATION", + { ["Id"] = cid, ["name"] = tostring(pName), ["Type"] = "AVAILABLE_RESULT" }, data.params) + return compareValues(arguments, data.params, "params") + end) + end + ret.event = event + event_dispatcher:AddEvent(self, event, ret) + test:AddExpectation(ret) + return ret +end + +--[[ @ExpectResponse: register expectation for notification on HMI connection +--! @parameters: +--! pName - name of the notification +--! ... - expected data +--! @return: Expectation object +--]] +function test.hmiConnection:ExpectResponse(pId, ...) + local event = events.Event() + event.matches = function(_, data) return data.id == pId end + local args = table.pack(...) + local ret = expectations.Expectation("HMI response " .. pId, self) + if #args > 0 then + ret:ValidIf(function(e, data) + local arguments + if e.occurences > #args then + arguments = args[#args] + else + arguments = args[e.occurences] + end + reporter.AddMessage("EXPECT_HMIRESPONSE", { ["Id"] = data.id, ["Type"] = "EXPECTED_RESULT" }, arguments) + reporter.AddMessage("EXPECT_HMIRESPONSE", { ["Id"] = data.id, ["Type"] = "AVAILABLE_RESULT" }, data.result) + return compareValues(arguments, data.result, "result") + end) + end + ret.event = event + event_dispatcher:AddEvent(self, event, ret) + test:AddExpectation(ret) + return ret +end + +--[[ @getMobileConnection: return Mobile connection object +--! @parameters: none +--! @return: Mobile connection object +--]] +function m.getMobileConnection() + return test.mobileConnection +end + +--[[ @getHMIConnection: return HMI connection object +--! @parameters: none +--! @return: HMI connection object +--]] +function m.getHMIConnection() + return test.hmiConnection +end + +--[[ @setSDLConfigParameter: change original value of parameter in SDL .ini file +--! @parameters: +--! pParamName - name of the parameter +--! pParamValue - value to be set +--! @return: none +--]] +function m.setSDLIniParameter(pParamName, pParamValue) + originalValuesInSDLIni[pParamName] = commonFunctions:read_parameter_from_smart_device_link_ini(pParamName) + commonFunctions:write_parameter_to_smart_device_link_ini(pParamName, pParamValue) +end + +--[[ @restoreSDLConfigParameters: restore original values of parameters in SDL .ini file +--! @parameters: none +--! @return: none +--]] +local function restoreSDLIniParameters() + for pParamName, pParamValue in pairs(originalValuesInSDLIni) do + commonFunctions:write_parameter_to_smart_device_link_ini(pParamName, pParamValue) + end +end + +--[[ @postconditions: postcondition steps +--! @parameters: none +--! @return: none +--]] +function m.postconditions() + StopSDL() + restoreSDLIniParameters() +end + +return m diff --git a/user_modules/sequences/security.lua b/user_modules/sequences/security.lua new file mode 100644 index 0000000000..d1df643496 --- /dev/null +++ b/user_modules/sequences/security.lua @@ -0,0 +1,146 @@ +--------------------------------------------------------------------------------------------------- +-- Security common module +--------------------------------------------------------------------------------------------------- +--[[ General configuration parameters ]] +config.serverCertificatePath = "./files/Security/spt_credential.pem" +config.serverPrivateKeyPath = "./files/Security/spt_credential.pem" +config.serverCAChainCertPath = "./files/Security/spt_credential.pem" + +--[[ Required Shared libraries ]] +local actions = require("user_modules/sequences/actions") +local events = require("events") +local test = require("user_modules/dummy_connecttest") +local constants = require("protocol_handler/ford_protocol_constants") + +--[[ Module ]] +local m = {} + +--[[ Constants ]] +m.frameInfo = constants.FRAME_INFO + +--[[ Variables ]] +local origGetMobileSession = actions.getMobileSession + +--[[ Functions ]] + +--[[ @registerStartSecureServiceFunc: register function to start secure service +--! @parameters: +--! pMobSession - mobile session +--! @return: none +--]] +local function registerStartSecureServiceFunc(pMobSession) + function pMobSession.mobile_session_impl.control_services:StartSecureService(pServiceId) + local msg = { + serviceType = pServiceId, + frameInfo = constants.FRAME_INFO.START_SERVICE, + sessionId = self.session.sessionId.get(), + encryption = true + } + self:Send(msg) + end + function pMobSession.mobile_session_impl:StartSecureService(pServiceId) + if not self.isSecuredSession then + self.security:registerSessionSecurity() + self.security:prepareToHandshake() + end + return self.control_services:StartSecureService(pServiceId) + end +end + +--[[ @registerExpectServiceEventFunc: register functions for expectations of control messages: +--! Service Start ACK/NACK and Handshake +--! @parameters: +--! pMobSession - mobile session +--! @return: none +--]] +local function registerExpectServiceEventFunc(pMobSession) + function pMobSession:ExpectControlMessage(pServiceId, pData) + local session = self.mobile_session_impl.control_services.session + local event = events.Event() + event.matches = function(_, data) + return data.frameType == constants.FRAME_TYPE.CONTROL_FRAME and + data.serviceType == pServiceId and + (pServiceId == constants.SERVICE_TYPE.RPC or data.sessionId == session.sessionId.get()) and + (data.frameInfo == constants.FRAME_INFO.START_SERVICE_ACK or + data.frameInfo == constants.FRAME_INFO.START_SERVICE_NACK) + end + local ret = session:ExpectEvent(event, "StartService") + :Do(function(_, data) + if data.encryption == true and data.frameInfo == constants.FRAME_INFO.START_SERVICE_ACK then + session.security:registerSecureService(pServiceId) + end + end) + :ValidIf(function(_, data) + if data.encryption ~= pData.encryption then + return false, "Expected 'encryption' flag is '" .. tostring(pData.encryption) + .. "', actual is '" .. tostring(data.encryption) .. "'" + end + return true + end) + :ValidIf(function(_, data) + if data.frameInfo ~= pData.frameInfo then + return false, "Expected 'frameInfo' is '" .. tostring(pData.frameInfo) + .. "', actual is '" .. tostring(data.frameInfo) .. "'" + end + return true + end) + return ret + end + + function pMobSession:ExpectHandshakeMessage() + local session = self.mobile_session_impl.control_services.session + local event = events.Event() + event.matches = function(e1, e2) return e1 == e2 end + local ret = pMobSession:ExpectEvent(event, "Handshake") + local handshakeEvent = events.Event() + handshakeEvent.matches = function(_, data) + return data.frameType ~= constants.FRAME_TYPE.CONTROL_FRAME + and data.serviceType == constants.SERVICE_TYPE.CONTROL + and data.sessionId == session.sessionId.get() + and data.rpcType == constants.BINARY_RPC_TYPE.NOTIFICATION + and data.rpcFunctionId == constants.BINARY_RPC_FUNCTION_ID.HANDSHAKE + end + session:ExpectEvent(handshakeEvent, "Handshake internal") + :Do(function(_, data) + local binData = data.binaryData + local dataToSend = session.security:performHandshake(binData) + if dataToSend then + local handshakeMessage = { + frameInfo = 0, + serviceType = constants.SERVICE_TYPE.CONTROL, + encryption = false, + rpcType = constants.BINARY_RPC_TYPE.NOTIFICATION, + rpcFunctionId = constants.BINARY_RPC_FUNCTION_ID.HANDSHAKE, + rpcCorrelationId = data.rpcCorrelationId, + binaryData = dataToSend + } + session:Send(handshakeMessage) + end + end) + :Do(function() + if session.security:isHandshakeFinished() then + event_dispatcher:RaiseEvent(test.mobileConnection, event) + end + end) + :Times(AnyNumber()) + return ret + end +end + +--[[ @getMobileSession: override original getMobileSession function +-- and add additional functions to the mobile session object +--! @parameters: +--! pAppId - application number (1, 2, etc.) +--! @return: mobile session object +--]] +function actions.getMobileSession(pAppId) + if not pAppId then pAppId = 1 end + if not test.mobileSession[pAppId] then + local session = origGetMobileSession(pAppId) + registerStartSecureServiceFunc(session) + registerExpectServiceEventFunc(session) + end + return origGetMobileSession(pAppId) +end + +return m diff --git a/user_modules/utils.lua b/user_modules/utils.lua index 4a8320a079..78c9b74c08 100644 --- a/user_modules/utils.lua +++ b/user_modules/utils.lua @@ -1,111 +1,147 @@ -local module = {} +--------------------------------------------------------------------------------------------------- +-- Utils +--------------------------------------------------------------------------------------------------- +--[[ General configuration parameters ]] +config.mobileHost = "127.0.0.1" -local common_functions = require("user_modules/common_functions") -local api_loader = require("modules/api_loader") -local mobile_api = api_loader.init("data/MOBILE_API.xml") -local interface_schema = mobile_api.interface["SmartDeviceLink RAPI"] +--[[ Required Shared libraries ]] +local json = require("modules/json") +local events = require('events') ---! @brief Function which returns unordered key set from any table ---! @param table - table from which we are going to get the keys -function module.GetUnorderedTableKeyset(source_table) - local keyset = {} +--[[ Module ]] +local m = {} - for k in pairs(source_table) do - table.insert(keyset, k) - end - return keyset +--[[ Constants ]] +m.timeout = 2000 + +--[[ Functions ]] + +--[[ @jsonFileToTable: convert .json file to table +--! @parameters: +--! pFileName - file name +--! @return: table +--]] +function m.jsonFileToTable(pFileName) + local f = io.open(pFileName, "r") + local content = f:read("*all") + f:close() + return json.decode(content) end ---! @brief Function converts time in TZ format to epoch seconds ---! @param tz_date - date in TZ format ---! @return value - value in epoch seconds ---! @usage Function usage example: epoch_seconds = module.ConvertTZDateToEpochSeconds("2017-02-13T19:28:19Z") -function module.ConvertTZDateToEpochSeconds(tz_date) - local tz_table = {year = 0, month = 0, day = 0, hour = 0, min = 0, sec = 0} - local keyset = {"year", "month", "day", "hour", "min", "sec"} - local count = 1 - for element in string.gmatch(tz_date,'%d+') do - tz_table[keyset[count]] = element - count = count + 1 - end - return os.time(tz_table) +--[[ @tableToJsonFile: convert table to .json file +--! @parameters: +--! pTbl - table +--! pFileName - file name +--! @return: none +--]] +function m.tableToJsonFile(pTbl, pFileName) + local f = io.open(pFileName, "w") + f:write(json.encode(pTbl)) + f:close() end ---! @brief Allows to get struct value from any mobile api struct ---! @param struct_name - name of needed struct ---! @param param_name - struct parameter ---! @param value_to_read - value which is needed to be read ---! @usage Function usage example: maxvalueMenuParams = module.GetStructValueFromMobileApi( "MenuParams", "parentID", "maxvalue") -function module.GetStructValueFromMobileApi(struct_name, param_name, value_to_read) - if not interface_schema.struct[struct_name] then - common_functions:UserPrint(31, "Struct with name:", " ") - common_functions:UserPrint(0, struct_name, " ") - common_functions:UserPrint(31, "does not exist") - return nil +--[[ @readFile: read data from file +--! @parameters: +--! pPath - path to file +-- @return: content of the file +--]] +function m.readFile(pPath) + local open = io.open + local file = open(pPath, "rb") + if not file then return nil end + local content = file:read "*a" + file:close() + return content +end + +--[[ @cloneTable: clone table +--! @parameters: +--! pTbl - table to clone +--! @return: cloned table +--]] +function m.cloneTable(pTbl) + if pTbl == nil then + return {} end - if not interface_schema.struct[struct_name].param[param_name] then - common_functions:UserPrint(31, "Param with name:", " ") - common_functions:UserPrint(0, param_name, " ") - common_functions:UserPrint(31, "does not exist in structure:", " ") - common_functions:UserPrint(0, struct_name) - return nil + local copy = {} + for k, v in pairs(pTbl) do + if type(v) == 'table' then + v = m:cloneTable(v) + end + copy[k] = v end - return interface_schema.struct[struct_name].param[param_name][value_to_read] + return copy end ---! @brief Function allows to get an enum from mobile api ---! @param enum_name - enum name which we are going to get ---! @param Function usage example: local sampling_rates = utils.GetEnumFromMobileApi("SamplingRate") -function module.GetEnumFromMobileApi(enum_name) - if not interface_schema.enum[enum_name] then - common_functions:UserPrint(31, "Enum with name:", " ") - common_functions:UserPrint(0, enum_name, " ") - common_functions:UserPrint(31, "does not exist") - return nil - end - return module.GetUnorderedTableKeyset(interface_schema.enum[enum_name]) +--[[ @wait: delay test step for specific timeout +--! @parameters: +--! pTimeOut - time to wait in ms +--! @return: none +--]] +function m.wait(pTimeOut) + if not pTimeOut then pTimeOut = m.timeout end + local event = events.Event() + event.matches = function(event1, event2) return event1 == event2 end + EXPECT_EVENT(event, "Delayed event") + :Timeout(pTimeOut + 60000) + RUN_AFTER(function() RAISE_EVENT(event, event) end, pTimeOut) end ---! @brief Function allows to get any enum size(number of elements) from mobile api ---! @param enum_name - enum name which size we are going to get ---! @param Function usage example: maxlength = enum_size = module.GetEnumSizeFromMobileApi("AppInterfaceUnregisteredReason") -function module.GetEnumSizeFromMobileApi(enum_name) - if not interface_schema.enum[enum_name] then - common_functions:UserPrint(31, "Enum with name:", " ") - common_functions:UserPrint(0, enum_name, " ") - common_functions:UserPrint(31, "does not exist") - return nil - end - return #module.GetUnorderedTableKeyset(interface_schema.enum[enum_name]) +--[[ @getDeviceName: provide device name +--! @parameters: none +--! @return: name of the device +--]] +function m.getDeviceName() + return config.mobileHost .. ":" .. config.mobilePort end ---! @brief Function allows to get value from any mobile api function ---! @param function_type - request, response or notification ---! @param function_name - name of the function ---! @param param_name - function parameter ---! @param value_to_read - value which is needed to be read ---! @param Function usage example: maxlength = module.GetFunctionValueFromMobileApi("request", "Show", "mainField2", "maxlength") -function module.GetFunctionValueFromMobileApi(function_type, function_name, param_name, value_to_read) - if not interface_schema.type[function_type] then - common_functions:UserPrint(31, "Function with type:", " ") - common_functions:UserPrint(0, function_type, " ") - common_functions:UserPrint(31, "does not exist") - return nil - end - if not interface_schema.type[function_type].functions[function_name] then - common_functions:UserPrint(31, "Function with name:", " ") - common_functions:UserPrint(0, function_name, " ") - common_functions:UserPrint(31, "does not exist") - return nil - end - if not interface_schema.type[function_type].functions[function_name].param[param_name] then - common_functions:UserPrint(31, "Parameter with name:", " ") - common_functions:UserPrint(0, param_name, " ") - common_functions:UserPrint(31, "does not exist") - return nil - end - return interface_schema.type[function_type].functions[function_name].param[param_name][value_to_read] +--[[ @getDeviceMAC: provide device MAC address +--! @parameters: none +--! @return: MAC address of the device +--]] +function m.getDeviceMAC() + local cmd = "echo -n " .. m.getDeviceName() .. " | sha256sum | awk '{printf $1}'" + local handle = io.popen(cmd) + local result = handle:read("*a") + handle:close() + return result end -return module +--[[ @protect: make table immutable +--! @parameters: +--! pTbl - mutable table +--! @return: immutable table +--]] +function m.protect(pTbl) + local mt = { + __index = pTbl, + __newindex = function(_, k, v) + error("Attempting to change item " .. tostring(k) .. " to " .. tostring(v), 2) + end + } + return setmetatable({}, mt) +end + +--[[ @inheritObjects: copy objects from source module to target +-- 'objects' means: tables, functions, fields +-- Function is useful for 'inheriting' data of one module to another +--! @parameters: +--! pTargetObject - target module +--! pSourceObject - source module +--! @return: none +--]] +function m.inheritObjects(pTargetObject, pSourceObject) + for k, v in pairs(pSourceObject) do + if type(v) == "table" then + pTargetObject[k] = m.cloneTable(v) + elseif type(v) == "function" then + pTargetObject[k] = function(...) + return v(...) + end + else + pTargetObject[k] = v + end + end +end +return m From b5c496c2b00c666cc3b866f845391e20b31f7b70 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Tue, 27 Feb 2018 09:21:40 +0200 Subject: [PATCH 07/30] Correct parameter name --- ...request_with_both_supported_and_not_supported_parameters.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_scripts/RC/CLIMATE_RADIO/Capabilities/006_Reject_request_with_both_supported_and_not_supported_parameters.lua b/test_scripts/RC/CLIMATE_RADIO/Capabilities/006_Reject_request_with_both_supported_and_not_supported_parameters.lua index 42e4540f3d..facede9853 100644 --- a/test_scripts/RC/CLIMATE_RADIO/Capabilities/006_Reject_request_with_both_supported_and_not_supported_parameters.lua +++ b/test_scripts/RC/CLIMATE_RADIO/Capabilities/006_Reject_request_with_both_supported_and_not_supported_parameters.lua @@ -33,7 +33,7 @@ local climate_params = fanSpeed = 30, acEnable = true, acMaxEnable = true, - circulateAirEnableAvailable = true -- unsupported parameter + circulateAirEnable = true -- unsupported parameter } } From 6bb27e59da9c46a5c02238f6d379fc12c5320bc6 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Tue, 27 Feb 2018 15:48:10 +0200 Subject: [PATCH 08/30] Refactoring test scripts for Security --- .../1888_1_navi.lua | 1 - .../1888_2_non-navi.lua | 1 - .../1888_3_navi_audio_force_off.lua | 1 - .../1888_4_navi_video_force_off.lua | 1 - .../1888_5_navi_audio_force_on.lua | 1 - .../1888_6_navi_video_force_on.lua | 1 - .../1891_1_navi.lua | 1 - .../1891_2_non-navi.lua | 2 - .../1891_3_navi_audio.lua | 1 - .../1891_4_navi_video.lua | 1 - .../1894_1_navi.lua | 1 - .../1894_2_non-navi.lua | 1 - .../1894_3_navi_audio.lua | 1 - .../1894_4_navi_video.lua | 1 - .../1922_1_navi_audio.lua | 1 - .../1922_2_navi_video.lua | 1 - .../1923_1_navi_audio.lua | 1 - .../1923_2_navi_video.lua | 1 - .../1924_1_non-navi.lua | 1 - .../1924_2_navi.lua | 1 - .../1925_1_navi_no_cert_new_app.lua | 1 - .../1925_2_navi_no_cert_existing_app.lua | 4 +- .../1925_3_navi_cert_new_app.lua | 1 - .../1925_4_navi_cert_existing_app.lua | 4 +- .../1925_5_non-navi_no_cert_new_app.lua | 1 - .../1925_6_non-navi_no_cert_existing_app.lua | 4 +- .../1925_7_non-navi_cert_new_app.lua | 1 - .../1925_8_non-navi_cert_existing_app.lua | 4 +- .../4_5/Trigger_PTU_NO_Certificate/common.lua | 4 + user_modules/sequences/actions.lua | 83 +++++++++---------- 30 files changed, 49 insertions(+), 79 deletions(-) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_1_navi.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_1_navi.lua index 98eac05c46..50d1607975 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_1_navi.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_1_navi.lua @@ -22,7 +22,6 @@ local function ptUpdate(pTbl) local filePath = "./files/Security/client_credential.pem" local crt = common.readFile(filePath) pTbl.policy_table.module_config.certificate = crt - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured(pData) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_2_non-navi.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_2_non-navi.lua index 34ff3608bd..e701804700 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_2_non-navi.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_2_non-navi.lua @@ -20,7 +20,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured(pData) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_3_navi_audio_force_off.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_3_navi_audio_force_off.lua index 41c726f208..8258cf2334 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_3_navi_audio_force_off.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_3_navi_audio_force_off.lua @@ -22,7 +22,6 @@ local function ptUpdate(pTbl) local filePath = "./files/Security/client_credential.pem" local crt = common.readFile(filePath) pTbl.policy_table.module_config.certificate = crt - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured(pData) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_4_navi_video_force_off.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_4_navi_video_force_off.lua index d715b8ac5f..a13799ec66 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_4_navi_video_force_off.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_4_navi_video_force_off.lua @@ -22,7 +22,6 @@ local function ptUpdate(pTbl) local filePath = "./files/Security/client_credential.pem" local crt = common.readFile(filePath) pTbl.policy_table.module_config.certificate = crt - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured(pData) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_5_navi_audio_force_on.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_5_navi_audio_force_on.lua index 6f259f1b16..bf9aecfb51 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_5_navi_audio_force_on.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_5_navi_audio_force_on.lua @@ -22,7 +22,6 @@ local function ptUpdate(pTbl) local filePath = "./files/Security/client_credential.pem" local crt = common.readFile(filePath) pTbl.policy_table.module_config.certificate = crt - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured(pData) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_6_navi_video_force_on.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_6_navi_video_force_on.lua index 1eef37afbf..adbb37437a 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_6_navi_video_force_on.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1888_6_navi_video_force_on.lua @@ -22,7 +22,6 @@ local function ptUpdate(pTbl) local filePath = "./files/Security/client_credential.pem" local crt = common.readFile(filePath) pTbl.policy_table.module_config.certificate = crt - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured(pData) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_1_navi.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_1_navi.lua index adf0a6f0b2..ebfebd71d6 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_1_navi.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_1_navi.lua @@ -17,7 +17,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } pTbl.policy_table.module_config.seconds_between_retries = nil end diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_2_non-navi.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_2_non-navi.lua index 7abe903165..fccbf36b02 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_2_non-navi.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_2_non-navi.lua @@ -18,11 +18,9 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdateSuccess(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function ptUpdateUnssucess(pTbl) - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } pTbl.policy_table.module_config.seconds_between_retries = nil end diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_3_navi_audio.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_3_navi_audio.lua index 37af0eec96..9fb98e56b6 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_3_navi_audio.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_3_navi_audio.lua @@ -17,7 +17,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } pTbl.policy_table.module_config.seconds_between_retries = nil end diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_4_navi_video.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_4_navi_video.lua index 8e1bd82230..070d6d05ae 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_4_navi_video.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1891_4_navi_video.lua @@ -17,7 +17,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } pTbl.policy_table.module_config.seconds_between_retries = nil end diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_1_navi.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_1_navi.lua index 1c47142849..5659b655ef 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_1_navi.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_1_navi.lua @@ -18,7 +18,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured() diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_2_non-navi.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_2_non-navi.lua index c29e64a6b7..3458f0a57c 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_2_non-navi.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_2_non-navi.lua @@ -18,7 +18,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured() diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_3_navi_audio.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_3_navi_audio.lua index a857a7d08a..0311bb8caa 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_3_navi_audio.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_3_navi_audio.lua @@ -18,7 +18,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured() diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_4_navi_video.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_4_navi_video.lua index cdb233ccd9..ebe5c82901 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_4_navi_video.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1894_4_navi_video.lua @@ -18,7 +18,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured() diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_1_navi_audio.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_1_navi_audio.lua index 93425e08bd..c90960ae93 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_1_navi_audio.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_1_navi_audio.lua @@ -18,7 +18,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured() diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_2_navi_video.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_2_navi_video.lua index ef8631d651..8cb9199a57 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_2_navi_video.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1922_2_navi_video.lua @@ -18,7 +18,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured() diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_1_navi_audio.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_1_navi_audio.lua index 92d37bade3..f2748c30c8 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_1_navi_audio.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_1_navi_audio.lua @@ -17,7 +17,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } pTbl.policy_table.module_config.seconds_between_retries = nil end diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_2_navi_video.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_2_navi_video.lua index 99ee1a1829..13c912094d 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_2_navi_video.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1923_2_navi_video.lua @@ -17,7 +17,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } pTbl.policy_table.module_config.seconds_between_retries = nil end diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1924_1_non-navi.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1924_1_non-navi.lua index 65c08ae593..ba410c9b22 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1924_1_non-navi.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1924_1_non-navi.lua @@ -18,7 +18,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured() diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1924_2_navi.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1924_2_navi.lua index 112cdb1d4b..ffce7517af 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1924_2_navi.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1924_2_navi.lua @@ -18,7 +18,6 @@ config.application1.registerAppInterfaceParams.appHMIType = { appHMIType } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID()].AppHMIType = { appHMIType } end local function startServiceSecured() diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_1_navi_no_cert_new_app.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_1_navi_no_cert_new_app.lua index 62b367fc45..927335055d 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_1_navi_no_cert_new_app.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_1_navi_no_cert_new_app.lua @@ -21,7 +21,6 @@ config.application2.registerAppInterfaceParams.appHMIType = { appHMIType[2] } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID(1)].AppHMIType = { appHMIType[1] } end local function registerApp(pAppId) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_2_navi_no_cert_existing_app.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_2_navi_no_cert_existing_app.lua index 8293893881..0304aca686 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_2_navi_no_cert_existing_app.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_2_navi_no_cert_existing_app.lua @@ -21,9 +21,7 @@ config.application2.registerAppInterfaceParams.appHMIType = { appHMIType[2] } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID(1)].AppHMIType = { appHMIType[1] } - common.updatePTU(pTbl, 2) - pTbl.policy_table.app_policies[common.getAppID(2)].AppHMIType = { appHMIType[2] } + pTbl.policy_table.app_policies[common.getAppID(2)] = common.getAppDataForPTU(2) end local function registerApp(pAppId) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_3_navi_cert_new_app.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_3_navi_cert_new_app.lua index 2ba5a572e5..b1d8314317 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_3_navi_cert_new_app.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_3_navi_cert_new_app.lua @@ -20,7 +20,6 @@ config.application2.registerAppInterfaceParams.appHMIType = { appHMIType[2] } --[[ Local Functions ]] local function ptUpdate(pTbl) - pTbl.policy_table.app_policies[common.getAppID(1)].AppHMIType = { appHMIType[1] } local filePath = "./files/Security/client_credential.pem" local crt = common.readFile(filePath) pTbl.policy_table.module_config.certificate = crt diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_4_navi_cert_existing_app.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_4_navi_cert_existing_app.lua index 7f8a80d78e..3beddb54b7 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_4_navi_cert_existing_app.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_4_navi_cert_existing_app.lua @@ -20,12 +20,10 @@ config.application2.registerAppInterfaceParams.appHMIType = { appHMIType[2] } --[[ Local Functions ]] local function ptUpdate(pTbl) - pTbl.policy_table.app_policies[common.getAppID(1)].AppHMIType = { appHMIType[1] } local filePath = "./files/Security/client_credential.pem" local crt = common.readFile(filePath) pTbl.policy_table.module_config.certificate = crt - common.updatePTU(pTbl, 2) - pTbl.policy_table.app_policies[common.getAppID(2)].AppHMIType = { appHMIType[2] } + pTbl.policy_table.app_policies[common.getAppID(2)] = common.getAppDataForPTU(2) end local function registerApp(pAppId) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_5_non-navi_no_cert_new_app.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_5_non-navi_no_cert_new_app.lua index 554d02ec7a..ebc675c560 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_5_non-navi_no_cert_new_app.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_5_non-navi_no_cert_new_app.lua @@ -21,7 +21,6 @@ config.application2.registerAppInterfaceParams.appHMIType = { appHMIType[2] } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID(1)].AppHMIType = { appHMIType[1] } end local function registerApp(pAppId) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_6_non-navi_no_cert_existing_app.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_6_non-navi_no_cert_existing_app.lua index 84da86156a..1677bbf65f 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_6_non-navi_no_cert_existing_app.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_6_non-navi_no_cert_existing_app.lua @@ -21,9 +21,7 @@ config.application2.registerAppInterfaceParams.appHMIType = { appHMIType[2] } --[[ Local Functions ]] local function ptUpdate(pTbl) pTbl.policy_table.module_config.certificate = nil - pTbl.policy_table.app_policies[common.getAppID(1)].AppHMIType = { appHMIType[1] } - common.updatePTU(pTbl, 2) - pTbl.policy_table.app_policies[common.getAppID(2)].AppHMIType = { appHMIType[2] } + pTbl.policy_table.app_policies[common.getAppID(2)] = common.getAppDataForPTU(2) end local function registerApp(pAppId) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_7_non-navi_cert_new_app.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_7_non-navi_cert_new_app.lua index 1e002fbcf8..a4e114d4fb 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_7_non-navi_cert_new_app.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_7_non-navi_cert_new_app.lua @@ -20,7 +20,6 @@ config.application2.registerAppInterfaceParams.appHMIType = { appHMIType[2] } --[[ Local Functions ]] local function ptUpdate(pTbl) - pTbl.policy_table.app_policies[common.getAppID(1)].AppHMIType = { appHMIType[1] } local filePath = "./files/Security/client_credential.pem" local crt = common.readFile(filePath) pTbl.policy_table.module_config.certificate = crt diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_8_non-navi_cert_existing_app.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_8_non-navi_cert_existing_app.lua index 45967a1e87..6f6f1d9b8b 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_8_non-navi_cert_existing_app.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/1925_8_non-navi_cert_existing_app.lua @@ -20,12 +20,10 @@ config.application2.registerAppInterfaceParams.appHMIType = { appHMIType[2] } --[[ Local Functions ]] local function ptUpdate(pTbl) - pTbl.policy_table.app_policies[common.getAppID(1)].AppHMIType = { appHMIType[1] } local filePath = "./files/Security/client_credential.pem" local crt = common.readFile(filePath) pTbl.policy_table.module_config.certificate = crt - common.updatePTU(pTbl, 2) - pTbl.policy_table.app_policies[common.getAppID(2)].AppHMIType = { appHMIType[2] } + pTbl.policy_table.app_policies[common.getAppID(2)] = common.getAppDataForPTU(2) end local function registerApp(pAppId) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua index 6d7dff8f48..aaced0218f 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua @@ -28,4 +28,8 @@ function m.readFile(pFilePath) return utils.readFile(pFilePath) end +function m.getAppID(pAppId) + return m.getConfigAppParams(pAppId).appID +end + return m diff --git a/user_modules/sequences/actions.lua b/user_modules/sequences/actions.lua index 2dee196e31..6bc144cb74 100644 --- a/user_modules/sequences/actions.lua +++ b/user_modules/sequences/actions.lua @@ -43,30 +43,40 @@ local function getPTUFromPTS(pTbl) pTbl.policy_table.module_config.preloaded_date = nil end ---[[ @updatePTU: update PTU table with additional functional group for Navigation RPCs +--[[ @getAppDataForPTU: provide application data for PTU --! @parameters: ---! pTbl - PTU table --! pAppId - application number (1, 2, etc.) --! @return: none --]] -function m.updatePTU(pTbl, pAppId) - pTbl.policy_table.app_policies[m.getAppID(pAppId)] = { +function m.getAppDataForPTU(pAppId) + return { keep_context = false, steal_focus = false, priority = "NONE", default_hmi = "NONE", - groups = { "Base-4", "Location-1" } + groups = { "Base-4", "Location-1" }, + AppHMIType = m.getConfigAppParams(pAppId).appHMIType } end +--[[ @updatePTU: update PTU table with application data +--! @parameters: +--! pTbl - PTU table +--! @return: none +--]] +function m.updatePTU(pTbl) + for i = 1, m.getAppsCount() do + pTbl.policy_table.app_policies[m.getConfigAppParams(i).appID] = m.getAppDataForPTU(i) + end +end + --[[ @ptu: perform policy table update --! @parameters: --! pPTUpdateFunc - additional function for update --! pAppId - application number (1, 2, etc.) --! @return: none --]] -local function ptu(pPTUpdateFunc, pAppId) - if not pAppId then pAppId = 1 end +local function ptu(pPTUpdateFunc) local pts_file_name = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" .. commonFunctions:read_parameter_from_smart_device_link_ini("PathToSnapshot") local ptu_file_name = os.tmpname() @@ -77,7 +87,7 @@ local function ptu(pPTUpdateFunc, pAppId) { requestType = "PROPRIETARY", fileName = pts_file_name }) getPTUFromPTS(ptuTable) - m.updatePTU(ptuTable, pAppId) + m.updatePTU(ptuTable) if pPTUpdateFunc then pPTUpdateFunc(ptuTable) @@ -88,15 +98,7 @@ local function ptu(pPTUpdateFunc, pAppId) local event = events.Event() event.matches = function(e1, e2) return e1 == e2 end EXPECT_EVENT(event, "PTU event") - - local function getAppsCount() - local count = 0 - for _ in pairs(hmiAppIds) do - count = count + 1 - end - return count - end - for id = 1, getAppsCount() do + for id = 1, m.getAppsCount() do local session = m.getMobileSession(id) session:ExpectNotification("OnSystemRequest", { requestType = "PROPRIETARY" }) :Do(function() @@ -132,14 +134,14 @@ local function allowSDL(self) }) end ---[[ @getAppID: return 'appID' from configuration file +--[[ @getConfigAppParams: return app's configuration from defined in config file --! @parameters: --! pAppId - application number (1, 2, etc.) --! @return: application identifier from configuration file --]] -function m.getAppID(pAppId) +function m.getConfigAppParams(pAppId) if not pAppId then pAppId = 1 end - return config["application" .. pAppId].registerAppInterfaceParams.appID + return config["application" .. pAppId].registerAppInterfaceParams end --[[ @preconditions: precondition steps @@ -159,13 +161,11 @@ end --]] function m.activateApp(pAppId) if not pAppId then pAppId = 1 end - local pHMIAppId = hmiAppIds[config["application" .. pAppId].registerAppInterfaceParams.appID] - local mobSession = m.getMobileSession(pAppId) - local requestId = test.hmiConnection:SendRequest("SDL.ActivateApp", { appID = pHMIAppId }) + local requestId = test.hmiConnection:SendRequest("SDL.ActivateApp", { appID = m.getHMIAppId(pAppId) }) test.hmiConnection:ExpectResponse(requestId) - mobSession:ExpectNotification("OnHMIStatus", + m.getMobileSession(pAppId):ExpectNotification("OnHMIStatus", { hmiLevel = "FULL", audioStreamingState = "AUDIBLE", systemContext = "MAIN" }) - commonTestCases:DelayedExp(m.minTimeout) + utils.wait() end --[[ @getHMIAppId: get HMI application identifier @@ -175,7 +175,7 @@ end --]] function m.getHMIAppId(pAppId) if not pAppId then pAppId = 1 end - return hmiAppIds[m.getAppID(pAppId)] + return hmiAppIds[m.getConfigAppParams(pAppId).appID] end --[[ @getMobileSession: get mobile session @@ -211,12 +211,11 @@ function m.registerApp(pAppId) local mobSession = m.getMobileSession(pAppId) mobSession:StartService(7) :Do(function() - local corId = mobSession:SendRPC("RegisterAppInterface", - config["application" .. pAppId].registerAppInterfaceParams) + local corId = mobSession:SendRPC("RegisterAppInterface", m.getConfigAppParams(pAppId)) test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", - { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) + { application = { appName = m.getConfigAppParams(pAppId).appName } }) :Do(function(_, d1) - hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID + hmiAppIds[m.getConfigAppParams(pAppId).appID] = d1.params.application.appID test.hmiConnection:ExpectNotification("SDL.OnStatusUpdate", { status = "UPDATE_NEEDED" }, { status = "UPDATING" }) :Times(2) test.hmiConnection:ExpectRequest("BasicCommunication.PolicyUpdate") @@ -244,12 +243,11 @@ function m.registerAppWOPTU(pAppId) local mobSession = m.getMobileSession(pAppId) mobSession:StartService(7) :Do(function() - local corId = mobSession:SendRPC("RegisterAppInterface", - config["application" .. pAppId].registerAppInterfaceParams) + local corId = mobSession:SendRPC("RegisterAppInterface", m.getConfigAppParams(pAppId)) test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", - { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) + { application = { appName = m.getConfigAppParams(pAppId).appName } }) :Do(function(_, d1) - hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID + hmiAppIds[m.getConfigAppParams(pAppId).appID] = d1.params.application.appID end) mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) :Do(function() @@ -263,19 +261,16 @@ end --[[ @policyTableUpdate: perform PTU --! @parameters: --! pPTUpdateFunc - function with additional updates ---! pExpNotificationFunc - function with specific expectations which needs to be done during PTU ---! pAppId - application number (1, 2, etc.) --! @return: none --]] -function m.policyTableUpdate(pPTUpdateFunc, pExpNotificationFunc, pAppId) - if not pAppId then pAppId = 1 end - if not pExpNotificationFunc then +function m.policyTableUpdate(pPTUpdateFunc, pExpNotificationFunc) + if pExpNotificationFunc then + pExpNotificationFunc() + else test.hmiConnection:ExpectNotification("SDL.OnStatusUpdate", { status = "UP_TO_DATE" }) test.hmiConnection:ExpectRequest("VehicleInfo.GetVehicleData", { odometer = true }) - else - pExpNotificationFunc() end - ptu(pPTUpdateFunc, pAppId) + ptu(pPTUpdateFunc) end --[[ @start: starting sequence: starting of SDL, initialization of HMI, connect mobile @@ -445,4 +440,8 @@ function m.postconditions() restoreSDLIniParameters() end +function m.getAppsCount() + return #test.mobileSession +end + return m From d60b4ecfe03e41fb01c4654b713763bf212761f2 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Tue, 27 Feb 2018 22:49:51 +0200 Subject: [PATCH 09/30] Remove unused code --- user_modules/sequences/actions.lua | 71 +++++++++++------------------- user_modules/utils.lua | 9 ++++ 2 files changed, 35 insertions(+), 45 deletions(-) diff --git a/user_modules/sequences/actions.lua b/user_modules/sequences/actions.lua index 6bc144cb74..5be21e543c 100644 --- a/user_modules/sequences/actions.lua +++ b/user_modules/sequences/actions.lua @@ -6,7 +6,6 @@ local mobileSession = require("mobile_session") local json = require("modules/json") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") -local commonTestCases = require("user_modules/shared_testcases/commonTestCases") local events = require("events") local test = require("user_modules/dummy_connecttest") local expectations = require('expectations') @@ -59,42 +58,35 @@ function m.getAppDataForPTU(pAppId) } end ---[[ @updatePTU: update PTU table with application data +--[[ @policyTableUpdate: perform PTU --! @parameters: ---! pTbl - PTU table +--! pPTUpdateFunc - function with additional updates (optional) +--! pExpNotificationFunc - function with specific expectations (optional) --! @return: none --]] -function m.updatePTU(pTbl) - for i = 1, m.getAppsCount() do - pTbl.policy_table.app_policies[m.getConfigAppParams(i).appID] = m.getAppDataForPTU(i) +function m.policyTableUpdate(pPTUpdateFunc, pExpNotificationFunc) + if pExpNotificationFunc then + pExpNotificationFunc() + else + test.hmiConnection:ExpectNotification("SDL.OnStatusUpdate", { status = "UP_TO_DATE" }) + test.hmiConnection:ExpectRequest("VehicleInfo.GetVehicleData", { odometer = true }) end -end - ---[[ @ptu: perform policy table update ---! @parameters: ---! pPTUpdateFunc - additional function for update ---! pAppId - application number (1, 2, etc.) ---! @return: none ---]] -local function ptu(pPTUpdateFunc) - local pts_file_name = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" + local ptsFileName = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" .. commonFunctions:read_parameter_from_smart_device_link_ini("PathToSnapshot") - local ptu_file_name = os.tmpname() + local ptuFileName = os.tmpname() local requestId = test.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) test.hmiConnection:ExpectResponse(requestId) :Do(function() test.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", - { requestType = "PROPRIETARY", fileName = pts_file_name }) + { requestType = "PROPRIETARY", fileName = ptsFileName }) getPTUFromPTS(ptuTable) - - m.updatePTU(ptuTable) - + for i = 1, m.getAppsCount() do + ptuTable.policy_table.app_policies[m.getConfigAppParams(i).appID] = m.getAppDataForPTU(i) + end if pPTUpdateFunc then pPTUpdateFunc(ptuTable) end - - utils.tableToJsonFile(ptuTable, ptu_file_name) - + utils.tableToJsonFile(ptuTable, ptuFileName) local event = events.Event() event.matches = function(e1, e2) return e1 == e2 end EXPECT_EVENT(event, "PTU event") @@ -102,17 +94,17 @@ local function ptu(pPTUpdateFunc) local session = m.getMobileSession(id) session:ExpectNotification("OnSystemRequest", { requestType = "PROPRIETARY" }) :Do(function() - print("App ".. id .. " was used for PTU") + utils.cprint(35, "App ".. id .. " was used for PTU") RAISE_EVENT(event, event, "PTU event") local corIdSystemRequest = session:SendRPC("SystemRequest", - { requestType = "PROPRIETARY" }, ptu_file_name) + { requestType = "PROPRIETARY" }, ptuFileName) EXPECT_HMICALL("BasicCommunication.SystemRequest") :Do(function(_, d3) test.hmiConnection:SendResponse(d3.id, "BasicCommunication.SystemRequest", "SUCCESS", { }) test.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { policyfile = d3.params.fileName }) end) session:ExpectResponse(corIdSystemRequest, { success = true, resultCode = "SUCCESS" }) - :Do(function() os.remove(ptu_file_name) end) + :Do(function() os.remove(ptuFileName) end) end) :Times(AtMost(1)) end @@ -258,21 +250,6 @@ function m.registerAppWOPTU(pAppId) end) end ---[[ @policyTableUpdate: perform PTU ---! @parameters: ---! pPTUpdateFunc - function with additional updates ---! @return: none ---]] -function m.policyTableUpdate(pPTUpdateFunc, pExpNotificationFunc) - if pExpNotificationFunc then - pExpNotificationFunc() - else - test.hmiConnection:ExpectNotification("SDL.OnStatusUpdate", { status = "UP_TO_DATE" }) - test.hmiConnection:ExpectRequest("VehicleInfo.GetVehicleData", { odometer = true }) - end - ptu(pPTUpdateFunc) -end - --[[ @start: starting sequence: starting of SDL, initialization of HMI, connect mobile --! @parameters: --! pHMIParams - table with parameters for HMI initialization @@ -284,13 +261,13 @@ function m.start(pHMIParams) :Do(function() test:initHMI() :Do(function() - commonFunctions:userPrint(35, "HMI initialized") + utils.cprint(35, "HMI initialized") test:initHMI_onReady(pHMIParams) :Do(function() - commonFunctions:userPrint(35, "HMI is ready") + utils.cprint(35, "HMI is ready") test:connectMobile() :Do(function() - commonFunctions:userPrint(35, "Mobile connected") + utils.cprint(35, "Mobile connected") allowSDL(test) end) end) @@ -440,6 +417,10 @@ function m.postconditions() restoreSDLIniParameters() end +--[[ @getAppsCount: provide count of registered applications +--! @parameters: none +--! @return: count of apps +--]] function m.getAppsCount() return #test.mobileSession end diff --git a/user_modules/utils.lua b/user_modules/utils.lua index 78c9b74c08..e15afb8931 100644 --- a/user_modules/utils.lua +++ b/user_modules/utils.lua @@ -144,4 +144,13 @@ function m.inheritObjects(pTargetObject, pSourceObject) end end +--[[ @cprint: print color message to console +--! @parameters: +--! pColor - color code +--! pMsg - message +--]] +function m.cprint(pColor, pMsg) + print("\27[" .. tostring(pColor) .. "m" .. tostring(pMsg) .. "\27[0m") +end + return m From 8f5cb5d6a7e14d64612c8f05676d7771ac9086b1 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Wed, 28 Feb 2018 17:18:12 +0200 Subject: [PATCH 10/30] Decrease priority of internal ATF expectations --- user_modules/connecttest_resumption.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_modules/connecttest_resumption.lua b/user_modules/connecttest_resumption.lua index 3ea6e55bf4..cff55d9d12 100644 --- a/user_modules/connecttest_resumption.lua +++ b/user_modules/connecttest_resumption.lua @@ -363,7 +363,7 @@ end function module:initHMI_onReady() local function ExpectRequest(name, mandatory, params) local event = events.Event() - event.level = 2 + event.level = 1 event.matches = function(self, data) return data.method == name end return EXPECT_HMIEVENT(event, name) @@ -382,7 +382,7 @@ function module:initHMI_onReady() local function ExpectNotification(name, mandatory) xmlReporter.AddMessage(debug.getinfo(1, "n").name, tostring(name)) local event = events.Event() - event.level = 2 + event.level = 1 event.matches = function(self, data) return data.method == name end return EXPECT_HMIEVENT(event, name) From c79a94ef8babbdc8fc255bff3b75d82c13c89435 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Wed, 28 Feb 2018 17:58:30 +0200 Subject: [PATCH 11/30] Change SDL protocol version to 2 --- ...ATF_P_Policies_Performance_Requirement.lua | 1 + ...6_ATF_OnPolicyUpdate_initiation_of_PTU.lua | 1 + ..._Application_Which_Appid_Exists_In_LPT.lua | 1 + .../194_ATF_ActivateApp_isSDLAllowed_true.lua | 1 + .../197_ATF_ActivateApp_isSDLAllowed_true.lua | 1 + ...13_ATF_No_user_consent_prompt_in_group.lua | 6 +- .../214_ATF_User_consent_prompt_persists.lua | 7 ++- .../shared_testcases/commonPreconditions.lua | 10 +-- .../testCasesForPolicyAppIdManagament.lua | 61 +++++++++---------- .../testCasesForPolicyTable.lua | 2 + 10 files changed, 48 insertions(+), 43 deletions(-) diff --git a/test_scripts/Policies/Policies_Security/119_ATF_P_Policies_Performance_Requirement.lua b/test_scripts/Policies/Policies_Security/119_ATF_P_Policies_Performance_Requirement.lua index 6eafbc6e23..d29f4fc35e 100644 --- a/test_scripts/Policies/Policies_Security/119_ATF_P_Policies_Performance_Requirement.lua +++ b/test_scripts/Policies/Policies_Security/119_ATF_P_Policies_Performance_Requirement.lua @@ -16,6 +16,7 @@ --[[ General configuration parameters ]] config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local mobile_session = require("mobile_session") diff --git a/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua b/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua index 97f33f072b..0ce420c61a 100644 --- a/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua +++ b/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua @@ -13,6 +13,7 @@ --[[ General configuration parameters ]] config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/appID_Management/046_ATF_Register_App_Interface_Assign_Existing_Policies_To_Application_Which_Appid_Exists_In_LPT.lua b/test_scripts/Policies/appID_Management/046_ATF_Register_App_Interface_Assign_Existing_Policies_To_Application_Which_Appid_Exists_In_LPT.lua index 2fc5f5e483..ffe027dd9c 100644 --- a/test_scripts/Policies/appID_Management/046_ATF_Register_App_Interface_Assign_Existing_Policies_To_Application_Which_Appid_Exists_In_LPT.lua +++ b/test_scripts/Policies/appID_Management/046_ATF_Register_App_Interface_Assign_Existing_Policies_To_Application_Which_Appid_Exists_In_LPT.lua @@ -20,6 +20,7 @@ --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") diff --git a/test_scripts/Policies/user_consent_of_Policies/194_ATF_ActivateApp_isSDLAllowed_true.lua b/test_scripts/Policies/user_consent_of_Policies/194_ATF_ActivateApp_isSDLAllowed_true.lua index a373fd8ea1..1b13d968c6 100644 --- a/test_scripts/Policies/user_consent_of_Policies/194_ATF_ActivateApp_isSDLAllowed_true.lua +++ b/test_scripts/Policies/user_consent_of_Policies/194_ATF_ActivateApp_isSDLAllowed_true.lua @@ -21,6 +21,7 @@ --[[ General configuration parameters ]] config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/user_consent_of_Policies/197_ATF_ActivateApp_isSDLAllowed_true.lua b/test_scripts/Policies/user_consent_of_Policies/197_ATF_ActivateApp_isSDLAllowed_true.lua index 20f559c28b..33c408e9db 100644 --- a/test_scripts/Policies/user_consent_of_Policies/197_ATF_ActivateApp_isSDLAllowed_true.lua +++ b/test_scripts/Policies/user_consent_of_Policies/197_ATF_ActivateApp_isSDLAllowed_true.lua @@ -24,6 +24,7 @@ --[[ General configuration parameters ]] config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/user_consent_of_Policies/213_ATF_No_user_consent_prompt_in_group.lua b/test_scripts/Policies/user_consent_of_Policies/213_ATF_No_user_consent_prompt_in_group.lua index 8ae7cb6cf7..93b010162e 100644 --- a/test_scripts/Policies/user_consent_of_Policies/213_ATF_No_user_consent_prompt_in_group.lua +++ b/test_scripts/Policies/user_consent_of_Policies/213_ATF_No_user_consent_prompt_in_group.lua @@ -22,6 +22,7 @@ --[[ General configuration parameters ]] config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') @@ -31,9 +32,6 @@ local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/t --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() ---testCasesForPolicyTable:Precondition_updatePolicy_By_overwriting_preloaded_pt("files/DeviceGroupInPreconsented_preloadedPT.json") ---TODO(istoimenova): shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed -config.defaultProtocolVersion = 2 --[[ General Settings for configuration ]] Test = require('connecttest') @@ -68,7 +66,7 @@ end function Test:TestStep_app_no_consent() local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID) - if(app_permission ~= 0) then + if(app_permission ~= nil) then self:FailTestCase("Consented gropus are assigned to application") end end diff --git a/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua b/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua index 7b48c010e1..0e03ec8d9e 100644 --- a/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua +++ b/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua @@ -21,6 +21,7 @@ --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') @@ -133,8 +134,8 @@ end --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() ---TODO(istoimenova): shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed -config.defaultProtocolVersion = 2 + + testCasesForPolicyTable.Delete_Policy_table_snapshot() testCasesForPolicyTable:Precondition_updatePolicy_By_overwriting_preloaded_pt("files/sdl_preloaded_pt_AlertOnlyNotifications_1.json") @@ -176,7 +177,7 @@ function Test:Precondition_IsPermissionsConsentNeeded_false_on_app_activation() EXPECT_HMICALL("BasicCommunication.PolicyUpdate", {file = "/tmp/fs/mp/images/ivsu_cache/sdl_snapshot.json"}) :Do(function() local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID) - if(app_permission ~= 0) then + if(app_permission ~= nil) then self:FailTestCase("Consented gropus are assigned to application") end end) diff --git a/user_modules/shared_testcases/commonPreconditions.lua b/user_modules/shared_testcases/commonPreconditions.lua index 653f98ca26..8871b0f1cb 100644 --- a/user_modules/shared_testcases/commonPreconditions.lua +++ b/user_modules/shared_testcases/commonPreconditions.lua @@ -173,8 +173,8 @@ function Preconditions:Connecttest_without_ExitBySDLDisconnect_WithoutOpenConnec local fileContent = f:read("*all") f:close() - local pattertConnectMobileCall = "function .?module%:ConnectMobile.-connectMobile.-end" - local patternStartSessionCall = "function .?module%:StartSession.-startSession.-end" + local pattertConnectMobileCall = "function .?Test%:ConnectMobile.-connectMobile.-end" + local patternStartSessionCall = "function .?Test%:StartSession.-startSession.-end" local connectMobileCall = fileContent:match(pattertConnectMobileCall) local startSessionCall = fileContent:match(patternStartSessionCall) @@ -209,7 +209,7 @@ function Preconditions:Connecttest_without_ExitBySDLDisconnect_OpenConnection(Fi local fileContent = f:read("*all") f:close() - local patternStartSessionCall = "function .?module%:StartSession.-startSession.-end" + local patternStartSessionCall = "function .?Test%:StartSession.-startSession.-end" local startSessionCall = fileContent:match(patternStartSessionCall) if startSessionCall == nil then @@ -461,7 +461,7 @@ function Preconditions:Connecttest_InitHMI_onReady_call(FileName, createFile) fileContent = f:read("*all") f:close() - local pattern1 = "function .?module%:InitHMI_onReady.-initHMI_onReady.-end" + local pattern1 = "function .?Test%:InitHMI_onReady.-initHMI_onReady.-end" local pattern1Result = fileContent:match(pattern1) if pattern1Result == nil then @@ -476,4 +476,4 @@ function Preconditions:Connecttest_InitHMI_onReady_call(FileName, createFile) end -return Preconditions \ No newline at end of file +return Preconditions diff --git a/user_modules/shared_testcases/testCasesForPolicyAppIdManagament.lua b/user_modules/shared_testcases/testCasesForPolicyAppIdManagament.lua index e559c12b6c..5e7e37353c 100644 --- a/user_modules/shared_testcases/testCasesForPolicyAppIdManagament.lua +++ b/user_modules/shared_testcases/testCasesForPolicyAppIdManagament.lua @@ -1,54 +1,53 @@ --------------------------------------------------------------------------------------------- -- Policy: AppID Management common module --------------------------------------------------------------------------------------------- +config.defaultProtocolVersion = 2 local common = {} - local commonFunctions = require("user_modules/shared_testcases/commonFunctions") -local policy_file_path = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") -local policy_file_name = "PolicyTableUpdate" - ----------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------------------------------------------ -- The function is used only in case when PTU PROPRIETARY should have as result: UP_TO_DATE -- The funcion will be used when PTU is triggered. --- 1. It is assumed that notification is recevied: EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"}) +-- 1. It is assumed that notification is recevied: +-- EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"}) -- 2. It is assumed that request/response is received: EXPECT_HMICALL("BasicCommunication.PolicyUpdate", -- 3. Function will use default endpoints --- Difference with PROPRIETARY flow is clarified in "Can you clarify is PTU flows for External_Proprietary and Proprietary have differences?" +-- Difference with PROPRIETARY flow is clarified in "Can you clarify is PTU flows for External_Proprietary +-- and Proprietary have differences?" -- But this should be checked in appropriate scripts --TODO(istoimenova): functions with External_Proprietary should be merged at review of common functions. function common:updatePolicyTable(test, file) EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", { status = "UPDATING" }, { status = "UP_TO_DATE" }):Times(2) local requestId = test.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(requestId, {result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) - :Do(function(_, _) - test.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = policy_file_name }) - + EXPECT_HMIRESPONSE(requestId, { + result = { + code = 0, + method = "SDL.GetURLS", + urls = { + { + url = "http://policies.telematics.ford.com/api/policies" + } + } + } + }) + :Do(function() + local pts_file_name = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" + .. commonFunctions:read_parameter_from_smart_device_link_ini("PathToSnapshot") + test.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { + requestType = "PROPRIETARY", + fileName = pts_file_name + }) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) - :Do(function(_, _) - - local corIdSystemRequest = test.mobileSession:SendRPC("SystemRequest", - { - requestType = "PROPRIETARY", - fileName = policy_file_name - }, - file) - EXPECT_HMICALL("BasicCommunication.SystemRequest",{requestType = "PROPRIETARY", fileName = policy_file_path.."/"..policy_file_name },file) + :Do(function() + local corIdSystemRequest = test.mobileSession:SendRPC("SystemRequest", { requestType = "PROPRIETARY" }, file) + EXPECT_HMICALL("BasicCommunication.SystemRequest",{ requestType = "PROPRIETARY" }, file) :Do(function(_, data) - test.hmiConnection:SendResponse(data.id, "BasicCommunication.SystemRequest", "SUCCESS", {}) - test.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", - { - policyfile = policy_file_path.."/"..policy_file_name - } - ) + test.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) + test.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { policyfile = data.params.fileName } ) end) - EXPECT_RESPONSE(corIdSystemRequest, { success = true, resultCode = "SUCCESS"}) - :Do(function(_, _) - -- requestId = test.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"StatusUpToDate"}}) - -- EXPECT_HMIRESPONSE(requestId) - end) + EXPECT_HMICALL("VehicleInfo.GetVehicleData", { odometer = true }) end) end) diff --git a/user_modules/shared_testcases/testCasesForPolicyTable.lua b/user_modules/shared_testcases/testCasesForPolicyTable.lua index 034be71792..d963347be5 100644 --- a/user_modules/shared_testcases/testCasesForPolicyTable.lua +++ b/user_modules/shared_testcases/testCasesForPolicyTable.lua @@ -3,6 +3,7 @@ --1. local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') --2. testCasesForPolicyTable:createPolicyTableWithoutAPI() --------------------------------------------------------------------------------------------- +config.defaultProtocolVersion = 2 local testCasesForPolicyTable = {} local commonFunctions = require('user_modules/shared_testcases/commonFunctions') @@ -939,6 +940,7 @@ function testCasesForPolicyTable:flow_SUCCEESS_EXTERNAL_PROPRIETARY(self, app_id self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { policyfile = SystemFilesPath..ptu_file_name}) end) EXPECT_RESPONSE(CorIdSystemRequest, { success = true, resultCode = "SUCCESS"}) + EXPECT_HMICALL("VehicleInfo.GetVehicleData", { odometer = true }) end) end) end From 69ef8f239a04acb1e8a3fb79a63f8fcf2e1ca51f Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Wed, 28 Feb 2018 18:04:42 +0200 Subject: [PATCH 12/30] Stabilize scripts --- ...007_ATF_StealFocus_validation_true_PTU.lua | 32 +++------ ..._ATF_Sending_PTS_to_mobile_application.lua | 6 +- .../145_ATF_PTU_Merge_Into_LPT.lua | 46 ++++++------- ...TU_Merge_Of_Consumer_Friendly_Messages.lua | 19 ++---- ...ot_From_Sync_After_Getting_The_Updates.lua | 38 ++--------- ...F_OnAppPermissionConsent_without_appID.lua | 17 ++--- ...Applying_Heart_Beat_Timeout_Ms_From_PT.lua | 53 ++++++--------- ...plying_Heart_Beat_Timeout_Ms_After_PTU.lua | 67 ++++++------------- ...App_Interface_Assign_Existing_Policies.lua | 19 +----- ..._ATF_HP_Device_Data_Section_Validation.lua | 1 - ...207_ATF_HMILevel_before_data_consented.lua | 2 +- 11 files changed, 99 insertions(+), 201 deletions(-) diff --git a/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua b/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua index 28f7e19f88..3de843ae31 100644 --- a/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua +++ b/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua @@ -94,37 +94,27 @@ function Test:Precondition_DeactivateApp() end function Test:Preconditions_Update_Policy_With_Steal_Focus_FalseValue_for_Current_App() + local pts_file_name = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" + .. commonFunctions:read_parameter_from_smart_device_link_ini("PathToSnapshot") + EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", { status = "UPDATING" }, { status = "UP_TO_DATE" }):Times(2) local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) :Do(function() - self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", - { + self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", - fileName = "filename" + fileName = pts_file_name } ) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) :Do(function() - local CorIdSystemRequest = self.mobileSession:SendRPC("SystemRequest", - { - fileName = "PolicyTableUpdate", - requestType = "PROPRIETARY" - }, "files/ptu_general_steal_focus_true.json") - local systemRequestId + local CorIdSystemRequest = self.mobileSession:SendRPC("SystemRequest", { + requestType = "PROPRIETARY" }, "files/ptu_general_steal_focus_true.json") EXPECT_HMICALL("BasicCommunication.SystemRequest") - :Do(function(_,data) - systemRequestId = data.id - self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", - { - policyfile = "/tmp/fs/mp/images/ivsu_cache/PolicyTableUpdate" - }) - local function to_run() - self.hmiConnection:SendResponse(systemRequestId,"BasicCommunication.SystemRequest", "SUCCESS", {}) - end - RUN_AFTER(to_run, 800) - self.mobileSession:ExpectResponse(CorIdSystemRequest, {success = true, resultCode = "SUCCESS"}) - EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UP_TO_DATE"}) + :Do(function(_, data) + self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { policyfile = data.params.fileName }) + self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) end) + self.mobileSession:ExpectResponse(CorIdSystemRequest, { success = true, resultCode = "SUCCESS" }) end) end) end diff --git a/test_scripts/Policies/Policy_Table_Update/137_ATF_Sending_PTS_to_mobile_application.lua b/test_scripts/Policies/Policy_Table_Update/137_ATF_Sending_PTS_to_mobile_application.lua index 960782d3db..8fa77b7d2c 100644 --- a/test_scripts/Policies/Policy_Table_Update/137_ATF_Sending_PTS_to_mobile_application.lua +++ b/test_scripts/Policies/Policy_Table_Update/137_ATF_Sending_PTS_to_mobile_application.lua @@ -39,6 +39,8 @@ Test = require("user_modules/connecttest_resumption") require('cardinalities') require('user_modules/AppTypes') +local HMIAppID + --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") @@ -59,7 +61,7 @@ function Test:RAI() EXPECT_HMINOTIFICATION("BasicCommunication.OnAppRegistered", { application = { appName = config.application1.registerAppInterfaceParams.appName } }) :Do( function(_, d1) - self.applications[config.application1.registerAppInterfaceParams.appID] = d1.params.application.appID + HMIAppID = d1.params.application.appID end) self.mobileSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) :Do( @@ -74,7 +76,7 @@ end commonFunctions:newTestCasesGroup("Test") function Test:Trigger_getting_device_consent() - local requestId1 = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appID] }) + local requestId1 = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = HMIAppID }) EXPECT_HMIRESPONSE(requestId1) :Do( function(_, d1) diff --git a/test_scripts/Policies/Policy_Table_Update/145_ATF_PTU_Merge_Into_LPT.lua b/test_scripts/Policies/Policy_Table_Update/145_ATF_PTU_Merge_Into_LPT.lua index a902233c9c..97da3c8321 100644 --- a/test_scripts/Policies/Policy_Table_Update/145_ATF_PTU_Merge_Into_LPT.lua +++ b/test_scripts/Policies/Policy_Table_Update/145_ATF_PTU_Merge_Into_LPT.lua @@ -156,32 +156,26 @@ function Test:TestStep_RegisterNewApp() end function Test:TestStep_ValidateResult() - self.mobileSession:ExpectAny() - :ValidIf(function(_, _) - local pts = json_to_table(policy_file_path .. "/sdl_snapshot.json") - local ptu = json_to_table(ptu_file) - -- Reconcile expected vs actual - ptu.policy_table.module_config.preloaded_pt = false - ptu.policy_table.app_policies["0000002"] = "default" - - -- Compare - if not is_table_equal(ptu.policy_table.functional_groupings, pts.policy_table.functional_groupings) then - return false, "Diffs in functional_groupings\nExpected:\n" .. commonFunctions:convertTableToString(ptu.policy_table.functional_groupings, 1) .. "\nActual:\n" .. commonFunctions:convertTableToString(pts.policy_table.functional_groupings, 1) - end - if not is_table_equal(ptu.policy_table.module_config, pts.policy_table.module_config) then - return false, "Diffs in module_config\nExpected:\n" .. commonFunctions:convertTableToString(ptu.policy_table.module_config, 1) .. "\nActual:\n" .. commonFunctions:convertTableToString(pts.policy_table.module_config, 1) - end - -- Section app_policies verified for '0000001' app only - if not is_table_equal(ptu.policy_table.app_policies["0000001"], pts.policy_table.app_policies["0000001"]) then - return false, "Diffs in app_policies\nExpected:\n" .. commonFunctions:convertTableToString(ptu.policy_table.app_policies["0000001"], 1) .. "\nActual:\n" .. commonFunctions:convertTableToString(pts.policy_table.app_policies["0000001"], 1) - end - -- Section app_policies verified for '0000002' app only - if not is_table_equal(ptu.policy_table.app_policies["0000002"], pts.policy_table.app_policies["0000002"]) then - return false, "Diffs in app_policies\nExpected:\n" .. commonFunctions:convertTableToString(ptu.policy_table.app_policies["0000002"], 1) .. "\nActual:\n" .. commonFunctions:convertTableToString(pts.policy_table.app_policies["0000002"], 1) - end - return true - end) - :Times(1) + local pts = json_to_table(policy_file_path .. "/sdl_snapshot.json") + local ptu = json_to_table(ptu_file) + -- Reconcile expected vs actual + ptu.policy_table.module_config.preloaded_pt = false + ptu.policy_table.app_policies["0000002"] = "default" + -- Compare + if not is_table_equal(ptu.policy_table.functional_groupings, pts.policy_table.functional_groupings) then + self:FailTestCase("Diffs in functional_groupings\nExpected:\n" .. commonFunctions:convertTableToString(ptu.policy_table.functional_groupings, 1) .. "\nActual:\n" .. commonFunctions:convertTableToString(pts.policy_table.functional_groupings, 1)) + end + if not is_table_equal(ptu.policy_table.module_config, pts.policy_table.module_config) then + self:FailTestCase("Diffs in module_config\nExpected:\n" .. commonFunctions:convertTableToString(ptu.policy_table.module_config, 1) .. "\nActual:\n" .. commonFunctions:convertTableToString(pts.policy_table.module_config, 1)) + end + -- Section app_policies verified for '0000001' app only + if not is_table_equal(ptu.policy_table.app_policies["0000001"], pts.policy_table.app_policies["0000001"]) then + self:FailTestCase("Diffs in app_policies\nExpected:\n" .. commonFunctions:convertTableToString(ptu.policy_table.app_policies["0000001"], 1) .. "\nActual:\n" .. commonFunctions:convertTableToString(pts.policy_table.app_policies["0000001"], 1)) + end + -- Section app_policies verified for '0000002' app only + if not is_table_equal(ptu.policy_table.app_policies["0000002"], pts.policy_table.app_policies["0000002"]) then + self:FailTestCase("Diffs in app_policies\nExpected:\n" .. commonFunctions:convertTableToString(ptu.policy_table.app_policies["0000002"], 1) .. "\nActual:\n" .. commonFunctions:convertTableToString(pts.policy_table.app_policies["0000002"], 1)) + end end --[[ Postconditions ]] diff --git a/test_scripts/Policies/Policy_Table_Update/152_ATF_PTU_Merge_Of_Consumer_Friendly_Messages.lua b/test_scripts/Policies/Policy_Table_Update/152_ATF_PTU_Merge_Of_Consumer_Friendly_Messages.lua index cfd5898c56..db62a28063 100644 --- a/test_scripts/Policies/Policy_Table_Update/152_ATF_PTU_Merge_Of_Consumer_Friendly_Messages.lua +++ b/test_scripts/Policies/Policy_Table_Update/152_ATF_PTU_Merge_Of_Consumer_Friendly_Messages.lua @@ -127,18 +127,13 @@ function Test:TestStep_RegisterNewApp() self.mobileSession2:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) end -function Test.TestStep_ValidateResultAfterPTU() - EXPECT_ANY() - :ValidIf(function(_, _) - local r_expected = { "1|TTS1|LABEL|LINE1|LINE2|TEXTBODY|en-us|AppPermissions", "2|TTS2|||||en-us|AppPermissionsHelp" } - local query = "select id, tts, label, line1, line2, textBody, language_code, message_type_name from message" - local r_actual = commonFunctions:get_data_policy_sql(config.pathToSDL.."/storage/policy.sqlite", query) - if not is_table_equal(r_expected, r_actual) then - return false, "\nExpected:\n" .. commonFunctions:convertTableToString(r_expected, 1) .. "\nActual:\n" .. commonFunctions:convertTableToString(r_actual, 1) - end - return true - end) - :Times(1) +function Test:TestStep_ValidateResultAfterPTU() + local r_expected = { "1|TTS1|LABEL|LINE1|LINE2|TEXTBODY|en-us|AppPermissions", "2|TTS2|||||en-us|AppPermissionsHelp" } + local query = "select id, tts, label, line1, line2, textBody, language_code, message_type_name from message" + local r_actual = commonFunctions:get_data_policy_sql(config.pathToSDL.."/storage/policy.sqlite", query) + if not is_table_equal(r_expected, r_actual) then + self:FailTestCase("\nExpected:\n" .. commonFunctions:convertTableToString(r_expected, 1) .. "\nActual:\n" .. commonFunctions:convertTableToString(r_actual, 1)) + end end --[[ Postconditions ]] diff --git a/test_scripts/Policies/Policy_Table_Update/154_ATF_PTU_SDL_Must_Remove_PTU_File_Got_From_Sync_After_Getting_The_Updates.lua b/test_scripts/Policies/Policy_Table_Update/154_ATF_PTU_SDL_Must_Remove_PTU_File_Got_From_Sync_After_Getting_The_Updates.lua index ed1eb4ccae..6defb13cc3 100644 --- a/test_scripts/Policies/Policy_Table_Update/154_ATF_PTU_SDL_Must_Remove_PTU_File_Got_From_Sync_After_Getting_The_Updates.lua +++ b/test_scripts/Policies/Policy_Table_Update/154_ATF_PTU_SDL_Must_Remove_PTU_File_Got_From_Sync_After_Getting_The_Updates.lua @@ -28,29 +28,12 @@ local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") --[[ Local Variables ]] --- local r_expected = { true, false } -- Expected file is created and then afterwards is deleted --- local r_actual = { } -local policy_file_name = "PolicyTableUpdate" +local policy_file_name = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" + .. commonFunctions:read_parameter_from_smart_device_link_ini("PathToSnapshot") local policy_file_path = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") local ptu_file = "files/jsons/Policies/Policy_Table_Update/ptu_19168.json" --[[ Local Functions ]] --- local function is_table_equal(t1, t2) --- local ty1 = type(t1) --- local ty2 = type(t2) --- if ty1 ~= ty2 then return false end --- if ty1 ~= 'table' and ty2 ~= 'table' then return t1 == t2 end --- for k1, v1 in pairs(t1) do --- local v2 = t2[k1] --- if v2 == nil or not is_table_equal(v1, v2) then return false end --- end --- for k2, v2 in pairs(t2) do --- local v1 = t1[k2] --- if v1 == nil or not is_table_equal(v1, v2) then return false end --- end --- return true --- end - local function check_file_exists(name) local f = io.open(name, "r") if f ~= nil then @@ -103,23 +86,16 @@ function Test:TestStep_PTU_Success_PTUfile_removed() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = policy_file_name }) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) :Do(function(_, _) - local corIdSystemRequest = self.mobileSession:SendRPC("SystemRequest", { requestType = "PROPRIETARY", fileName = policy_file_name }, ptu_file) + local corIdSystemRequest = self.mobileSession:SendRPC("SystemRequest", { requestType = "PROPRIETARY" }, ptu_file) EXPECT_HMICALL("BasicCommunication.SystemRequest") :Do(function(_, data) - self.hmiConnection:SendResponse(data.id, "BasicCommunication.SystemRequest", "SUCCESS", { }) - --table.insert(r_actual, check_file_exists(policy_file_path .. "/" .. policy_file_name)) - self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { policyfile = policy_file_path .. "/" .. policy_file_name }) + self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", { }) + self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { policyfile = data.params.fileName }) end) EXPECT_RESPONSE(corIdSystemRequest, { success = true, resultCode = "SUCCESS" }) - :Do(function(_, _) - --table.insert(r_actual, check_file_exists(policy_file_path .. "/" .. policy_file_name)) - requestId = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", { language = "EN-US", messageCodes = { "StatusUpToDate" } }) - EXPECT_HMIRESPONSE(requestId) - end) end) end) - EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", - {status = "UPDATING"}, {status = "UP_TO_DATE"}):Times(2) + EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATING"}, {status = "UP_TO_DATE"}):Times(2) :Do(function(_,data) if(data.params.status == "UP_TO_DATE") then local result = check_file_exists(policy_file_path .. "/" .. policy_file_name) @@ -136,4 +112,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Related_HMI_API/178_ATF_OnAppPermissionConsent_without_appID.lua b/test_scripts/Policies/Related_HMI_API/178_ATF_OnAppPermissionConsent_without_appID.lua index 840f3ecd28..19a135d269 100644 --- a/test_scripts/Policies/Related_HMI_API/178_ATF_OnAppPermissionConsent_without_appID.lua +++ b/test_scripts/Policies/Related_HMI_API/178_ATF_OnAppPermissionConsent_without_appID.lua @@ -72,17 +72,19 @@ function Test:TestStep_User_consent_on_activate_app() local groups = {} if #data.result.allowedFunctions > 0 then for i = 1, #data.result.allowedFunctions do + print(data.result.allowedFunctions[i].name) groups[i] = { name = data.result.allowedFunctions[i].name, id = data.result.allowedFunctions[i].id, allowed = true} end end - self.hmiConnection:SendNotification("SDL.OnAppPermissionConsent", { consentedFunctions = groups, source = "GUI"}) + self.hmiConnection:SendNotification("SDL.OnAppPermissionConsent", { + consentedFunctions = groups, + source = "GUI", + appID = self.applications[config.application1.registerAppInterfaceParams.appName] + }) EXPECT_NOTIFICATION("OnPermissionsChange") - :Do(function(_,_) - - end) end) end) @@ -92,13 +94,12 @@ function Test:TestStep_User_consent_on_activate_app() end function Test:TestStep_check_LocalPT_for_updates() - local is_test_fail = false - self.hmiConnection:SendRequest("SDL.UpdateSDL", {} ) - - EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"}) + local RequestId = self.hmiConnection:SendRequest("SDL.UpdateSDL", {} ) + EXPECT_HMIRESPONSE(RequestId, { result = { result = "UPDATE_NEEDED" }}) EXPECT_HMICALL("BasicCommunication.PolicyUpdate",{}) :Do(function(_,data) + local is_test_fail = false local app_consent_location = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Location-1") local app_consent_notifications = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Notifications") diff --git a/test_scripts/Policies/Validation_of_PolicyTables/300_ATF_HP_Applying_Heart_Beat_Timeout_Ms_From_PT.lua b/test_scripts/Policies/Validation_of_PolicyTables/300_ATF_HP_Applying_Heart_Beat_Timeout_Ms_From_PT.lua index 93942d4af6..80af820cdd 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/300_ATF_HP_Applying_Heart_Beat_Timeout_Ms_From_PT.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/300_ATF_HP_Applying_Heart_Beat_Timeout_Ms_From_PT.lua @@ -20,8 +20,6 @@ --[[ General configuration parameters ]] config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" ---Heartbeat is supported after protocolversion 3 ---config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') @@ -29,10 +27,12 @@ local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') +--Heartbeat is supported after protocolversion 3 +config.defaultProtocolVersion = 3 + --[[ Local Variables ]] local HBTime_max = 0 local HBTime_min = 0 -local eventHB --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -67,25 +67,9 @@ end function Test:Precondition_StartSession() self.mobileSession = mobile_session.MobileSession(self, self.mobileConnection) self.mobileSession.sendHeartbeatToSDL = false - self.mobileSession.answerHeartbeatFromSDL = true - - eventHB = events.Event() - eventHB.matches = function(_, data) - return data.frameType == 0 and - (data.serviceType == 0) and - (data.frameInfo == 0) --HeartBeat - end - self.mobileSession:StartRPC(function () - self.mobileSession:ExpectEvent(eventHB, "Heartbeat") - :Do(function() - - self.mobileSession:Send( - { frameType = constants.FRAME_TYPE.CONTROL_FRAME, - serviceType = constants.SERVICE_TYPE.CONTROL, - frameInfo = constants.FRAME_INFO.HEARTBEAT_ACK } ) - end):Times(AnyNumber()) - end) - end + self.mobileSession.ignoreSDLHeartBeatACK = true + self.mobileSession:StartRPC() +end function Test:Precondition_Register_App_With_heart_beat_timeout_ms_Param() local correlationId = self.mobileSession:SendRPC("RegisterAppInterface", config.application1.registerAppInterfaceParams) @@ -102,6 +86,14 @@ function Test:TestStep_Get_HeartBeat_Time() local time_prev = 0 local time_now = 0 + local eventHB = events.Event() + eventHB.level = 3 + eventHB.matches = function(_, data) + return data.frameType == 0 and + (data.serviceType == 0) and + (data.frameInfo == 0) --HeartBeat + end + self.mobileSession:ExpectEvent(eventHB, "Heartbeat") :ValidIf(function() print("HeartBeat received in "..atf_logger.formated_time(true)) @@ -133,18 +125,11 @@ function Test:TestStep_Get_HeartBeat_Time() end function Test:TestStep_Check_HB_Time() - -- Send request to bind ValidIf for HB time validation - self.mobileSession:SendRPC("UnregisterAppInterface", {}) - EXPECT_RESPONSE("UnregisterAppInterface", {success = true , resultCode = "SUCCESS"}) - :ValidIf(function() - if ( (HBTime_min < 3850) or (HBTime_max > 4150) ) then - print("Wrong HearBeat time! Expected: 4000ms, Actual: ["..HBTime_min.." ; "..HBTime_max.."]ms ") - return false - else - print(" HearBeat is in range ["..HBTime_min.." ; "..HBTime_max.."]ms ") - return true - end - end) + if ( (HBTime_min < 3850) or (HBTime_max > 4150) ) then + self:FailTestCase("Wrong HearBeat time! Expected: 4000ms, Actual: ["..HBTime_min.." ; "..HBTime_max.."]ms ") + else + print("HearBeat is in range ["..HBTime_min.." ; "..HBTime_max.."]ms ") + end end --[[ Postconditions ]] diff --git a/test_scripts/Policies/Validation_of_PolicyTables/302_ATF_HP_Applying_Heart_Beat_Timeout_Ms_After_PTU.lua b/test_scripts/Policies/Validation_of_PolicyTables/302_ATF_HP_Applying_Heart_Beat_Timeout_Ms_After_PTU.lua index f79db4991d..f03fda6e25 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/302_ATF_HP_Applying_Heart_Beat_Timeout_Ms_After_PTU.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/302_ATF_HP_Applying_Heart_Beat_Timeout_Ms_After_PTU.lua @@ -21,8 +21,6 @@ --[[ General configuration parameters ]] config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" ---Heartbeat is supported after protocolversion 3 ---config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') @@ -30,12 +28,13 @@ local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') +--Heartbeat is supported after protocolversion 3 +config.defaultProtocolVersion = 3 + --[[ Local Variables ]] local HBTime_max = 0 local HBTime_min = 0 -local eventHB - --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() commonPreconditions:Connecttest_without_ExitBySDLDisconnect_WithoutOpenConnectionRegisterApp("connecttest_ConnectMobile.lua") @@ -68,24 +67,8 @@ end function Test:Precondition_StartSession() self.mobileSession = mobile_session.MobileSession(self, self.mobileConnection) self.mobileSession.sendHeartbeatToSDL = false - self.mobileSession.answerHeartbeatFromSDL = true - - eventHB = events.Event() - eventHB.matches = function(_, data) - return data.frameType == 0 and - (data.serviceType == 0) and - (data.frameInfo == 0) --HeartBeat - end - - self.mobileSession:StartRPC(function () - self.mobileSession:ExpectEvent(eventHB, "Heartbeat") - :Do(function() - self.mobileSession:Send( - { frameType = constants.FRAME_TYPE.CONTROL_FRAME, - serviceType = constants.SERVICE_TYPE.CONTROL, - frameInfo = constants.FRAME_INFO.HEARTBEAT_ACK } ) - end):Times(AnyNumber()) - end) + self.mobileSession.ignoreSDLHeartBeatACK = true + self.mobileSession:StartRPC() end function Test:Precondition_RegisterApp() @@ -100,12 +83,6 @@ function Test:Precondition_RegisterApp() end function Test:Precondition_Activate_Consent_App() - self.mobileSession:ExpectEvent(eventHB, "Heartbeat"):Do(function() - self.mobileSession:Send( - { frameType = constants.FRAME_TYPE.CONTROL_FRAME, - serviceType = constants.SERVICE_TYPE.CONTROL, - frameInfo = constants.FRAME_INFO.HEARTBEAT_ACK } ) - end):Times(AnyNumber()) testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) end @@ -116,17 +93,10 @@ end function Test:Precondition_HMI_sends_OnAllowSDLFunctionality() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = false, source = "GUI"}) - self.mobileSession:ExpectNotification("OnPermissionsChange") + -- self.mobileSession:ExpectNotification("OnPermissionsChange") -- not allowed by Policies end function Test:Precondition_Check_App_PreDataConsent() - self.mobileSession:ExpectEvent(eventHB, "Heartbeat"):Do(function() - self.mobileSession:Send( - { frameType = constants.FRAME_TYPE.CONTROL_FRAME, - serviceType = constants.SERVICE_TYPE.CONTROL, - frameInfo = constants.FRAME_INFO.HEARTBEAT_ACK } ) - end):Times(AnyNumber()) - local cid = self.mobileSession:SendRPC("AddCommand", { cmdID = 1, menuParams = { parentID = 0, position = 0, menuName ="Commandpositive1" }, @@ -144,6 +114,14 @@ function Test:TestStep_Get_HeartBeat_Time() local time_prev = 0 local time_now = 0 + local eventHB = events.Event() + eventHB.level = 3 + eventHB.matches = function(_, data) + return data.frameType == 0 and + (data.serviceType == 0) and + (data.frameInfo == 0) --HeartBeat + end + self.mobileSession:ExpectEvent(eventHB, "Heartbeat") :ValidIf(function() print("HeartBeat received in "..atf_logger.formated_time(true)) @@ -173,18 +151,11 @@ function Test:TestStep_Get_HeartBeat_Time() end function Test:TestStep_Check_HB_Time() - -- Send request to bind ValidIf for HB time validation - self.mobileSession:SendRPC("UnregisterAppInterface", {}) - EXPECT_RESPONSE("UnregisterAppInterface", {success = true , resultCode = "SUCCESS"}) - :ValidIf(function() - if ( (HBTime_min < 3850) or (HBTime_max > 4150) ) then - print("Wrong HearBeat time! Expected: 4000ms, Actual: ["..HBTime_min.." ; "..HBTime_max.."]ms ") - return false - else - print(" HearBeat is in range ["..HBTime_min.." ; "..HBTime_max.."]ms ") - return true - end - end) + if ( (HBTime_min < 3850) or (HBTime_max > 4150) ) then + self:FailTestCase("Wrong HearBeat time! Expected: 4000ms, Actual: ["..HBTime_min.." ; "..HBTime_max.."]ms ") + else + print("HearBeat is in range ["..HBTime_min.." ; "..HBTime_max.."]ms ") + end end --[[ Postconditions ]] diff --git a/test_scripts/Policies/appID_Management/037_ATF_Register_App_Interface_Assign_Existing_Policies.lua b/test_scripts/Policies/appID_Management/037_ATF_Register_App_Interface_Assign_Existing_Policies.lua index c6c57c3f05..c8ae092178 100644 --- a/test_scripts/Policies/appID_Management/037_ATF_Register_App_Interface_Assign_Existing_Policies.lua +++ b/test_scripts/Policies/appID_Management/037_ATF_Register_App_Interface_Assign_Existing_Policies.lua @@ -66,6 +66,7 @@ function Test:RegisterNewApp() EXPECT_HMINOTIFICATION("BasicCommunication.OnAppRegistered", { application = { appName = "ABC Application" }}) self.mobileSession2:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) self.mobileSession2:ExpectNotification("OnHMIStatus", { hmiLevel = "NONE" }) + EXPECT_HMICALL("BasicCommunication.PolicyUpdate") end function Test:CheckPermissions() @@ -79,23 +80,7 @@ function Test:CheckPermissions() end function Test:UpdatePolicy() - local timeout_after_x_seconds = testCasesForPolicyTableSnapshot:get_data_from_Preloaded_PT("module_config.timeout_after_x_seconds") - local seconds_between_retries = {} - for i = 1, #testCasesForPolicyTableSnapshot.seconds_between_retries do - seconds_between_retries[i] = testCasesForPolicyTableSnapshot.seconds_between_retries[i].value - end - - EXPECT_HMICALL("BasicCommunication.PolicyUpdate", - { - file = "/tmp/fs/mp/images/ivsu_cache/sdl_snapshot.json", - timeout = timeout_after_x_seconds, - retry = seconds_between_retries - }) - :Do(function(_,data1) - self.hmiConnection:SendResponse(data1.id, data1.method, "SUCCESS", {}) - testCasesForPolicyAppIdManagament:updatePolicyTable(self, "files/jsons/Policies/appID_Management/ptu_01.json") - end) - --testCasesForPolicyAppIdManagament:updatePolicyTable(self, "files/jsons/Policies/appID_Management/ptu_01.json") + testCasesForPolicyAppIdManagament:updatePolicyTable(self, "files/jsons/Policies/appID_Management/ptu_01.json") end function Test:CheckPermissions() diff --git a/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua b/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua index 21dd9d24d0..7637d1dcd4 100644 --- a/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua +++ b/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua @@ -163,7 +163,6 @@ function Test:Precondition_Activate_App_Consent_Device_Make_PTU_Consent_Group() end) end) end) - EXPECT_NOTIFICATION("OnPermissionsChange", {}) end ) :Timeout(500) diff --git a/test_scripts/Policies/user_consent_of_Policies/207_ATF_HMILevel_before_data_consented.lua b/test_scripts/Policies/user_consent_of_Policies/207_ATF_HMILevel_before_data_consented.lua index e82272e6fa..17dcf32412 100644 --- a/test_scripts/Policies/user_consent_of_Policies/207_ATF_HMILevel_before_data_consented.lua +++ b/test_scripts/Policies/user_consent_of_Policies/207_ATF_HMILevel_before_data_consented.lua @@ -74,7 +74,7 @@ function Test:ActivateApp_on_unconsented_device() end) end end) - EXPECT_HMICALL("BasicCommunication.ActivateApp",{}) :Times(0) + EXPECT_HMICALL("BasicCommunication.ActivateApp",{ level = "NONE" }):Times(1) EXPECT_NOTIFICATION("OnHMIStatus", {}):Times(0) end From fe604369ae3f4e2cdec7ba31807a145fcff08dc8 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Fri, 2 Mar 2018 11:44:02 +0200 Subject: [PATCH 13/30] Correct expectation function and common module for certificates --- .../4_5/Trigger_PTU_NO_Certificate/common.lua | 16 ++++------------ user_modules/sequences/actions.lua | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua index aaced0218f..e4698b5e8a 100644 --- a/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua +++ b/test_scripts/Defects/4_5/Trigger_PTU_NO_Certificate/common.lua @@ -10,24 +10,16 @@ local security = require("user_modules/sequences/security") local utils = require("user_modules/utils") --[[ Module ]] -local m = {} +local m = actions --- Proxies for the inherited objects -utils.inheritObjects(m, actions) -utils.inheritObjects(m, security) +m.frameInfo = security.frameInfo +m.delayedExp = utils.wait +m.readFile = utils.readFile function m.setForceProtectedServiceParam(pParamValue) m.setSDLIniParameter("ForceProtectedService", pParamValue) end -function m.delayedExp(pTimeOut) - utils.wait(pTimeOut) -end - -function m.readFile(pFilePath) - return utils.readFile(pFilePath) -end - function m.getAppID(pAppId) return m.getConfigAppParams(pAppId).appID end diff --git a/user_modules/sequences/actions.lua b/user_modules/sequences/actions.lua index 5be21e543c..23687cf56f 100644 --- a/user_modules/sequences/actions.lua +++ b/user_modules/sequences/actions.lua @@ -362,7 +362,7 @@ function test.hmiConnection:ExpectResponse(pId, ...) end reporter.AddMessage("EXPECT_HMIRESPONSE", { ["Id"] = data.id, ["Type"] = "EXPECTED_RESULT" }, arguments) reporter.AddMessage("EXPECT_HMIRESPONSE", { ["Id"] = data.id, ["Type"] = "AVAILABLE_RESULT" }, data.result) - return compareValues(arguments, data.result, "result") + return compareValues(arguments, data, "data") end) end ret.event = event From c98e17a4fe575b8fd625266418bb5cf036aafd8d Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Wed, 14 Mar 2018 13:49:45 +0200 Subject: [PATCH 14/30] Remove defaulting of 2nd version of SDL protocol --- user_modules/shared_testcases/commonTestCases.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/user_modules/shared_testcases/commonTestCases.lua b/user_modules/shared_testcases/commonTestCases.lua index 20c61d34ab..d0094fa533 100644 --- a/user_modules/shared_testcases/commonTestCases.lua +++ b/user_modules/shared_testcases/commonTestCases.lua @@ -7,7 +7,6 @@ local commonTestCases = {} local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') -local policyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local mobile_session = require('mobile_session') local events = require('events') From fe3ec30e32395df1473f75f6508e1622754fecd7 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Fri, 16 Mar 2018 09:38:08 +0200 Subject: [PATCH 15/30] Update Policy scripts regarding Device Id and Device Name calculation logic --- .../Policies/ATF_Preloaded_PT_validation.lua | 219 +++++++++--------- ...sponse_Notification_On_Registering_App.lua | 11 +- ...Assigned_Policy_After_App_Registration.lua | 11 +- .../003_ATF_HP_User_Consent_Yes.lua | 12 +- .../004_ATF_HP_User_Consent_NO.lua | 12 +- ...Id_policies_And_RequestType_Validation.lua | 14 +- ...6_ATF_Steal_focus_validation_false_PTU.lua | 9 +- ...007_ATF_StealFocus_validation_true_PTU.lua | 9 +- ...lt_policies_And_RequestType_Validation.lua | 5 +- .../009_ATF_Steal_Focus_Validation_False.lua | 4 +- ..._ATF_StealFocus_validation_true_app_id.lua | 4 +- .../011_ATF_KeepContext_Validation_false.lua | 4 +- .../012_ATF_KeepContext_Validation_true.lua | 4 +- ...tted_In_The_Policy_Table_Default_Group.lua | 7 +- ...t_Of_Parameters_Disallowed_By_Policies.lua | 7 +- ...ameters_Are_Not_Allowed_In_The_Request.lua | 7 +- ...t_Of_Parameters_Disallowed_By_Policies.lua | 7 +- ...ot-allowed_Parameters_By_Policies_Only.lua | 7 +- ...And_Not-allowed_By_Policies_Parameters.lua | 7 +- ...wed_Rpc_Is_Omitted_In_The_Policy_Table.lua | 6 +- ...vel_Is_Not_Listed_In_Assigned_Policies.lua | 7 +- ...fication_Is_Allowed_To_Be_Processed_In.lua | 7 +- ...ation_To_HMI_In_First_App_Registration.lua | 7 +- ...Default_Priority_Value_Assigned_To_App.lua | 5 +- ...f_Failed_Nickname_Validation_After_PTU.lua | 9 +- ...n_With_AppName_Not_Listed_In_NickNames.lua | 19 +- ...ame_Does_Not_Match_With_Nickname_In_PT.lua | 3 +- .../027_ATF_NickName_Case_Insensitivity.lua | 7 +- ...ation_Before_Duplicate_Name_Validation.lua | 13 +- .../029_ATF_OnPermissionsChange_After_PTU.lua | 5 +- ...030_ATF_Successful_Nickname_Validation.lua | 17 +- ..._external_consent_status_groups_struct.lua | 9 +- ..._external_consent_status_groups_struct.lua | 5 +- ...y_external_consent_entities_off_struct.lua | 2 - ...y_external_consent_entities_off_struct.lua | 2 - ...by_external_consent_entities_on_struct.lua | 2 - ...by_external_consent_entities_on_struct.lua | 2 - ...off_struct_with_invalid_type_of_params.lua | 2 - ..._on_struct_with_invalid_type_of_params.lua | 2 - ..._external_consent_status_groups_struct.lua | 11 +- ..._external_consent_status_groups_struct.lua | 11 +- ...y_external_consent_entities_off_struct.lua | 2 - ...y_external_consent_entities_off_struct.lua | 2 - ...by_external_consent_entities_on_struct.lua | 2 - ...by_external_consent_entities_on_struct.lua | 2 - ..._external_consent_status_groups_struct.lua | 2 - ..._external_consent_status_groups_struct.lua | 13 +- ...y_external_consent_entities_off_struct.lua | 2 - ...y_external_consent_entities_off_struct.lua | 2 - ...by_external_consent_entities_on_struct.lua | 2 - ...by_external_consent_entities_on_struct.lua | 2 - ...off_struct_with_invalid_type_of_params.lua | 2 - ..._on_struct_with_invalid_type_of_params.lua | 2 - ..._external_consent_status_groups_struct.lua | 9 +- ..._external_consent_status_groups_struct.lua | 5 +- ...y_external_consent_entities_off_struct.lua | 2 - ...y_external_consent_entities_off_struct.lua | 2 - ...by_external_consent_entities_on_struct.lua | 2 - ...by_external_consent_entities_on_struct.lua | 2 - ...off_struct_with_invalid_type_of_params.lua | 2 - ..._on_struct_with_invalid_type_of_params.lua | 2 - ...tities_omitted_data_consent_disallowed.lua | 5 +- ..._entities_omitted_user_consent_allowed.lua | 5 +- ...tities_omitted_user_consent_disallowed.lua | 5 +- ...tities_omitted_data_consent_disallowed.lua | 5 +- ..._entities_omitted_user_consent_allowed.lua | 5 +- ...tities_omitted_user_consent_disallowed.lua | 5 +- ..._entities_omitted_user_consent_omitted.lua | 5 +- ..._appID_all_ecs_in_bound_EntitySatus_ON.lua | 7 +- ...pID_all_ecs_upper_bound_EntitySatus_ON.lua | 8 +- ...th_appID_fake_param_cut_EntitySatus_ON.lua | 7 +- ...appID_all_ecs_in_bound_EntitySatus_OFF.lua | 7 +- ...ID_all_ecs_lower_bound_EntitySatus_OFF.lua | 7 +- ...ID_all_ecs_upper_bound_EntitySatus_OFF.lua | 7 +- ...h_appID_fake_param_cut_EntitySatus_OFF.lua | 7 +- ...fPermissions_with_appID_not_stored_ecs.lua | 7 +- ...ermissions_no_appID_stored_ecs_present.lua | 7 +- ...tofPermissions_no_appID_not_stored_ecs.lua | 7 +- ..._no_appID_no_app_registered_stored_ecs.lua | 7 +- ...appID_no_app_registered_not_stored_ecs.lua | 7 +- ...s_no_appID_app_unregistered_stored_ecs.lua | 7 +- ..._appID_app_unregistered_not_stored_ecs.lua | 7 +- ...sing_entity_type_OnAppPermissionChange.lua | 5 +- ...missing_entityID_OnAppPermissionChange.lua | 5 +- ...o_missing_status_OnAppPermissionChange.lua | 8 +- ...param_entityType_OnAppPermissionChange.lua | 5 +- ...d_param_entityID_OnAppPermissionChange.lua | 5 +- ...lid_param_status_OnAppPermissionChange.lua | 5 +- ...PermissionConsent_not_sent_when_no_PTU.lua | 7 +- ...ATF_P_Policies_Performance_Requirement.lua | 5 +- ...TF_PolicyTable_Certificate_EMPTY_value.lua | 9 +- ...NotListed_PT_DeviceConsented_SecondApp.lua | 9 +- ...tSuccessful_AppID_ListedPT_NewIgnCycle.lua | 11 +- .../123_ATF_PTU_DeviceConsent_from_User.lua | 7 +- .../124_ATF_User_requests_PTU.lua | 9 +- .../125_ATF_User_PressButton_HMI_PTU.lua | 9 +- ...usUpdate_UPDATE_NEEDED_new_PTU_request.lua | 7 +- .../127_ATF_PTS_Creation_rule.lua | 10 +- .../128_ATF_PTU_GetURLs.lua | 7 +- ...F_HMI_sends_GetURLs_one_app_registered.lua | 7 +- ...TF_HMI_sends_GetURLs_no_app_registered.lua | 7 +- .../131_ATF_PTS_storage_on_file_system.lua | 8 +- .../132_ATF_Timeout_to_wait_response_PTU.lua | 12 +- .../133_ATF_PTU_retry_timeout_definition.lua | 12 +- ...34_ATF_WiFi_one_application_registered.lua | 9 +- .../135_ATF_PM_sends_PTS_to_HMI.lua | 12 +- .../136_ATF_Define_urls_PTS_will_sent_hmi.lua | 9 +- ..._ATF_Sending_PTS_to_mobile_application.lua | 5 +- ...S_to_app_OnSystemRequest_appID_default.lua | 7 +- ...oliciesManager_changes_status_UPDATING.lua | 7 +- .../140_ATF_timeout_countdown_start.lua | 7 +- ...41_ATF_Got_PTU_from_mobile_application.lua | 7 +- ...esManager_changes_status_to_UP_TO_DATE.lua | 7 +- .../143_ATF_PTU_validation_rules.lua | 11 +- .../144_ATF_PTU_validation_failure.lua | 7 +- .../145_ATF_PTU_Merge_Into_LPT.lua | 6 +- ...Lvl_on_PTU_affected_in_FULL_or_LIMITED.lua | 4 +- ...able_Update_Trigger_After_N_Kilometers.lua | 5 +- ..._on_PTU_affected_in_BACKGROUND_or_NONE.lua | 4 +- ...licy_Table_Update_Trigger_After_N_Days.lua | 5 +- ...tifying_HMI_via_OnAppPermissionChanged.lua | 4 +- ...pply_PTU_and_OnPermissionChange_notify.lua | 6 +- ...TU_Merge_Of_Consumer_Friendly_Messages.lua | 7 +- ...PTU_Omit_Of_Consumer_Friendly_Messages.lua | 6 +- ...ot_From_Sync_After_Getting_The_Updates.lua | 6 +- ...anager_Changes_Status_To_UPDATE_NEEDED.lua | 9 +- .../156_ATF_PTU_OnStatusUpdate_Trigger.lua | 7 +- ...ies_Manager_Changes_Status_To_UPDATING.lua | 8 +- ...s_Manager_Changes_Status_To_UP_TO_DATE.lua | 6 +- ...plication_Taking_Part_In_Policy_Update.lua | 4 +- ...F_Default_Policy_For_The_App_After_PTU.lua | 5 +- ...igger_PTU_While_Another_Is_In_Progress.lua | 5 +- .../162_ATF_Policies_UTF-8_Encoding.lua | 6 +- ...egister_NewApp_not_exist_inLocalPT_PTU.lua | 4 +- ...r_NewApp_not_exist_inLocalPT_FinishPTU.lua | 4 +- ...t_exist_inLocalPT_start_PTU_for_NewApp.lua | 4 +- ...tURLs_one_app_registered_urls_3default.lua | 7 +- ...egistered_urls_3default_not_registered.lua | 7 +- ...pp_registered_urls_3default_registered.lua | 7 +- ..._HMILvl_on_PTU_affected_app_in_LIMITED.lua | 4 +- ...vi_App_Registration_And_No_Certificate.lua | 5 +- ...ATF_Policies_Memory_Allocation_For_PTU.lua | 9 +- ...TF_PTU_request_after_N_ignition_cycles.lua | 4 +- ...unctionality_allowed_false_with_device.lua | 12 +- ...tionality_allowed_false_without_device.lua | 7 +- ...ctionality_allowed_true_without_device.lua | 6 +- ...unctionality_allowed_false_with_device.lua | 17 +- ...Functionality_allowed_true_with_device.lua | 13 +- ...F_OnAppPermissionConsent_without_appID.lua | 10 +- ..._ATF_OnAppPermissionConsent_with_appID.lua | 10 +- ..._language_section_is_absent_in_LocalPT.lua | 6 +- ...yMessage_Language_not_found_in_localPT.lua | 3 - ...F_GetUserFriendlyMessage_with_Language.lua | 3 - ...des_data_consent_prompt_on_HMI_request.lua | 9 +- ...ATF_GetListOfPermissions_without_appID.lua | 9 +- ...85_ATF_GetListOfPermissions_with_appID.lua | 9 +- ...6_ATF_OnPolicyUpdate_initiation_of_PTU.lua | 9 +- ...ATF_Get_Status_Update_Request_from_HMI.lua | 7 +- ...ation_rules_request_type_array_omitted.lua | 5 +- ...quest_type_array_has_one_invalid_value.lua | 5 +- ...pe_array_has_only_one_value_is_invalid.lua | 5 +- ...counts_update_count_sync_out_of_memory.lua | 1 - ...or_counts_update_count_of_sync_reboots.lua | 2 - ...counts_update_count_of_iap_buffer_full.lua | 1 - ...rror_counts_update_minutes_in_hmi_none.lua | 5 +- ...r_counts_update_minutes_in_hmi_limited.lua | 4 +- ...rror_counts_update_minutes_in_hmi_full.lua | 4 +- ...ounts_update_minutes_in_hmi_background.lua | 5 +- ...tion_rules_for_omited_parameters_exist.lua | 1 - ...lidation_rules_for_required_parameters.lua | 3 - ...loaded_pt_exists_with_read_permissions.lua | 4 - .../243_ATF_preloaded_pt_exists.lua | 3 - ...oaded_pt_parameter_trigger_in_local_pt.lua | 9 +- ...requesttype_parameters_all_are_invalid.lua | 2 - ...al_pt_consumer_frendly_messages_exists.lua | 1 - ...onsumer_frendly_messages_do_not_exists.lua | 1 - ...nsumer_frendly_messages_exists_in_both.lua | 1 - ...reloaded_pt_into_local_pt_app_policies.lua | 1 - ...o_local_pt_functional_groupings_exists.lua | 3 +- ...pt_functional_groupings_does_not_exist.lua | 1 - ...t_into_local_pt_usage_and_error_counts.lua | 4 - ...preloaded_pt_into_local_pt_device_data.lua | 10 +- ...erge_preloaded_pt_into_local_pt_launch.lua | 4 - ..._into_local_pt_launch_does_not_changed.lua | 6 +- ...eloaded_pt_into_local_pt_module_config.lua | 3 - .../258_ATF_pt_snapshot_path_is_correct.lua | 6 +- .../259_ATF_pt_snapshot_path_is_incorrect.lua | 1 - ...ocal_pt_from_preloaded_pt_master_reset.lua | 3 - ...lidation_rules_for_optional_parameters.lua | 11 +- ...alidation_rules_for_omitted_parameters.lua | 11 +- ...lidation_rules_for_required_parameters.lua | 11 +- .../264_ATF_pt_snapshot_creation_rule.lua | 9 +- ...ATF_pt_snapshot_storage_on_file_system.lua | 9 +- ...idation_rules_optional_parameters_type.lua | 5 +- ...idation_rules_required_parameters_type.lua | 5 +- ...ATF_pt_update_validation_rules_general.lua | 1 - ...dation_rules_consumer_friendly_message.lua | 7 +- ..._Validate_default_hmi_default_policies.lua | 9 +- ...e_preconsented_groups_default_policies.lua | 9 +- ...2_ATF_Validate_groups_default_policies.lua | 6 +- ...TF_Validate_default_hmi_appId_policies.lua | 7 +- ...F_Validate_appID_and_steal_focus_false.lua | 6 +- ...TF_Validate_appID_and_steal_focus_true.lua | 6 +- ...F_Validate_appID_and_keep_context_true.lua | 6 +- ..._Validate_appID_and_keep_context_false.lua | 6 +- ...278_ATF_Validate_groups_appID_policies.lua | 7 +- ...TF_Store_vin_from_GetVehicleData_in_PT.lua | 1 - ...ition_cycles_since_last_exchange_in_PT.lua | 4 +- ...ition_cycles_since_last_exchange_in_PT.lua | 1 - ...PT_Exchanged_X_Days_After_Epoch_In_PTS.lua | 7 +- ...Store_pt_exchanged_at_odometer_x_in_PT.lua | 4 +- .../284_ATF_Store_wers_country_code_in_PT.lua | 1 - .../285_ATF_Store_language_in_PT.lua | 1 - ...ATF_RAI_ccpu_version_via_GetSystemInfo.lua | 1 - ...ATF_Validate_appHMIType_appID_policies.lua | 6 +- ...ray_preconsented_groups_preDataConsent.lua | 1 - ...lue_preconsented_groups_preDataConsent.lua | 1 - ...nal_preconsented_groups_preDataConsent.lua | 1 - ...lid_preconsented_groups_preDataConsent.lua | 1 - ...2_ATF_Valid_default_hmi_preDataConsent.lua | 1 - ...lidate_default_priority_preDataConsent.lua | 9 +- ...ate_nondefault_priority_preDataConsent.lua | 8 +- ...te_preDataConsent_and_stealFocus_false.lua | 5 +- ...ate_preDataConsent_and_stealFocus_true.lua | 5 +- ...e_preDataConsent_and_keepContext_false.lua | 5 +- ...te_preDataConsent_and_keepContext_true.lua | 5 +- ...299_ATF_Memory_Kb_Constraints_Ignoring.lua | 5 +- ...Applying_Heart_Beat_Timeout_Ms_From_PT.lua | 4 - ...s_update_app_registration_language_vui.lua | 5 +- ...plying_Heart_Beat_Timeout_Ms_After_PTU.lua | 9 +- ...TF_HP_Usage_And_Error_Counts_For_AppID.lua | 6 +- ...HP_Validation_Count_Of_User_Selections.lua | 4 +- ...nt_of_run_attempts_while_revoked_in_PT.lua | 4 +- ..._preDataConsent_RequestType_disallowed.lua | 3 +- ...TF_Check_app_registration_language_gui.lua | 2 - ...ATF_Check_count_of_rejected_rpcs_calls.lua | 3 - ...havior_REQUEST_WHILE_IN_NONE_HMI_LEVEL.lua | 4 +- ...bad_behavior_too_many_pending_requests.lua | 5 +- ...als_for_bad_behavior_too_many_requests.lua | 4 +- ...F_Check_count_of_rpcs_sent_in_hmi_none.lua | 7 +- ...314_ATF_Check_count_of_user_selections.lua | 1 - ...egister_App_Interface_App_Unauthorized.lua | 7 +- ...terface_Successful_Nickname_Validation.lua | 7 +- ...Interface_Order_Of_Nickname_Validation.lua | 7 +- ..._ATF_Register_App_Interface_Disallowed.lua | 7 +- ...nterface_Case-insensitivity_Of_AppName.lua | 9 +- ...036_ATF_Change_Registration_Disallowed.lua | 7 +- ...App_Interface_Assign_Existing_Policies.lua | 7 +- ...onsent_Assign_pre_DataConsent_Policies.lua | 5 +- ...h_Data_Consent_Assign_Default_Policies.lua | 5 +- ..._Interface_Case-insensitivity_Of_AppId.lua | 7 +- ...OnAppPermissionChanged_appRevoked_true.lua | 5 +- ...RAI_with_NULL_policies_RPCs_DISALLOWED.lua | 5 +- ..._Status_Appid_Gets_Null_In_Case_Of_PTU.lua | 5 +- ...MI_Status_Value_Of_AppId_In_PT_Is_Null.lua | 5 +- ...tion_Which_Appid_Does_Not_Exist_In_LPT.lua | 6 +- ..._Application_Which_Appid_Exists_In_LPT.lua | 4 +- ..._DEXTENDED_POLICY_EXTERNAL_PROPRIETARY.lua | 9 +- ...uild_Flag_DEXTENDED_POLICY_PROPRIETARY.lua | 3 +- ...rigger_PTU_failed_previous_IGN_ON_HTTP.lua | 2 - ...Update_Trigger_After_N_Kilometers_HTTP.lua | 5 +- .../052_ATF_PTU_Trigger_IGN_Cycles_HTTP.lua | 2 - ...Table_Update_Trigger_After_N_Days_HTTP.lua | 2 - ...PTU_UPDATE_NEEDED_new_PTU_Request_HTTP.lua | 4 - ...TF_Policy_Table_Snapshot_Creation_HTTP.lua | 4 - ...Several_Apps_Different_HMI_Levels_HTTP.lua | 1 - ...57_ATF_PTS_Define_URL_to_send_PTS_HTTP.lua | 4 - ...I_sends_GetURLs_no_app_registered_HTTP.lua | 7 +- ..._sends_GetURLs_one_app_registered_HTTP.lua | 4 - ..._ATF_Timeout_to_wait_response_PTU_HTTP.lua | 2 - ...Sending_PTS_to_Mobile_Application_HTTP.lua | 4 - ...eout_Countdown_Start_PTU_Response_HTTP.lua | 4 - ...iciesManager_Sets_Status_UPDATING_HTTP.lua | 4 - ...eived_PTU_From_Mobile_Application_HTTP.lua | 1 - .../066_ATF_PTU_Validation_Failure_HTTP.lua | 3 +- ...Manager_Sets_Status_to_UP_TO_DATE_HTTP.lua | 4 - .../068_ATF_PTU_Merge_Into_Local_PT_HTTP.lua | 10 +- ...Local_PT_ConsumerFriendlyMessages_HTTP.lua | 8 +- ..._ConsumerFriendlyMessages_Omitted_HTTP.lua | 27 +-- ...PTU_Local_PT_Start_Retry_Sequence_HTTP.lua | 3 - ..._PTU_PM_Sets_Status_UPDATE_NEEDED_HTTP.lua | 2 - ...equence_Retry_Timeout_Computation_HTTP.lua | 2 - ..._Restarting_Policy_Table_Exchange_HTTP.lua | 78 +++---- ...Sequence_Retry_Timeout_Expiration_HTTP.lua | 2 - ...PermissionChange_Notification_App_HTTP.lua | 4 +- ...PermissionChange_Notification_HMI_HTTP.lua | 1 - ..._Level_Affected_Apps_FULL_LIMITED_HTTP.lua | 1 - ...vel_Affected_Apps_NONE_BACKGROUND_HTTP.lua | 1 - ...atsusUpdate_Trigger_UPDATE_NEEDED_HTTP.lua | 3 - ..._OnStatsusUpdate_Trigger_UPDATING_HTTP.lua | 3 - ...nStatsusUpdate_Trigger_UP_TO_DATE_HTTP.lua | 6 +- .../083_ATF_PTU_UTF8_Encoding_Check_HTTP.lua | 3 - ...ault_Policy_For_The_App_After_PTU_HTTP.lua | 1 - ...PTU_In_Progress_New_App_Registers_HTTP.lua | 2 - .../086_ATF_PTU_Merging_wtih_LPT_HTTP.lua | 4 - ...quence_AppRegistered_PTU_Progress_HTTP.lua | 9 +- ...eivedPolicyUpdate_from_HMI_PROPRIETARY.lua | 3 +- ...nd_GetURLs_Request_fromHMI_PROPRIETARY.lua | 8 +- ..._ATF_For_PTU_use_consented_device_only.lua | 14 +- ...Check_STATUS_UPDATE_NEEDED_PROPRIETARY.lua | 8 +- ...ck_STATUS_vai_USER_Request_PROPRIETARY.lua | 5 +- ...ATF_OnStatusUpdate_Trigger_PROPRIETARY.lua | 2 +- .../094_ATF_PTS_creation_rule_PROPRIETARY.lua | 7 +- ..._exist_inLocalPT_FinishPTU_PROPRIETARY.lua | 1 - ...I_In_Case_PTU_Is_Triggered_PROPRIETARY.lua | 2 - ...gh_The_URLs_During_Retry_Sequence_HTTP.lua | 3 - ...cessful_Even_After_Retry_Strategy_HTTP.lua | 2 - ...I_In_Case_PTU_Is_Triggered_PROPRIETARY.lua | 3 - ..._Apps_Different_HMI_Levels_PROPRIETARY.lua | 2 +- ...101_ATF_SDL_Build_EXTENDED_POLICY_HTTP.lua | 2 - ...TF_Timeout_countdown_start_PROPRIETARY.lua | 4 - ..._Timeout_wait_response_PTU_PROPRIETARY.lua | 4 - ...sfer_OnSystemRequest_toApp_PROPRIETARY.lua | 4 - ...EDED_after_timeout_expired_PROPRIETARY.lua | 2 - ...changes_status_to_UPDATING_PROPRIETARY.lua | 2 +- ...egy_during_previous_IGN_ON_PROPRIETARY.lua | 2 - .../108_ATF_PTU_Trigger_days_PROPRIETARY.lua | 4 +- ...ATF_PTU_Trigger_IGN_cycles_PROPRIETARY.lua | 2 - ...ATF_PTU_Trigger_kilometers_PROPRIETARY.lua | 5 +- ...F_Start_PTU_retry_sequence_PROPRIETARY.lua | 1 - ...temRequest_from_app_to_HMI_PROPRIETARY.lua | 4 - ...temRequest_from_HMI_to_app_PROPRIETARY.lua | 4 - ..._exist_inLocalPT_FinishPTU_PROPRIETARY.lua | 3 +- ...calPT_start_PTU_for_NewApp_PROPRIETARY.lua | 1 - .../116_ATF_DEXTENDED_POLICY_OFF_HTTP.lua | 4 - .../117_ATF_DEXTENDED_POLICY_No_Flag_HTTP.lua | 4 - ...quest_PTU_Trigger_App_Excluded_PT_HTTP.lua | 4 - ..._ATF_HP_Device_Data_Section_Validation.lua | 5 +- .../189_ATF_isAppPermissionsRevoked_true.lua | 6 +- .../190_ATF_Device_treated_as_consented.lua | 3 - ...ATF_UpdateDeviceList_on_device_connect.lua | 12 +- ...2_ATF_isPermissionsConsentNeeded_false.lua | 4 - ...93_ATF_isPermissionsConsentNeeded_true.lua | 6 +- .../194_ATF_ActivateApp_isSDLAllowed_true.lua | 5 +- ...195_ATF_ActivateApp_isSDLAllowed_false.lua | 12 +- ...TF_UpdateDeviceList_isSDLAllowed_false.lua | 11 +- .../197_ATF_ActivateApp_isSDLAllowed_true.lua | 5 +- ...GetUserFriendlyMessage_language_missed.lua | 8 +- ...9_ATF_appPermissionsConsentNeeded_true.lua | 7 +- .../200_ATF_Data_consent_prompt.lua | 10 +- .../201_ATF_User_consents_permissions.lua | 10 +- .../202_ATF_No_OnSDLConsentNeeded.lua | 1 - .../203_ATF_Master_reset.lua | 10 +- .../204_ATF_App_group_order_preconsented.lua | 8 +- .../205_ATF_Consent_timestamp.lua | 9 +- ...TF_Permissions_before_device_consented.lua | 13 +- ...207_ATF_HMILevel_before_data_consented.lua | 12 +- ...08_ATF_No_consent_for_default_policies.lua | 6 +- ...F_Device_user_disallowed_after_consent.lua | 10 +- ...TF_User_consent_initing_after_PTU_FULL.lua | 8 +- ...User_consent_initing_after_PTU_LIMITED.lua | 8 +- ...212_ATF_Data_consent_device_not_in_LPT.lua | 10 +- ...13_ATF_No_user_consent_prompt_in_group.lua | 8 +- .../214_ATF_User_consent_prompt_persists.lua | 11 +- .../215_ATF_User_clears_all_applications.lua | 13 +- .../216_ATF_User_consent_storage_in_LPT.lua | 13 +- ...nsent_status_allowed_on_device_connect.lua | 8 +- ...t_status_not_allowed_on_device_connect.lua | 14 +- ...entifier_creation_upon_connect_no_apps.lua | 8 +- ...tifier_creation_upon_connect_with_apps.lua | 16 +- .../221_ATF_Factory_reset.lua | 12 +- .../222_ATF_Device_HashID_In_LPT.lua | 10 +- user_modules/common_steps.lua | 3 +- user_modules/shared_testcases/commonSteps.lua | 5 +- .../testCasesForExternalUCS.lua | 61 ++--- .../testCasesForPolicyTable.lua | 12 +- 366 files changed, 868 insertions(+), 1600 deletions(-) diff --git a/test_scripts/Policies/ATF_Preloaded_PT_validation.lua b/test_scripts/Policies/ATF_Preloaded_PT_validation.lua index cea5bef280..0b19caf1d3 100644 --- a/test_scripts/Policies/ATF_Preloaded_PT_validation.lua +++ b/test_scripts/Policies/ATF_Preloaded_PT_validation.lua @@ -23,7 +23,7 @@ local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local SDLConfig = require('user_modules/shared_testcases/SmartDeviceLinkConfigurations') - +local utils = require ('user_modules/utils') --------------------------------------------------------------------------------------------- ------------------------------------Common Variables----------------------------------------- --------------------------------------------------------------------------------------------- @@ -31,8 +31,7 @@ local SDLConfig = require('user_modules/shared_testcases/SmartDeviceLinkConfigur --Set 2 protocol as default for script: config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" -local storagePath = config.pathToSDL .. SDLConfig:GetValue("AppStorageFolder") .. "/" .. tostring(config.application1.registerAppInterfaceParams.appID .. "_" .. tostring(config.deviceMAC) .. "/") +local storagePath = config.pathToSDL .. SDLConfig:GetValue("AppStorageFolder") .. "/" .. tostring(config.application1.registerAppInterfaceParams.appID .. "_" .. tostring(utils.getDeviceMAC()) .. "/") --------------------------------------------------------------------------------------------- -------------------------------------Common functions----------------------------------------- @@ -65,7 +64,7 @@ local function WaitForStopSDL(self) if status == SDL.RUNNING then self:FailTestCase("SDL didn't finish correctly") StopSDL() - else + else userPrint(34, "After correct sdl_preloaded_pt.json restored, SDL stops successfully") end end @@ -107,14 +106,14 @@ commonSteps:ActivationApp() --------------------------------------------------------------------------------------------- --Start Positive cases check. -- Start positive case1. - --Description: PTU of registered App is performed using correct file. + --Description: PTU of registered App is performed using correct file. --Verification criteria: Policy update is successfull. - + commonFunctions:newTestCasesGroup("TC01_Case when for PTU is used correct file") - - + + function Test:PTUSuccessIfPTWithDeviceAndPreDataConsent() - + local CorIdSystemRequest = self.mobileSession:SendRPC("SystemRequest", { fileName = "PolicyTableUpdate", @@ -122,14 +121,14 @@ commonSteps:ActivationApp() appID = iappID }, "files/ptu_general.json") - + local systemRequestId --hmi side: expect SystemRequest request EXPECT_HMICALL("BasicCommunication.SystemRequest") :Do(function(_,data) systemRequestId = data.id --print("BasicCommunication.SystemRequest is received") - + --hmi side: sending BasicCommunication.OnSystemRequest request to SDL self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { @@ -140,14 +139,14 @@ commonSteps:ActivationApp() --hmi side: sending SystemRequest response self.hmiConnection:SendResponse(systemRequestId,"BasicCommunication.SystemRequest", "SUCCESS", {}) end - + RUN_AFTER(to_run, 500) end) --hmi side: expect SDL.OnStatusUpdate EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate") :ValidIf(function(exp,data) - if + if exp.occurences == 1 and data.params.status == "UP_TO_DATE" then return true @@ -165,8 +164,8 @@ commonSteps:ActivationApp() exp.occurences == 3) and data.params.status == "UP_TO_DATE" then return true - else - if + else + if exp.occurences == 1 then print ("\27[31m SDL.OnStatusUpdate came with wrong values. Expected in first occurrences status 'UP_TO_DATE' or 'UPDATING', 'UPDATE_NEEDED', got '" .. tostring(data.params.status) .. "' \27[0m") elseif exp.occurences == 2 then @@ -179,17 +178,17 @@ commonSteps:ActivationApp() end end) :Times(Between(1,3)) - + --mobile side: expect SystemRequest response EXPECT_RESPONSE(CorIdSystemRequest, { success = true, resultCode = "SUCCESS"}) :Do(function(_,data) --hmi side: sending SDL.GetUserFriendlyMessage request to SDL local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"StatusUpToDate"}}) - + --hmi side: expect SDL.GetUserFriendlyMessage response - EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage", messages = {{messageCode = "StatusUpToDate"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage", messages = {{messageCode = "StatusUpToDate"}}}}) end) - + end -- End Positive case1. --End Positive cases check. @@ -202,7 +201,7 @@ commonSteps:ActivationApp() ------------------------------------------------------------------------------------------------------- -- Start Negative case1. - --Description:SDL starts with valid preloaded_pt. PTU of registered App is performed with omitted "device" section. + --Description:SDL starts with valid preloaded_pt. PTU of registered App is performed with omitted "device" section. --Verification criteria: SDL fails validation of PTU file, policy update is not successfull. commonFunctions:newTestCasesGroup("TC02_Case when in PTU file device section omitted:") @@ -216,13 +215,13 @@ commonSteps:ActivationApp() appID = iappID }, "files/PTU_DeviceSectionMissed.json") - + local systemRequestId --hmi side: expect SystemRequest request EXPECT_HMICALL("BasicCommunication.SystemRequest") :Do(function(_,data) systemRequestId = data.id - + --hmi side: sending BasicCommunication.OnSystemRequest request to SDL self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { @@ -233,14 +232,14 @@ commonSteps:ActivationApp() --hmi side: sending SystemRequest response self.hmiConnection:SendResponse(systemRequestId,"BasicCommunication.SystemRequest", "SUCCESS", {}) end - + RUN_AFTER(to_run, 500) end) --hmi side: expect SDL.OnStatusUpdate EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"}) :ValidIf(function(exp,data) - if + if exp.occurences == 1 and data.params.status == "UPDATE_NEEDED" then print ("\27[31m SDL.OnStatusUpdate came with wrong values. PTU file validation failed. Exchange wasn't successful") @@ -256,20 +255,20 @@ commonSteps:ActivationApp() print ("\27[31m SDL.OnStatusUpdate came with wrong values. Exchange should not be successful.Expected in second occurrences status 'UPDATE_NEEDED', got '" .. tostring(data.params.status) .. "' \27[0m") return false end - + end) :Times(Between(1,2)) - + --mobile side: expect SystemRequest response EXPECT_RESPONSE(CorIdSystemRequest, { success = true, resultCode = "SUCCESS"}) :Times(0) - + end -- End Negative case1. ------------------------------------------- -- Start Negative case2. - --Description:SDL starts with valid preloaded_pt. PTU of registered App is performed with incorrect "device" section - uppercase. + --Description:SDL starts with valid preloaded_pt. PTU of registered App is performed with incorrect "device" section - uppercase. --Verification criteria: SDL fails validation of PTU file, policy update is not successfull. commonFunctions:newTestCasesGroup("TC03_Case when in PTU file device section incorrect:") @@ -283,13 +282,13 @@ commonSteps:ActivationApp() appID = iappID }, "files/PTU_DeviceSectionUppercase.json") - + local systemRequestId --hmi side: expect SystemRequest request EXPECT_HMICALL("BasicCommunication.SystemRequest") :Do(function(_,data) systemRequestId = data.id - + --hmi side: sending BasicCommunication.OnSystemRequest request to SDL self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { @@ -300,14 +299,14 @@ commonSteps:ActivationApp() --hmi side: sending SystemRequest response self.hmiConnection:SendResponse(systemRequestId,"BasicCommunication.SystemRequest", "SUCCESS", {}) end - + RUN_AFTER(to_run, 500) end) --hmi side: expect SDL.OnStatusUpdate EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"}) :ValidIf(function(exp,data) - if + if exp.occurences == 1 and data.params.status == "UPDATE_NEEDED" then print ("\27[31m SDL.OnStatusUpdate came with wrong values. PTU file validation failed. Exchange wasn't successful") @@ -323,22 +322,22 @@ commonSteps:ActivationApp() print ("\27[31m SDL.OnStatusUpdate came with wrong values. Exchange should not be successful.Expected in second occurrences status 'UPDATE_NEEDED', got '" .. tostring(data.params.status) .. "' \27[0m") return false end - + end) :Times(Between(1,2)) - + --mobile side: expect SystemRequest response EXPECT_RESPONSE(CorIdSystemRequest, { success = true, resultCode = "SUCCESS"}) :Times(0) - + end -- End Negative case2. ------------------------------------------- -- Start Negative case3. - --Description:SDL starts with valid preloaded_pt. PTU of registered app is performed with omitted "pre_DataConsent" section. - --Verification criteria: SDL fails validation of PTU file, policy update is not successfull. - + --Description:SDL starts with valid preloaded_pt. PTU of registered app is performed with omitted "pre_DataConsent" section. + --Verification criteria: SDL fails validation of PTU file, policy update is not successfull. + commonFunctions:newTestCasesGroup("TC04_Case when in PTU file pre_DataConsent section omitted:") function Test:PTUFailNoPredataSection() @@ -350,13 +349,13 @@ commonSteps:ActivationApp() appID = iappID }, "files/PTU_PreDataConsentMissed.json") - + local systemRequestId --hmi side: expect SystemRequest request EXPECT_HMICALL("BasicCommunication.SystemRequest") :Do(function(_,data) systemRequestId = data.id - + --hmi side: sending BasicCommunication.OnSystemRequest request to SDL self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { @@ -367,14 +366,14 @@ commonSteps:ActivationApp() --hmi side: sending SystemRequest response self.hmiConnection:SendResponse(systemRequestId,"BasicCommunication.SystemRequest", "SUCCESS", {}) end - + RUN_AFTER(to_run, 500) end) --hmi side: expect SDL.OnStatusUpdate EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"}) :ValidIf(function(exp,data) - if + if exp.occurences == 1 and data.params.status == "UPDATE_NEEDED" then print ("\27[31m SDL.OnStatusUpdate came with wrong values. PTU file validation failed. Exchange wasn't successful") @@ -390,21 +389,21 @@ commonSteps:ActivationApp() print ("\27[31m SDL.OnStatusUpdate came with wrong values. Exchange should not be successful.Expected in second occurrences status 'UPDATE_NEEDED', got '" .. tostring(data.params.status) .. "' \27[0m") return false end - + end) :Times(Between(1,2)) - + --mobile side: expect SystemRequest response EXPECT_RESPONSE(CorIdSystemRequest, { success = true, resultCode = "SUCCESS"}) :Times(0) - + end -- End Negative case3. ------------------------------------------- -- Start Negative case4. - --Description:SDL starts with valid preloaded_pt. PTU of registered App is performed with incorrect "pre_DataConsent" section - uppercase. + --Description:SDL starts with valid preloaded_pt. PTU of registered App is performed with incorrect "pre_DataConsent" section - uppercase. --Verification criteria: SDL fails validation of PTU file, policy update is not successfull. commonFunctions:newTestCasesGroup("TC05_Case when in PTU file pre_DataConsent section incorrect:") @@ -418,13 +417,13 @@ commonSteps:ActivationApp() appID = iappID }, "files/PTU_PreDataSectionUppercase.json") - + local systemRequestId --hmi side: expect SystemRequest request EXPECT_HMICALL("BasicCommunication.SystemRequest") :Do(function(_,data) systemRequestId = data.id - + --hmi side: sending BasicCommunication.OnSystemRequest request to SDL self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { @@ -435,14 +434,14 @@ commonSteps:ActivationApp() --hmi side: sending SystemRequest response self.hmiConnection:SendResponse(systemRequestId,"BasicCommunication.SystemRequest", "SUCCESS", {}) end - + RUN_AFTER(to_run, 500) end) --hmi side: expect SDL.OnStatusUpdate EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"}) :ValidIf(function(exp,data) - if + if exp.occurences == 1 and data.params.status == "UPDATE_NEEDED" then print ("\27[31m SDL.OnStatusUpdate came with wrong values. PTU file validation failed. Exchange wasn't successful") @@ -458,21 +457,21 @@ commonSteps:ActivationApp() print ("\27[31m SDL.OnStatusUpdate came with wrong values. Exchange should not be successful.Expected in second occurrences status 'UPDATE_NEEDED', got '" .. tostring(data.params.status) .. "' \27[0m") return false end - + end) :Times(Between(1,2)) - + --mobile side: expect SystemRequest response EXPECT_RESPONSE(CorIdSystemRequest, { success = true, resultCode = "SUCCESS"}) :Times(0) - + end -- End Negative case4. ------------------------------------------- -- Start Negative case5. - --Description:SDL starts with valid preloaded_pt. PTU of registered app is performed with omitted "device" and "pre_DataConsent" sections. - --Verification criteria: SDL fails validation of PTU file, policy update is not successfull. + --Description:SDL starts with valid preloaded_pt. PTU of registered app is performed with omitted "device" and "pre_DataConsent" sections. + --Verification criteria: SDL fails validation of PTU file, policy update is not successfull. commonFunctions:newTestCasesGroup("TC06_Case when in PTU file device and pre_DataConsent sections omitted:") @@ -485,13 +484,13 @@ commonSteps:ActivationApp() appID = iappID }, "files/PTU_DeviceAndPreDataMissed.json") - + local systemRequestId --hmi side: expect SystemRequest request EXPECT_HMICALL("BasicCommunication.SystemRequest") :Do(function(_,data) systemRequestId = data.id - + --hmi side: sending BasicCommunication.OnSystemRequest request to SDL self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { @@ -502,14 +501,14 @@ commonSteps:ActivationApp() --hmi side: sending SystemRequest response self.hmiConnection:SendResponse(systemRequestId,"BasicCommunication.SystemRequest", "SUCCESS", {}) end - + RUN_AFTER(to_run, 500) end) --hmi side: expect SDL.OnStatusUpdate EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"}) :ValidIf(function(exp,data) - if + if exp.occurences == 1 and data.params.status == "UPDATE_NEEDED" then print ("\27[31m SDL.OnStatusUpdate came with wrong values. PTU file validation failed. Exchange wasn't successful") @@ -525,20 +524,20 @@ commonSteps:ActivationApp() print ("\27[31m SDL.OnStatusUpdate came with wrong values. Exchange should not be successful.Expected in second occurrences status 'UPDATE_NEEDED', got '" .. tostring(data.params.status) .. "' \27[0m") return false end - + end) :Times(Between(1,2)) - + --mobile side: expect SystemRequest response EXPECT_RESPONSE(CorIdSystemRequest, { success = true, resultCode = "SUCCESS"}) :Times(0) - + end -- End Negative case5. ------------------------------------------- -- Start Negative case6. - --Description:SDL starts with valid preloaded_pt. PTU of registered App is performed with incorrect "device" and "pre_DataConsent" sections - uppercase. + --Description:SDL starts with valid preloaded_pt. PTU of registered App is performed with incorrect "device" and "pre_DataConsent" sections - uppercase. --Verification criteria: SDL fails validation of PTU file, policy update is not successfull. commonFunctions:newTestCasesGroup("TC07_Case when in PTU device & pre_DataConsent sections incorrect:") @@ -552,13 +551,13 @@ commonSteps:ActivationApp() appID = iappID }, "files/PTU_DeviceAndPreDataUppercase.json") - + local systemRequestId --hmi side: expect SystemRequest request EXPECT_HMICALL("BasicCommunication.SystemRequest") :Do(function(_,data) systemRequestId = data.id - + --hmi side: sending BasicCommunication.OnSystemRequest request to SDL self.hmiConnection:SendNotification("SDL.OnReceivedPolicyUpdate", { @@ -569,14 +568,14 @@ commonSteps:ActivationApp() --hmi side: sending SystemRequest response self.hmiConnection:SendResponse(systemRequestId,"BasicCommunication.SystemRequest", "SUCCESS", {}) end - + RUN_AFTER(to_run, 500) end) --hmi side: expect SDL.OnStatusUpdate EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"}) :ValidIf(function(exp,data) - if + if exp.occurences == 1 and data.params.status == "UPDATE_NEEDED" then print ("\27[31m SDL.OnStatusUpdate came with wrong values. PTU file validation failed. Exchange wasn't successful") @@ -592,20 +591,20 @@ commonSteps:ActivationApp() print ("\27[31m SDL.OnStatusUpdate came with wrong values. Exchange should not be successful.Expected in second occurrences status 'UPDATE_NEEDED', got '" .. tostring(data.params.status) .. "' \27[0m") return false end - + end) :Times(Between(1,2)) - + --mobile side: expect SystemRequest response EXPECT_RESPONSE(CorIdSystemRequest, { success = true, resultCode = "SUCCESS"}) :Times(0) - + end -- End Negative case6. ------------------------------------------------------------------------------------------------------ ---"Device" and "pre_DataConsent" section are omitted in sdl_preloaded_pt.json file. +--"Device" and "pre_DataConsent" section are omitted in sdl_preloaded_pt.json file. ------------------------------------------------------------------------------------------------------ -- Start Negative case7. @@ -629,20 +628,20 @@ commonSteps:ActivationApp() file:close() local json = require("modules/json") - + local data = json.decode(json_data) - if data.policy_table.app_policies and + if data.policy_table.app_policies and data.policy_table.app_policies["device"] ~= nil then - data.policy_table.app_policies["device"] = nil + data.policy_table.app_policies["device"] = nil end - + data = json.encode(data) file = io.open(pathToFile, "w") file:write(data) file:close() end - + function Test:IgnitionOnWithEditedPT() StartSDL(config.pathToSDL, config.ExitOnCrash) userPrint(34, "After IGNON SDL stops since preloaded not valid(see above message)") @@ -658,7 +657,7 @@ commonSteps:ActivationApp() - function Test:StartSDLWithDeviceInPT() + function Test:StartSDLWithDeviceInPT() StartSDL(config.pathToSDL, config.ExitOnCrash) userPrint(34, "After correct sdl_preloaded_pt.json restored, SDL starts successfully") end @@ -688,26 +687,26 @@ commonSteps:ActivationApp() file:close() local json = require("modules/json") - + local data = json.decode(json_data) - if data.policy_table.app_policies and + if data.policy_table.app_policies and data.policy_table.app_policies["device"] ~= nil then - data.policy_table.app_policies["device"] = data.policy_table.app_policies["Device"] + data.policy_table.app_policies["device"] = data.policy_table.app_policies["Device"] end - + data = json.encode(data) file = io.open(pathToFile, "w") file:write(data) file:close() end - + function Test:IgnitionOnWithEditedPT() StartSDL(config.pathToSDL, config.ExitOnCrash) userPrint(34, "After IGNON SDL stops since preloaded not valid(see above message)") WaitForStopSDL(self) end - + --Start Postcondition to case8. commonFunctions:newTestCasesGroup("TC09_Postconditions") @@ -715,14 +714,14 @@ commonSteps:ActivationApp() RestorePreloadedPT() end - function Test:StartSDLWithDeviceInPT() + function Test:StartSDLWithDeviceInPT() StartSDL(config.pathToSDL, config.ExitOnCrash) userPrint(34, "After correct sdl_preloaded_pt.json restored, SDL starts successfully") end --end Postcondition to case8. -- End Negative case8. - ------------------------------------------------------------- + ------------------------------------------------------------- -- Start Negative case9. --Description: Mandatory section "pre_DataConsent" is not present in preloaded_pt @@ -745,14 +744,14 @@ commonSteps:ActivationApp() file:close() local json = require("modules/json") - + local data = json.decode(json_data) - if data.policy_table.app_policies and + if data.policy_table.app_policies and data.policy_table.app_policies["pre_DataConsent"] ~= nil then data.policy_table.app_policies["pre_DataConsent"] = nil - + end - + data = json.encode(data) file = io.open(pathToFile, "w") @@ -765,14 +764,14 @@ commonSteps:ActivationApp() userPrint(34, "After IGNON SDL stops since preloaded not valid(see above message)") WaitForStopSDL(self) end - + --Start Postcondition to case9. commonFunctions:newTestCasesGroup("TC10_Postconditions") function Test:RestorePreloadedJson() RestorePreloadedPT() - end + end - function Test:StartSDLWithPreDataInPT() + function Test:StartSDLWithPreDataInPT() StartSDL(config.pathToSDL, config.ExitOnCrash) userPrint(34, "After correct sdl_preloaded_pt.json restored, SDL starts successfully") end @@ -801,13 +800,13 @@ commonSteps:ActivationApp() file:close() local json = require("modules/json") - + local data = json.decode(json_data) - if data.policy_table.app_policies and + if data.policy_table.app_policies and data.policy_table.app_policies["pre_DataConsent"] ~= nil then - data.policy_table.app_policies["pre_DataConsent"] = data.policy_table.app_policies["Pre_DataConsent"] + data.policy_table.app_policies["pre_DataConsent"] = data.policy_table.app_policies["Pre_DataConsent"] end - + data = json.encode(data) file = io.open(pathToFile, "w") @@ -820,7 +819,7 @@ commonSteps:ActivationApp() userPrint(34, "After IGNON SDL stops since preloaded not valid(see above message)") WaitForStopSDL(self) end - + --Start Postcondition to case10. commonFunctions:newTestCasesGroup("TC11_Postconditions") function Test:RestorePreloadedJson() @@ -857,12 +856,12 @@ commonSteps:ActivationApp() file:close() local json = require("modules/json") - + local data = json.decode(json_data) - if data.policy_table.app_policies and + if data.policy_table.app_policies and data.policy_table.app_policies["pre_DataConsent"] ~= nil and data.policy_table.app_policies["device"] ~= nil then data.policy_table.app_policies["device"] = nil - data.policy_table.app_policies["pre_DataConsent"] = nil + data.policy_table.app_policies["pre_DataConsent"] = nil end data = json.encode(data) @@ -877,14 +876,14 @@ commonSteps:ActivationApp() userPrint(34, "After IGNON SDL stops since preloaded not valid(see above message)") WaitForStopSDL(self) end - + --Start Postcondition to case11. commonFunctions:newTestCasesGroup("TC12_Postconditions") function Test:RestorePreloadedJson() RestorePreloadedPT() - end + end - function Test:StartSDLWithDeviceAndPreDataInPT() + function Test:StartSDLWithDeviceAndPreDataInPT() StartSDL(config.pathToSDL, config.ExitOnCrash) userPrint(34, "After correct sdl_preloaded_pt.json restored, SDL starts successfully") end @@ -913,15 +912,15 @@ commonSteps:ActivationApp() file:close() local json = require("modules/json") - + local data = json.decode(json_data) - if data.policy_table.app_policies and + if data.policy_table.app_policies and data.policy_table.app_policies["pre_DataConsent"] ~= nil and data.policy_table.app_policies["device"] ~= nil then - data.policy_table.app_policies["pre_DataConsent"] = data.policy_table.app_policies["Pre_DataConsent"] - data.policy_table.app_policies["device"] = data.policy_table.app_policies["Device"] + data.policy_table.app_policies["pre_DataConsent"] = data.policy_table.app_policies["Pre_DataConsent"] + data.policy_table.app_policies["device"] = data.policy_table.app_policies["Device"] end - + data = json.encode(data) file = io.open(pathToFile, "w") @@ -934,14 +933,14 @@ commonSteps:ActivationApp() userPrint(34, "After IGNON SDL stops since preloaded not valid(see above message)") WaitForStopSDL(self) end - + --Start Postcondition to case12. commonFunctions:newTestCasesGroup("TC13_Postconditions") function Test:RestorePreloadedJson() RestorePreloadedPT() end - function Test:StartSDLWithDeviceInPT() + function Test:StartSDLWithDeviceInPT() StartSDL(config.pathToSDL, config.ExitOnCrash) userPrint(34, "After correct sdl_preloaded_pt.json restored, SDL starts successfully") end diff --git a/test_scripts/Policies/App_Permissions/001_ATF_HP_Order_Of_Request_Response_Notification_On_Registering_App.lua b/test_scripts/Policies/App_Permissions/001_ATF_HP_Order_Of_Request_Response_Notification_On_Registering_App.lua index 9f46d1907a..a4b8e37afd 100644 --- a/test_scripts/Policies/App_Permissions/001_ATF_HP_Order_Of_Request_Response_Notification_On_Registering_App.lua +++ b/test_scripts/Policies/App_Permissions/001_ATF_HP_Order_Of_Request_Response_Notification_On_Registering_App.lua @@ -27,15 +27,13 @@ -- 4. SDL assigns the appropriate policies and notifies application: -- SDL->app: OnPermissionsChange (params) - as specified in "pre_DataConsent" section. --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') local commonTestCases = require ('user_modules/shared_testcases/commonTestCases') local testCasesForPolicyTableSnapshot = require ('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +42,6 @@ commonPreconditions:Connecttest_without_ExitBySDLDisconnect_WithoutOpenConnectio config.defaultProtocolVersion = 2 --[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RPC_BaseBeforeDataConsent = {} --[[ Local functions ]] @@ -80,7 +77,7 @@ function Test:Precondition_Connect_device() commonTestCases:DelayedExp(2000) self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", { - deviceList = { { id = config.deviceMAC, name = ServerAddress, transportType = "WIFI", isSDLAllowed = false} } }) + deviceList = { { id = utils.getDeviceMAC(), name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false} } }) :Do(function(_,data) self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) end) @@ -110,8 +107,8 @@ function Test:Register_App_And_Check_Order_Of_Request_Response_Notiofications() hmiDisplayLanguageDesired = "EN-US", deviceInfo = { - name = ServerAddress, - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI", isSDLAllowed = false } } }) diff --git a/test_scripts/Policies/App_Permissions/002_ATF_HP_OnPermissionsChange_With_Assigned_Policy_After_App_Registration.lua b/test_scripts/Policies/App_Permissions/002_ATF_HP_OnPermissionsChange_With_Assigned_Policy_After_App_Registration.lua index ab87b15e23..835b14c8da 100644 --- a/test_scripts/Policies/App_Permissions/002_ATF_HP_OnPermissionsChange_With_Assigned_Policy_After_App_Registration.lua +++ b/test_scripts/Policies/App_Permissions/002_ATF_HP_OnPermissionsChange_With_Assigned_Policy_After_App_Registration.lua @@ -17,15 +17,13 @@ -- 1. SDL -> app: RegisterAppInterface_response -- 2. SDL -> app: OnPermissionsChange () --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') local commonTestCases = require ('user_modules/shared_testcases/commonTestCases') local testCasesForPolicyTableSnapshot = require ('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -34,7 +32,6 @@ commonPreconditions:Connecttest_without_ExitBySDLDisconnect_WithoutOpenConnectio config.defaultProtocolVersion = 2 --[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RPC_BaseBeforeDataConsent = {} --[[ Local functions ]] @@ -74,7 +71,7 @@ function Test:Precondition_Connect_device() commonTestCases:DelayedExp(2000) self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", { - deviceList = { { id = config.deviceMAC, name = ServerAddress, transportType = "WIFI", isSDLAllowed = false} } }) + deviceList = { { id = utils.getDeviceMAC(), name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false} } }) :Do(function(_,data) self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) end) @@ -104,8 +101,8 @@ function Test:Step1_Register_App_And_Check_Its_Permissions_In_OnPermissionsChang hmiDisplayLanguageDesired = "EN-US", deviceInfo = { - name = ServerAddress, - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI", isSDLAllowed = false } } }) diff --git a/test_scripts/Policies/App_Permissions/003_ATF_HP_User_Consent_Yes.lua b/test_scripts/Policies/App_Permissions/003_ATF_HP_User_Consent_Yes.lua index 1addbc22fd..5d580e18e5 100644 --- a/test_scripts/Policies/App_Permissions/003_ATF_HP_User_Consent_Yes.lua +++ b/test_scripts/Policies/App_Permissions/003_ATF_HP_User_Consent_Yes.lua @@ -29,9 +29,7 @@ -- PoliciesManager: update "" subsection of "user_consent_records" subsection of "" section of "device_data" section in Local PT. -- c) SDL responds SUCCESS to allowed by USER RPC and DISALLOW to disallowed by Policy RPC. --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -42,6 +40,7 @@ local commonTestCases = require ('user_modules/shared_testcases/commonTestCases' local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTableSnapshot = require ('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -83,11 +82,10 @@ local mobile_session = require('mobile_session') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_Connect_device() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") commonTestCases:DelayedExp(2000) self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", { - deviceList = { { id = config.deviceMAC, name = ServerAddress, transportType = "WIFI", isSDLAllowed = false} } }) + deviceList = { { id = utils.getDeviceMAC(), name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false} } }) :Do(function(_,data) self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) end) @@ -133,8 +131,8 @@ function Test:Precondition_Activate_App_And_Consent_Device() hmiDisplayLanguageDesired = "EN-US", deviceInfo = { - name = "127.0.0.1", - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI", isSDLAllowed = false } @@ -152,7 +150,7 @@ function Test:Precondition_Activate_App_And_Consent_Device() local RequestId1 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId1,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/004_ATF_HP_User_Consent_NO.lua b/test_scripts/Policies/App_Permissions/004_ATF_HP_User_Consent_NO.lua index 35f5cf00a8..fa0f3d3e8b 100644 --- a/test_scripts/Policies/App_Permissions/004_ATF_HP_User_Consent_NO.lua +++ b/test_scripts/Policies/App_Permissions/004_ATF_HP_User_Consent_NO.lua @@ -29,9 +29,7 @@ -- SDL->HMI: GetListOfPermissions_response{} -- b) HMI->SDL: OnAppPermissionConsent {allowed = false} --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -41,6 +39,7 @@ local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonTestCases = require ('user_modules/shared_testcases/commonTestCases') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -57,11 +56,10 @@ local mobile_session = require('mobile_session') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_Connect_device() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") commonTestCases:DelayedExp(2000) self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", { - deviceList = { { id = config.deviceMAC, name = ServerAddress, transportType = "WIFI", isSDLAllowed = false} } }) + deviceList = { { id = utils.getDeviceMAC(), name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false} } }) :Do(function(_,data) self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) end) @@ -107,8 +105,8 @@ function Test:Precondition_Activate_App_And_Consent_Device() hmiDisplayLanguageDesired = "EN-US", deviceInfo = { - name = "127.0.0.1", - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI", isSDLAllowed = false } @@ -126,7 +124,7 @@ function Test:Precondition_Activate_App_And_Consent_Device() local RequestId1 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId1,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/005_ATF_DISALLOWED_app_Id_policies_And_RequestType_Validation.lua b/test_scripts/Policies/App_Permissions/005_ATF_DISALLOWED_app_Id_policies_And_RequestType_Validation.lua index cc954b9c8c..d2e9ae04a4 100644 --- a/test_scripts/Policies/App_Permissions/005_ATF_DISALLOWED_app_Id_policies_And_RequestType_Validation.lua +++ b/test_scripts/Policies/App_Permissions/005_ATF_DISALLOWED_app_Id_policies_And_RequestType_Validation.lua @@ -17,9 +17,7 @@ -- Expected result: -- SDL allow SystemRequest with requestType = "PROPRIETARY" and disallow SystemRequest with requestType = "HTTP" --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -30,9 +28,7 @@ local commonPreconditions = require ('user_modules/shared_testcases/commonPrecon local commonTestCases = require ('user_modules/shared_testcases/commonTestCases') local testCasesForPolicyTableSnapshot = require ('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') - ---[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -51,7 +47,7 @@ function Test:Precondition_Connect_device() commonTestCases:DelayedExp(2000) self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", { - deviceList = { { id = config.deviceMAC, name = ServerAddress, transportType = "WIFI", isSDLAllowed = false} } }) + deviceList = { { id = utils.getDeviceMAC(), name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false} } }) :Do(function(_,data) self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) end) @@ -94,8 +90,8 @@ function Test:Precondition_Activate_App_And_Consent_Device() hmiDisplayLanguageDesired = "EN-US", deviceInfo = { - name = "127.0.0.1", - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI", isSDLAllowed = false } @@ -113,7 +109,7 @@ function Test:Precondition_Activate_App_And_Consent_Device() local RequestId1 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId1,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/006_ATF_Steal_focus_validation_false_PTU.lua b/test_scripts/Policies/App_Permissions/006_ATF_Steal_focus_validation_false_PTU.lua index 51c4b8932b..02c69778dd 100644 --- a/test_scripts/Policies/App_Permissions/006_ATF_Steal_focus_validation_false_PTU.lua +++ b/test_scripts/Policies/App_Permissions/006_ATF_Steal_focus_validation_false_PTU.lua @@ -15,7 +15,6 @@ -- SDL must response: success = false, resultCode = "DISALLOWED" ------------------------------------------------------------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -26,9 +25,7 @@ local commonTestCases = require ('user_modules/shared_testcases/commonTestCases' local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTableSnapshot = require ('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') - ---[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -45,7 +42,7 @@ function Test:Precondition_Connect_device() commonTestCases:DelayedExp(2000) self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", { - deviceList = { { id = config.deviceMAC, name = ServerAddress, transportType = "WIFI", isSDLAllowed = false} } }) + deviceList = { { id = utils.getDeviceMAC(), name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false} } }) :Do(function(_,data) self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) end) @@ -71,7 +68,7 @@ function Test:Precondition_ActivateApplication() local RequestId1 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId1,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua b/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua index 3de843ae31..dfb9da6d3c 100644 --- a/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua +++ b/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua @@ -15,7 +15,6 @@ -- SDL must response: success = true, resultCode = "SUCCESS" -------------------------------------------------------------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -26,15 +25,13 @@ local commonTestCases = require ('user_modules/shared_testcases/commonTestCases' local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTableSnapshot = require ('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Functions ]] local function SendOnSystemContext(self, ctx) self.hmiConnection:SendNotification("UI.OnSystemContext",{ appID = self.applications[config.application1.registerAppInterfaceParams.appName], systemContext = ctx }) end ---[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") - --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() commonPreconditions:Connecttest_without_ExitBySDLDisconnect_WithoutOpenConnectionRegisterApp("connecttest_connect_device.lua") @@ -50,7 +47,7 @@ function Test:Precondition_Connect_device() commonTestCases:DelayedExp(2000) self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", { - deviceList = { { id = config.deviceMAC, name = ServerAddress, transportType = "WIFI", isSDLAllowed = false} } }) + deviceList = { { id = utils.getDeviceMAC(), name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false} } }) :Do(function(_,data) self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) end) @@ -76,7 +73,7 @@ function Test:Precondition_ActivateApplication() local RequestId1 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId1,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/008_ATF_DISALLOWED_default_policies_And_RequestType_Validation.lua b/test_scripts/Policies/App_Permissions/008_ATF_DISALLOWED_default_policies_And_RequestType_Validation.lua index a392175075..07503cfe79 100644 --- a/test_scripts/Policies/App_Permissions/008_ATF_DISALLOWED_default_policies_And_RequestType_Validation.lua +++ b/test_scripts/Policies/App_Permissions/008_ATF_DISALLOWED_default_policies_And_RequestType_Validation.lua @@ -17,9 +17,7 @@ -- Expected result: -- SDL allow SystemRequest with requestType = "PROPRIETARY" and disallow SystemRequest with requestType = "HTTP" --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -29,6 +27,7 @@ local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTableSnapshot = require ('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ Local Functions ]] local function SetRequestTypeForDefaultGroup() @@ -74,7 +73,7 @@ function Test:Preconditions_Assign_To_App_Default_RequestType_PROPRIETARY_Via_Ac local RequestId1 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId1,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/009_ATF_Steal_Focus_Validation_False.lua b/test_scripts/Policies/App_Permissions/009_ATF_Steal_Focus_Validation_False.lua index 1b9f5b5137..46eead0838 100644 --- a/test_scripts/Policies/App_Permissions/009_ATF_Steal_Focus_Validation_False.lua +++ b/test_scripts/Policies/App_Permissions/009_ATF_Steal_Focus_Validation_False.lua @@ -16,13 +16,13 @@ --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +43,7 @@ function Test:ActivateApplication() local RequestId1 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId1,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/010_ATF_StealFocus_validation_true_app_id.lua b/test_scripts/Policies/App_Permissions/010_ATF_StealFocus_validation_true_app_id.lua index a524b1dbcb..2dc0c3f5f3 100644 --- a/test_scripts/Policies/App_Permissions/010_ATF_StealFocus_validation_true_app_id.lua +++ b/test_scripts/Policies/App_Permissions/010_ATF_StealFocus_validation_true_app_id.lua @@ -16,13 +16,13 @@ --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ Local Functions ]] local function SendOnSystemContext(self, ctx) @@ -48,7 +48,7 @@ function Test:ActivateApplication() local RequestId1 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId1,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/011_ATF_KeepContext_Validation_false.lua b/test_scripts/Policies/App_Permissions/011_ATF_KeepContext_Validation_false.lua index b7345fbb23..355f0f2281 100644 --- a/test_scripts/Policies/App_Permissions/011_ATF_KeepContext_Validation_false.lua +++ b/test_scripts/Policies/App_Permissions/011_ATF_KeepContext_Validation_false.lua @@ -16,13 +16,13 @@ --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +43,7 @@ function Test:Precondition_ActivateApplication() local RequestId1 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId1,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/012_ATF_KeepContext_Validation_true.lua b/test_scripts/Policies/App_Permissions/012_ATF_KeepContext_Validation_true.lua index 6356f1438a..35e247dd20 100644 --- a/test_scripts/Policies/App_Permissions/012_ATF_KeepContext_Validation_true.lua +++ b/test_scripts/Policies/App_Permissions/012_ATF_KeepContext_Validation_true.lua @@ -16,13 +16,13 @@ --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ Local Functions ]] local function SendOnSystemContext(self, ctx) @@ -48,7 +48,7 @@ function Test:Precondition_ActivateApplication() local RequestId1 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId1,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/013_ATF_General_Result_Codes_Disallowed_Rpc_Is_Omitted_In_The_Policy_Table_Default_Group.lua b/test_scripts/Policies/App_Permissions/013_ATF_General_Result_Codes_Disallowed_Rpc_Is_Omitted_In_The_Policy_Table_Default_Group.lua index 77cd6f991e..9bd23abda7 100644 --- a/test_scripts/Policies/App_Permissions/013_ATF_General_Result_Codes_Disallowed_Rpc_Is_Omitted_In_The_Policy_Table_Default_Group.lua +++ b/test_scripts/Policies/App_Permissions/013_ATF_General_Result_Codes_Disallowed_Rpc_Is_Omitted_In_The_Policy_Table_Default_Group.lua @@ -18,14 +18,11 @@ -- Expected result: -- SDL -> App: RPC (DISALLOWED, success: "false") --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local rpc = {} @@ -47,7 +44,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_ActivateApplication() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end -- function Test:UpdatePolicy() diff --git a/test_scripts/Policies/App_Permissions/014_ATF_Unsubscribe_Vehicle_Data_General_Resultcode_And_The_Individual_Result_Codes_For_A_Part_Of_Parameters_Disallowed_By_Policies.lua b/test_scripts/Policies/App_Permissions/014_ATF_Unsubscribe_Vehicle_Data_General_Resultcode_And_The_Individual_Result_Codes_For_A_Part_Of_Parameters_Disallowed_By_Policies.lua index a8d253f4eb..c11794ba06 100644 --- a/test_scripts/Policies/App_Permissions/014_ATF_Unsubscribe_Vehicle_Data_General_Resultcode_And_The_Individual_Result_Codes_For_A_Part_Of_Parameters_Disallowed_By_Policies.lua +++ b/test_scripts/Policies/App_Permissions/014_ATF_Unsubscribe_Vehicle_Data_General_Resultcode_And_The_Individual_Result_Codes_For_A_Part_Of_Parameters_Disallowed_By_Policies.lua @@ -32,14 +32,11 @@ -- - for allowed: dataType: , resultCode: SUCCESS -- - for disallowed: dataType: , resultCode: DISALLOWED --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -82,7 +79,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end -- function Test:UpdatePolicy() diff --git a/test_scripts/Policies/App_Permissions/015_ATF_Subscribe_Vehicle_Data_Disallowed_Response_When_All_Parameters_Are_Not_Allowed_In_The_Request.lua b/test_scripts/Policies/App_Permissions/015_ATF_Subscribe_Vehicle_Data_Disallowed_Response_When_All_Parameters_Are_Not_Allowed_In_The_Request.lua index 5bf0c83935..8ee18dc6c8 100644 --- a/test_scripts/Policies/App_Permissions/015_ATF_Subscribe_Vehicle_Data_Disallowed_Response_When_All_Parameters_Are_Not_Allowed_In_The_Request.lua +++ b/test_scripts/Policies/App_Permissions/015_ATF_Subscribe_Vehicle_Data_Disallowed_Response_When_All_Parameters_Are_Not_Allowed_In_The_Request.lua @@ -24,14 +24,11 @@ -- General: success: false, resultCode: DISALLOWED -- Individual: dataType: , resultCode: DISALLOWED --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -73,7 +70,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/App_Permissions/016_ATF_Subscribe_Vehicle_Data_General_Resultcode_And_The_Individual_Result_Codes_For_A_Part_Of_Parameters_Disallowed_By_Policies.lua b/test_scripts/Policies/App_Permissions/016_ATF_Subscribe_Vehicle_Data_General_Resultcode_And_The_Individual_Result_Codes_For_A_Part_Of_Parameters_Disallowed_By_Policies.lua index 76b8005689..b34ffb17a3 100644 --- a/test_scripts/Policies/App_Permissions/016_ATF_Subscribe_Vehicle_Data_General_Resultcode_And_The_Individual_Result_Codes_For_A_Part_Of_Parameters_Disallowed_By_Policies.lua +++ b/test_scripts/Policies/App_Permissions/016_ATF_Subscribe_Vehicle_Data_General_Resultcode_And_The_Individual_Result_Codes_For_A_Part_Of_Parameters_Disallowed_By_Policies.lua @@ -31,14 +31,11 @@ -- - for allowed: dataType: , resultCode: SUCCESS -- - for disallowed: dataType: , resultCode: DISALLOWED --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local functions ]] local function UpdatePolicy() @@ -80,7 +77,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/App_Permissions/017_ATF_Get_Vehicle_Data_App_Sends_Not-allowed_Parameters_By_Policies_Only.lua b/test_scripts/Policies/App_Permissions/017_ATF_Get_Vehicle_Data_App_Sends_Not-allowed_Parameters_By_Policies_Only.lua index 591a2309dd..8d61b9a70c 100644 --- a/test_scripts/Policies/App_Permissions/017_ATF_Get_Vehicle_Data_App_Sends_Not-allowed_Parameters_By_Policies_Only.lua +++ b/test_scripts/Policies/App_Permissions/017_ATF_Get_Vehicle_Data_App_Sends_Not-allowed_Parameters_By_Policies_Only.lua @@ -21,14 +21,11 @@ -- Expected result: -- SDL -> App: success: false, resultCode: DISALLOWED --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local functions ]] local function UpdatePolicy() @@ -59,7 +56,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/App_Permissions/018_ATF_Get_Vehicle_Data_App_Sends_Allowed_Parameters_And_Not-allowed_By_Policies_Parameters.lua b/test_scripts/Policies/App_Permissions/018_ATF_Get_Vehicle_Data_App_Sends_Allowed_Parameters_And_Not-allowed_By_Policies_Parameters.lua index 14583a4956..2bf5fa07fe 100644 --- a/test_scripts/Policies/App_Permissions/018_ATF_Get_Vehicle_Data_App_Sends_Allowed_Parameters_And_Not-allowed_By_Policies_Parameters.lua +++ b/test_scripts/Policies/App_Permissions/018_ATF_Get_Vehicle_Data_App_Sends_Allowed_Parameters_And_Not-allowed_By_Policies_Parameters.lua @@ -24,14 +24,11 @@ -- SDL -> HMI: Only allowed parameters -- SDL -> App: "success: true, resultCode: SUCCESS, + "info" parameter listing the params disallowed by policies --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local functions ]] local function UpdatePolicy() @@ -62,7 +59,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/App_Permissions/019_ATF_General_Result_Codes_Disallowed_Rpc_Is_Omitted_In_The_Policy_Table.lua b/test_scripts/Policies/App_Permissions/019_ATF_General_Result_Codes_Disallowed_Rpc_Is_Omitted_In_The_Policy_Table.lua index c7fe74bb43..bc700024df 100644 --- a/test_scripts/Policies/App_Permissions/019_ATF_General_Result_Codes_Disallowed_Rpc_Is_Omitted_In_The_Policy_Table.lua +++ b/test_scripts/Policies/App_Permissions/019_ATF_General_Result_Codes_Disallowed_Rpc_Is_Omitted_In_The_Policy_Table.lua @@ -18,13 +18,11 @@ -- Expected result: -- SDL -> App: RPC (DISALLOWED, success: "false") --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -37,7 +35,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/App_Permissions/020_ATF_General_Result_Codes_Disallowed_In_Case_App_Current_Hmi_Level_Is_Not_Listed_In_Assigned_Policies.lua b/test_scripts/Policies/App_Permissions/020_ATF_General_Result_Codes_Disallowed_In_Case_App_Current_Hmi_Level_Is_Not_Listed_In_Assigned_Policies.lua index c677bfa61e..e80d76065a 100644 --- a/test_scripts/Policies/App_Permissions/020_ATF_General_Result_Codes_Disallowed_In_Case_App_Current_Hmi_Level_Is_Not_Listed_In_Assigned_Policies.lua +++ b/test_scripts/Policies/App_Permissions/020_ATF_General_Result_Codes_Disallowed_In_Case_App_Current_Hmi_Level_Is_Not_Listed_In_Assigned_Policies.lua @@ -19,15 +19,12 @@ -- Expected result: -- SDL -> App: RPC (DISALLOWED, success: "false") --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local testCasesForPolicyAppIdManagament = require("user_modules/shared_testcases/testCasesForPolicyAppIdManagament") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -40,7 +37,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondtion_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:UpdatePolicy() diff --git a/test_scripts/Policies/App_Permissions/021_ATF_HMI_Levels_The_Notification_Is_Allowed_To_Be_Processed_In.lua b/test_scripts/Policies/App_Permissions/021_ATF_HMI_Levels_The_Notification_Is_Allowed_To_Be_Processed_In.lua index 8e4b542e2b..ef6b1e6eea 100644 --- a/test_scripts/Policies/App_Permissions/021_ATF_HMI_Levels_The_Notification_Is_Allowed_To_Be_Processed_In.lua +++ b/test_scripts/Policies/App_Permissions/021_ATF_HMI_Levels_The_Notification_Is_Allowed_To_Be_Processed_In.lua @@ -20,15 +20,12 @@ -- Expected result: -- SDL -> App: There is no notification --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonTestCases = require("user_modules/shared_testcases/commonTestCases") +local utils = require ('user_modules/utils') --[[ Local functions ]] local function UpdatePolicy() @@ -73,7 +70,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/App_Permissions/022_ATF_No_Permission_Notification_To_HMI_In_First_App_Registration.lua b/test_scripts/Policies/App_Permissions/022_ATF_No_Permission_Notification_To_HMI_In_First_App_Registration.lua index 7f05d9e475..b6f4cd8990 100644 --- a/test_scripts/Policies/App_Permissions/022_ATF_No_Permission_Notification_To_HMI_In_First_App_Registration.lua +++ b/test_scripts/Policies/App_Permissions/022_ATF_No_Permission_Notification_To_HMI_In_First_App_Registration.lua @@ -14,9 +14,7 @@ -- No prompts or notification are observed on HMI -- Note: Requirement under clarification! Assumed that OnAppPermissionChanged and OnSDLConsentNeeded should not come --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -25,6 +23,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') local commonTestCases = require ('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[ General Preconditions before ATF starts ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -80,8 +79,8 @@ function Test:TestStep_Firs_Time_Register_App_And_Check_That_No_Permission_Notif hmiDisplayLanguageDesired = "EN-US", deviceInfo = { - name = "127.0.0.1", - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI", isSDLAllowed = false } diff --git a/test_scripts/Policies/App_Permissions/023_ATF_Default_Priority_Value_Assigned_To_App.lua b/test_scripts/Policies/App_Permissions/023_ATF_Default_Priority_Value_Assigned_To_App.lua index 3b13d3363b..dedcddaae9 100644 --- a/test_scripts/Policies/App_Permissions/023_ATF_Default_Priority_Value_Assigned_To_App.lua +++ b/test_scripts/Policies/App_Permissions/023_ATF_Default_Priority_Value_Assigned_To_App.lua @@ -17,9 +17,7 @@ -- SDL->HMI: SDL.ActivateApp_response {priority: NONE, params} -- SDL->HMI: SDL.OnAppPermissionsChanged {priority: NONE, params} --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -28,6 +26,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Preconditions before ATF starts ]] commonPreconditions:Connecttest_without_ExitBySDLDisconnect_WithoutOpenConnectionRegisterApp("connecttest_ConnectMobile.lua") @@ -98,7 +97,7 @@ function Test:TestStep_Activate_App_Consent_Device_And_Check_Priority_In_Activat local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMINOTIFICATION("SDL.OnAppPermissionChanged", {appID = self.applications["Test Application"], priority = "NONE"}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) diff --git a/test_scripts/Policies/App_Permissions/024_ATF_APP_UNAUTHORIZED_If_Failed_Nickname_Validation_After_PTU.lua b/test_scripts/Policies/App_Permissions/024_ATF_APP_UNAUTHORIZED_If_Failed_Nickname_Validation_After_PTU.lua index 1ddf2d612e..1029fb2743 100644 --- a/test_scripts/Policies/App_Permissions/024_ATF_APP_UNAUTHORIZED_If_Failed_Nickname_Validation_After_PTU.lua +++ b/test_scripts/Policies/App_Permissions/024_ATF_APP_UNAUTHORIZED_If_Failed_Nickname_Validation_After_PTU.lua @@ -14,15 +14,14 @@ -- Expected result: -- a) SDL->app: OnAppInterfaceUnregistered (APP_UNAUTHORIZED) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -146,8 +145,8 @@ function Test:TestStep_Update_PT_With_Another_NickName_For_Current_App_And_Check hmiDisplayLanguageDesired = "EN-US", deviceInfo = { - name = "127.0.0.1", - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI", isSDLAllowed = false } @@ -160,7 +159,7 @@ function Test:TestStep_Update_PT_With_Another_NickName_For_Current_App_And_Check local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/025_ATF_ChangeRegistration_With_AppName_Not_Listed_In_NickNames.lua b/test_scripts/Policies/App_Permissions/025_ATF_ChangeRegistration_With_AppName_Not_Listed_In_NickNames.lua index fbd794b0d3..990410c36e 100644 --- a/test_scripts/Policies/App_Permissions/025_ATF_ChangeRegistration_With_AppName_Not_Listed_In_NickNames.lua +++ b/test_scripts/Policies/App_Permissions/025_ATF_ChangeRegistration_With_AppName_Not_Listed_In_NickNames.lua @@ -14,15 +14,14 @@ -- Expected result: -- a) (DISALLOWED, success:false) to this application for ChangeRegistration (not unregister it) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -144,8 +143,8 @@ function Test:Precondition_Register_App_Activate_And_consent_Device() hmiDisplayLanguageDesired = "EN-US", deviceInfo = { - name = "127.0.0.1", - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI", isSDLAllowed = false } @@ -158,7 +157,7 @@ function Test:Precondition_Register_App_Activate_And_consent_Device() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -167,19 +166,19 @@ function Test:Precondition_Register_App_Activate_And_consent_Device() end) end) end) - EXPECT_RESPONSE(CorIdRAI, { success = true, resultCode = "SUCCESS"}) + EXPECT_RESPONSE(CorIdRAI, { success = true, resultCode = "SUCCESS"}) end --[[ Test ]] -function Test:TestStep_Send_ChangeRegistration_WithApp_Name_Not_Listed_In_NickNames_DISALLOWED() +function Test:TestStep_Send_ChangeRegistration_WithApp_Name_Not_Listed_In_NickNames_DISALLOWED() local CorIdChangeRegistration = self.mobileSession:SendRPC("ChangeRegistration",{ language ="EN-US", hmiDisplayLanguage ="EN-US", appName ="NameNotListedInNickNames"}) - EXPECT_RESPONSE(CorIdChangeRegistration, { success = false, resultCode = "DISALLOWED" }) + EXPECT_RESPONSE(CorIdChangeRegistration, { success = false, resultCode = "DISALLOWED" }) end -function Test:TestStep_Ensure_App_Still_Registered_By_Sending_Show() +function Test:TestStep_Ensure_App_Still_Registered_By_Sending_Show() local CorIdRAI = self.mobileSession:SendRPC("Show", { mediaClock = "00:00:01", @@ -194,4 +193,4 @@ end --[[ Postcondition ]] function Test:Postcondition_StopSDL() StopSDL() -end \ No newline at end of file +end diff --git a/test_scripts/Policies/App_Permissions/026_ATF_DISALLOWED_App_Which_Name_Does_Not_Match_With_Nickname_In_PT.lua b/test_scripts/Policies/App_Permissions/026_ATF_DISALLOWED_App_Which_Name_Does_Not_Match_With_Nickname_In_PT.lua index 66c44e9d71..4355acf878 100644 --- a/test_scripts/Policies/App_Permissions/026_ATF_DISALLOWED_App_Which_Name_Does_Not_Match_With_Nickname_In_PT.lua +++ b/test_scripts/Policies/App_Permissions/026_ATF_DISALLOWED_App_Which_Name_Does_Not_Match_With_Nickname_In_PT.lua @@ -12,15 +12,14 @@ -- Expected result: -- a) SDL->app: RegisterAppInterface(DISALLOWED, success:false) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() diff --git a/test_scripts/Policies/App_Permissions/027_ATF_NickName_Case_Insensitivity.lua b/test_scripts/Policies/App_Permissions/027_ATF_NickName_Case_Insensitivity.lua index d51f885ac9..e15ee9a7d2 100644 --- a/test_scripts/Policies/App_Permissions/027_ATF_NickName_Case_Insensitivity.lua +++ b/test_scripts/Policies/App_Permissions/027_ATF_NickName_Case_Insensitivity.lua @@ -13,9 +13,7 @@ -- Expected result: -- a) SDL->appID: SUCCESS: RegisterAppInterface() --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -23,6 +21,7 @@ config.defaultProtocolVersion = 2 local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -101,7 +100,7 @@ end function Test.Postcondition_Restore_preloaded() commonPreconditions:RestoreFile("sdl_preloaded_pt.json") -end +end --[[ Test ]] commonFunctions:newTestCasesGroup("Test") @@ -134,4 +133,4 @@ end commonFunctions:newTestCasesGroup("Postconditions") function Test.Postcondition_SDLStop() StopSDL() -end \ No newline at end of file +end diff --git a/test_scripts/Policies/App_Permissions/028_ATF_Nickname_Validation_Before_Duplicate_Name_Validation.lua b/test_scripts/Policies/App_Permissions/028_ATF_Nickname_Validation_Before_Duplicate_Name_Validation.lua index f32289c606..a559d4bacd 100644 --- a/test_scripts/Policies/App_Permissions/028_ATF_Nickname_Validation_Before_Duplicate_Name_Validation.lua +++ b/test_scripts/Policies/App_Permissions/028_ATF_Nickname_Validation_Before_Duplicate_Name_Validation.lua @@ -3,9 +3,9 @@ -- [RegisterAppInterface] Nickname validation must be done before duplicate name validation -- -- Description: --- In case the application sends RegisterAppInterface request with the "appName" value that +-- In case the application sends RegisterAppInterface request with the "appName" value that -- - is not listed in this app's specific policies --- - is the same as another already-registered application hasSDL +-- - is the same as another already-registered application hasSDL -- must: return RegisterAppInterface_response (DISALLOWED, success: false) -- 1. Used preconditions: -- a) First SDL life cycle with loaded permissions for specific appId and nickname for it @@ -16,15 +16,14 @@ -- Expected result: -- a) SDL validate nicknames before duplicate name validation and respond for second app RegisterAppInterface_response (DISALLOWED, success: false) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Settings for configuration ]] Test = require('connecttest') @@ -132,7 +131,7 @@ function Test:Precondition_Register_New_App_Not_Listad_In_PT() maxNumberRFCOMMPorts = 1 } }) - EXPECT_RESPONSE(CorIdRAI, { success = true, resultCode = "SUCCESS"}) + EXPECT_RESPONSE(CorIdRAI, { success = true, resultCode = "SUCCESS"}) end function Test:Precondition_StartSession_2() @@ -141,7 +140,7 @@ function Test:Precondition_StartSession_2() end --[[ Test ]] -function Test:TestStep_Register_DuplicateName_App_Listed_In_PT_But_With_Wrong_NickName_Check_DISALLOWED() +function Test:TestStep_Register_DuplicateName_App_Listed_In_PT_But_With_Wrong_NickName_Check_DISALLOWED() local CorIdRAI2 = self.mobileSession2:SendRPC("RegisterAppInterface", { syncMsgVersion = @@ -169,4 +168,4 @@ end --[[ Postcondition ]] function Test:Postcondition_StopSDL() StopSDL() -end \ No newline at end of file +end diff --git a/test_scripts/Policies/App_Permissions/029_ATF_OnPermissionsChange_After_PTU.lua b/test_scripts/Policies/App_Permissions/029_ATF_OnPermissionsChange_After_PTU.lua index c3c9c2b4b1..63620cb798 100644 --- a/test_scripts/Policies/App_Permissions/029_ATF_OnPermissionsChange_After_PTU.lua +++ b/test_scripts/Policies/App_Permissions/029_ATF_OnPermissionsChange_After_PTU.lua @@ -16,15 +16,14 @@ -- Expected result: -- SDL notify app with new changed permissions via OnPermissionsChange --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -45,7 +44,7 @@ function Test:TestStep_Assign_To_App_Default_Permissions_And_Check_Them_In_OnPer local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/App_Permissions/030_ATF_Successful_Nickname_Validation.lua b/test_scripts/Policies/App_Permissions/030_ATF_Successful_Nickname_Validation.lua index e8a523ff29..ad25f178f8 100644 --- a/test_scripts/Policies/App_Permissions/030_ATF_Successful_Nickname_Validation.lua +++ b/test_scripts/Policies/App_Permissions/030_ATF_Successful_Nickname_Validation.lua @@ -5,20 +5,18 @@ -- Note: SDL must build with EXTENDED_POLICY flag -- -- Description: --- In case the application sends RegisterAppInterface request with +-- In case the application sends RegisterAppInterface request with -- a) the "appName" value that is listed in this app's specific policies -- b) other valid parameters SDL must: successfully register such application: RegisterAppInterface_response (, success: true) -- 1. Used preconditions: -- a) First SDL life cycle with loaded permissions for specific appId and nickname -- 2. Performed steps -- a) Register app with name listed in policy table for this app --- +-- -- Expected result: -- a) RegisterAppInterface_response (, success: true) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -27,6 +25,7 @@ config.defaultProtocolVersion = 2 local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -62,7 +61,7 @@ local function SetNickNameForSpecificApp() file:write(data) file:close() end - + --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test.Precondition_StopSDL() @@ -136,14 +135,14 @@ function Test:TestStep_Register_App_With_Name_Listed_In_LPT() hmiDisplayLanguageDesired = "EN-US", deviceInfo = { - name = "127.0.0.1", - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI", isSDLAllowed = false } } }) - EXPECT_RESPONSE(CorIdRAI, {success = true, resultCode = "SUCCESS"}) + EXPECT_RESPONSE(CorIdRAI, {success = true, resultCode = "SUCCESS"}) end @@ -154,4 +153,4 @@ function Test.Postcondition_SDLStop() end function Test.Postcondition_Restore_preloaded() commonPreconditions:RestoreFile("sdl_preloaded_pt.json") -end +end diff --git a/test_scripts/Policies/External_UCS/001_ATF_P_TC_LPT_Creation_PreloadedPT_without_external_consent_status_groups_struct.lua b/test_scripts/Policies/External_UCS/001_ATF_P_TC_LPT_Creation_PreloadedPT_without_external_consent_status_groups_struct.lua index 63cc4bcebc..c2713e312a 100644 --- a/test_scripts/Policies/External_UCS/001_ATF_P_TC_LPT_Creation_PreloadedPT_without_external_consent_status_groups_struct.lua +++ b/test_scripts/Policies/External_UCS/001_ATF_P_TC_LPT_Creation_PreloadedPT_without_external_consent_status_groups_struct.lua @@ -24,9 +24,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] @@ -35,6 +33,7 @@ local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') local sdl = require('SDL') local testCasesForExternalUCS = require('user_modules/shared_testcases/testCasesForExternalUCS') +local utils = require ('user_modules/utils') --[[ Local variables ]] local checkedSection = "external_consent_status_groups" @@ -66,10 +65,10 @@ function Test:CheckPreloadedPT() if preloadedTable and preloadedTable.policy_table and preloadedTable.policy_table.device_data - and preloadedTable.policy_table.device_data[config.deviceMAC] - and preloadedTable.policy_table.device_data[config.deviceMAC].user_consent_records + and preloadedTable.policy_table.device_data[utils.getDeviceMAC()] + and preloadedTable.policy_table.device_data[utils.getDeviceMAC()].user_consent_records then - for _, v in pairs(preloadedTable.policy_table.device_data[config.deviceMAC].user_consent_records) do + for _, v in pairs(preloadedTable.policy_table.device_data[utils.getDeviceMAC()].user_consent_records) do if v[checkedSection] then result = false end diff --git a/test_scripts/Policies/External_UCS/002_ATF_N_TC_LPT_Creation_PreloadedPT_with_external_consent_status_groups_struct.lua b/test_scripts/Policies/External_UCS/002_ATF_N_TC_LPT_Creation_PreloadedPT_with_external_consent_status_groups_struct.lua index 8b40c4ffb3..2d4b0eecc0 100644 --- a/test_scripts/Policies/External_UCS/002_ATF_N_TC_LPT_Creation_PreloadedPT_with_external_consent_status_groups_struct.lua +++ b/test_scripts/Policies/External_UCS/002_ATF_N_TC_LPT_Creation_PreloadedPT_with_external_consent_status_groups_struct.lua @@ -29,9 +29,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 config.ExitOnCrash = false @@ -42,6 +40,7 @@ local commonPreconditions = require('user_modules/shared_testcases/commonPrecond local sdl = require('SDL') local testCasesForExternalUCS = require('user_modules/shared_testcases/testCasesForExternalUCS') local testCasesForPolicySDLErrorsStops = require('user_modules/shared_testcases/testCasesForPolicySDLErrorsStops') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -74,7 +73,7 @@ end function Test.UpdatePreloadedPT_Add_section() local updateFunc = function(preloadedTable) preloadedTable.policy_table.device_data = { - [config.deviceMAC] = { + [utils.getDeviceMAC()] = { user_consent_records = { [config.application1.registerAppInterfaceParams.appID] = { external_consent_status_groups = { diff --git a/test_scripts/Policies/External_UCS/003_ATF_P_TC_LPT_Creation_PreloadedPT_without_disallowed_by_external_consent_entities_off_struct.lua b/test_scripts/Policies/External_UCS/003_ATF_P_TC_LPT_Creation_PreloadedPT_without_disallowed_by_external_consent_entities_off_struct.lua index 0437f96b33..b322b68979 100644 --- a/test_scripts/Policies/External_UCS/003_ATF_P_TC_LPT_Creation_PreloadedPT_without_disallowed_by_external_consent_entities_off_struct.lua +++ b/test_scripts/Policies/External_UCS/003_ATF_P_TC_LPT_Creation_PreloadedPT_without_disallowed_by_external_consent_entities_off_struct.lua @@ -28,9 +28,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/004_ATF_P_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct.lua b/test_scripts/Policies/External_UCS/004_ATF_P_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct.lua index e72caa0c2f..5dce067ecb 100644 --- a/test_scripts/Policies/External_UCS/004_ATF_P_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct.lua +++ b/test_scripts/Policies/External_UCS/004_ATF_P_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct.lua @@ -28,9 +28,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/005_ATF_P_TC_LPT_Creation_PreloadedPT_without_disallowed_by_external_consent_entities_on_struct.lua b/test_scripts/Policies/External_UCS/005_ATF_P_TC_LPT_Creation_PreloadedPT_without_disallowed_by_external_consent_entities_on_struct.lua index 8fc90f888a..5c7fb93dcf 100644 --- a/test_scripts/Policies/External_UCS/005_ATF_P_TC_LPT_Creation_PreloadedPT_without_disallowed_by_external_consent_entities_on_struct.lua +++ b/test_scripts/Policies/External_UCS/005_ATF_P_TC_LPT_Creation_PreloadedPT_without_disallowed_by_external_consent_entities_on_struct.lua @@ -28,9 +28,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/006_ATF_P_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct.lua b/test_scripts/Policies/External_UCS/006_ATF_P_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct.lua index efe6b4930b..2be3f11a25 100644 --- a/test_scripts/Policies/External_UCS/006_ATF_P_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct.lua +++ b/test_scripts/Policies/External_UCS/006_ATF_P_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct.lua @@ -28,9 +28,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/007_ATF_N_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua b/test_scripts/Policies/External_UCS/007_ATF_N_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua index 5337e004fa..68b0c6847b 100644 --- a/test_scripts/Policies/External_UCS/007_ATF_N_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua +++ b/test_scripts/Policies/External_UCS/007_ATF_N_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua @@ -26,9 +26,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 config.ExitOnCrash = false diff --git a/test_scripts/Policies/External_UCS/008_ATF_N_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua b/test_scripts/Policies/External_UCS/008_ATF_N_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua index d988cf2aec..97b3c21887 100644 --- a/test_scripts/Policies/External_UCS/008_ATF_N_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua +++ b/test_scripts/Policies/External_UCS/008_ATF_N_TC_LPT_Creation_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua @@ -26,9 +26,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 config.ExitOnCrash = false diff --git a/test_scripts/Policies/External_UCS/009_ATF_P_TC_SnapshotPT_without_external_consent_status_groups_struct.lua b/test_scripts/Policies/External_UCS/009_ATF_P_TC_SnapshotPT_without_external_consent_status_groups_struct.lua index d181cd5339..d6b3052032 100644 --- a/test_scripts/Policies/External_UCS/009_ATF_P_TC_SnapshotPT_without_external_consent_status_groups_struct.lua +++ b/test_scripts/Policies/External_UCS/009_ATF_P_TC_SnapshotPT_without_external_consent_status_groups_struct.lua @@ -26,15 +26,14 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForExternalUCS = require('user_modules/shared_testcases/testCasesForExternalUCS') +local utils = require ('user_modules/utils') --[[ Local variables ]] local appId = config.application1.registerAppInterfaceParams.appID @@ -76,10 +75,10 @@ function Test:CheckPTS() self:FailTestCase("PTS was not created") elseif testCasesForExternalUCS.pts.policy_table and testCasesForExternalUCS.pts.policy_table.device_data - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC] - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC].user_consent_records - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC].user_consent_records[appId] - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC].user_consent_records[appId][checkedSection] + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()] + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()].user_consent_records + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()].user_consent_records[appId] + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()].user_consent_records[appId][checkedSection] then self:FailTestCase("Section '" .. checkedSection .. "' was found in PTS") else diff --git a/test_scripts/Policies/External_UCS/010_ATF_P_TC_SnapshotPT_with_external_consent_status_groups_struct.lua b/test_scripts/Policies/External_UCS/010_ATF_P_TC_SnapshotPT_with_external_consent_status_groups_struct.lua index 35d3263578..2444502278 100644 --- a/test_scripts/Policies/External_UCS/010_ATF_P_TC_SnapshotPT_with_external_consent_status_groups_struct.lua +++ b/test_scripts/Policies/External_UCS/010_ATF_P_TC_SnapshotPT_with_external_consent_status_groups_struct.lua @@ -27,9 +27,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] @@ -38,6 +36,7 @@ local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') local json = require("modules/json") local testCasesForExternalUCS = require('user_modules/shared_testcases/testCasesForExternalUCS') +local utils = require ('user_modules/utils') --[[ Local variables ]] local appId = config.application1.registerAppInterfaceParams.appID @@ -128,10 +127,10 @@ function Test:CheckPTS() self:FailTestCase("PTS was not created") elseif testCasesForExternalUCS.pts.policy_table and testCasesForExternalUCS.pts.policy_table.device_data - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC] - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC].user_consent_records - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC].user_consent_records[appId] - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC].user_consent_records[appId][checkedSection] + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()] + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()].user_consent_records + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()].user_consent_records[appId] + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()].user_consent_records[appId][checkedSection] then print("Section '".. checkedSection .. "' exists in PTS") print(" => OK") diff --git a/test_scripts/Policies/External_UCS/011_ATF_P_TC_SnapshotPT_without_disallowed_by_external_consent_entities_off_struct.lua b/test_scripts/Policies/External_UCS/011_ATF_P_TC_SnapshotPT_without_disallowed_by_external_consent_entities_off_struct.lua index ef9da346f8..c25c903972 100644 --- a/test_scripts/Policies/External_UCS/011_ATF_P_TC_SnapshotPT_without_disallowed_by_external_consent_entities_off_struct.lua +++ b/test_scripts/Policies/External_UCS/011_ATF_P_TC_SnapshotPT_without_disallowed_by_external_consent_entities_off_struct.lua @@ -25,9 +25,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/012_ATF_P_TC_SnapshotPT_with_disallowed_by_external_consent_entities_off_struct.lua b/test_scripts/Policies/External_UCS/012_ATF_P_TC_SnapshotPT_with_disallowed_by_external_consent_entities_off_struct.lua index fa80af962c..695f256474 100644 --- a/test_scripts/Policies/External_UCS/012_ATF_P_TC_SnapshotPT_with_disallowed_by_external_consent_entities_off_struct.lua +++ b/test_scripts/Policies/External_UCS/012_ATF_P_TC_SnapshotPT_with_disallowed_by_external_consent_entities_off_struct.lua @@ -27,9 +27,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/013_ATF_P_TC_SnapshotPT_without_disallowed_by_external_consent_entities_on_struct.lua b/test_scripts/Policies/External_UCS/013_ATF_P_TC_SnapshotPT_without_disallowed_by_external_consent_entities_on_struct.lua index 9dcaa1aa33..af1e0250dc 100644 --- a/test_scripts/Policies/External_UCS/013_ATF_P_TC_SnapshotPT_without_disallowed_by_external_consent_entities_on_struct.lua +++ b/test_scripts/Policies/External_UCS/013_ATF_P_TC_SnapshotPT_without_disallowed_by_external_consent_entities_on_struct.lua @@ -25,9 +25,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/014_ATF_P_TC_SnapshotPT_with_disallowed_by_external_consent_entities_on_struct.lua b/test_scripts/Policies/External_UCS/014_ATF_P_TC_SnapshotPT_with_disallowed_by_external_consent_entities_on_struct.lua index 0a2ed84c52..6fec168313 100644 --- a/test_scripts/Policies/External_UCS/014_ATF_P_TC_SnapshotPT_with_disallowed_by_external_consent_entities_on_struct.lua +++ b/test_scripts/Policies/External_UCS/014_ATF_P_TC_SnapshotPT_with_disallowed_by_external_consent_entities_on_struct.lua @@ -27,9 +27,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/015_ATF_P_TC_PTU_without_external_consent_status_groups_struct.lua b/test_scripts/Policies/External_UCS/015_ATF_P_TC_PTU_without_external_consent_status_groups_struct.lua index 7d54253ef0..9f8b80a56b 100644 --- a/test_scripts/Policies/External_UCS/015_ATF_P_TC_PTU_without_external_consent_status_groups_struct.lua +++ b/test_scripts/Policies/External_UCS/015_ATF_P_TC_PTU_without_external_consent_status_groups_struct.lua @@ -27,9 +27,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/016_ATF_N_TC_PTU_with_external_consent_status_groups_struct.lua b/test_scripts/Policies/External_UCS/016_ATF_N_TC_PTU_with_external_consent_status_groups_struct.lua index d7d3de9bf9..ed3a5fb78a 100644 --- a/test_scripts/Policies/External_UCS/016_ATF_N_TC_PTU_with_external_consent_status_groups_struct.lua +++ b/test_scripts/Policies/External_UCS/016_ATF_N_TC_PTU_with_external_consent_status_groups_struct.lua @@ -24,15 +24,14 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForExternalUCS = require('user_modules/shared_testcases/testCasesForExternalUCS') +local utils = require ('user_modules/utils') --[[ Local variables ]] local appId = config.application1.registerAppInterfaceParams.appID @@ -70,7 +69,7 @@ end function Test:ActivateApp() local updateFunc = function(pts) pts.policy_table.device_data = { - [config.deviceMAC] = { + [utils.getDeviceMAC()] = { user_consent_records = { [appId] = { [checkedSection] = { @@ -108,10 +107,10 @@ function Test:CheckPTS() self:FailTestCase("PTS was not created") elseif testCasesForExternalUCS.pts.policy_table and testCasesForExternalUCS.pts.policy_table.device_data - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC] - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC].user_consent_records - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC].user_consent_records[appId] - and testCasesForExternalUCS.pts.policy_table.device_data[config.deviceMAC].user_consent_records[appId][checkedSection] + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()] + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()].user_consent_records + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()].user_consent_records[appId] + and testCasesForExternalUCS.pts.policy_table.device_data[utils.getDeviceMAC()].user_consent_records[appId][checkedSection] then self:FailTestCase("Section '" .. checkedSection .. "' was found in PTS") else diff --git a/test_scripts/Policies/External_UCS/017_ATF_P_TC_PTU_without_disallowed_by_external_consent_entities_off_struct.lua b/test_scripts/Policies/External_UCS/017_ATF_P_TC_PTU_without_disallowed_by_external_consent_entities_off_struct.lua index 4de0c31161..b9d4696cb6 100644 --- a/test_scripts/Policies/External_UCS/017_ATF_P_TC_PTU_without_disallowed_by_external_consent_entities_off_struct.lua +++ b/test_scripts/Policies/External_UCS/017_ATF_P_TC_PTU_without_disallowed_by_external_consent_entities_off_struct.lua @@ -30,9 +30,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/018_ATF_P_TC_PTU_with_disallowed_by_external_consent_entities_off_struct.lua b/test_scripts/Policies/External_UCS/018_ATF_P_TC_PTU_with_disallowed_by_external_consent_entities_off_struct.lua index 927ec34566..cbd7c9c774 100644 --- a/test_scripts/Policies/External_UCS/018_ATF_P_TC_PTU_with_disallowed_by_external_consent_entities_off_struct.lua +++ b/test_scripts/Policies/External_UCS/018_ATF_P_TC_PTU_with_disallowed_by_external_consent_entities_off_struct.lua @@ -31,9 +31,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/019_ATF_P_TC_PTU_without_disallowed_by_external_consent_entities_on_struct.lua b/test_scripts/Policies/External_UCS/019_ATF_P_TC_PTU_without_disallowed_by_external_consent_entities_on_struct.lua index db58a92941..1a4f4718a1 100644 --- a/test_scripts/Policies/External_UCS/019_ATF_P_TC_PTU_without_disallowed_by_external_consent_entities_on_struct.lua +++ b/test_scripts/Policies/External_UCS/019_ATF_P_TC_PTU_without_disallowed_by_external_consent_entities_on_struct.lua @@ -30,9 +30,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/020_ATF_P_TC_PTU_with_disallowed_by_external_consent_entities_on_struct.lua b/test_scripts/Policies/External_UCS/020_ATF_P_TC_PTU_with_disallowed_by_external_consent_entities_on_struct.lua index 7a7173d213..70910e5ab6 100644 --- a/test_scripts/Policies/External_UCS/020_ATF_P_TC_PTU_with_disallowed_by_external_consent_entities_on_struct.lua +++ b/test_scripts/Policies/External_UCS/020_ATF_P_TC_PTU_with_disallowed_by_external_consent_entities_on_struct.lua @@ -31,9 +31,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/021_ATF_N_TC_PTU_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua b/test_scripts/Policies/External_UCS/021_ATF_N_TC_PTU_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua index 2e63284e26..d5b8af354a 100644 --- a/test_scripts/Policies/External_UCS/021_ATF_N_TC_PTU_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua +++ b/test_scripts/Policies/External_UCS/021_ATF_N_TC_PTU_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua @@ -23,9 +23,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/022_ATF_N_TC_PTU_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua b/test_scripts/Policies/External_UCS/022_ATF_N_TC_PTU_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua index 070a1269ed..0835e0d4c6 100644 --- a/test_scripts/Policies/External_UCS/022_ATF_N_TC_PTU_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua +++ b/test_scripts/Policies/External_UCS/022_ATF_N_TC_PTU_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua @@ -23,9 +23,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/023_ATF_P_TC_LPT_Update_PreloadedPT_without_external_consent_status_groups_struct.lua b/test_scripts/Policies/External_UCS/023_ATF_P_TC_LPT_Update_PreloadedPT_without_external_consent_status_groups_struct.lua index 6de257b0e9..e7f1543896 100644 --- a/test_scripts/Policies/External_UCS/023_ATF_P_TC_LPT_Update_PreloadedPT_without_external_consent_status_groups_struct.lua +++ b/test_scripts/Policies/External_UCS/023_ATF_P_TC_LPT_Update_PreloadedPT_without_external_consent_status_groups_struct.lua @@ -25,9 +25,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] @@ -36,6 +34,7 @@ local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') local sdl = require('SDL') local testCasesForExternalUCS = require('user_modules/shared_testcases/testCasesForExternalUCS') +local utils = require ('user_modules/utils') --[[ Local variables ]] local checkedSection = "external_consent_status_groups" @@ -67,10 +66,10 @@ function Test:CheckPreloadedPT() if preloadedTable and preloadedTable.policy_table and preloadedTable.policy_table.device_data - and preloadedTable.policy_table.device_data[config.deviceMAC] - and preloadedTable.policy_table.device_data[config.deviceMAC].user_consent_records + and preloadedTable.policy_table.device_data[utils.getDeviceMAC()] + and preloadedTable.policy_table.device_data[utils.getDeviceMAC()].user_consent_records then - for _, v in pairs(preloadedTable.policy_table.device_data[config.deviceMAC].user_consent_records) do + for _, v in pairs(preloadedTable.policy_table.device_data[utils.getDeviceMAC()].user_consent_records) do if v[checkedSection] then result = false end diff --git a/test_scripts/Policies/External_UCS/024_ATF_N_TC_LPT_Update_PreloadedPT_with_external_consent_status_groups_struct.lua b/test_scripts/Policies/External_UCS/024_ATF_N_TC_LPT_Update_PreloadedPT_with_external_consent_status_groups_struct.lua index d1dbf54f12..7290a1305a 100644 --- a/test_scripts/Policies/External_UCS/024_ATF_N_TC_LPT_Update_PreloadedPT_with_external_consent_status_groups_struct.lua +++ b/test_scripts/Policies/External_UCS/024_ATF_N_TC_LPT_Update_PreloadedPT_with_external_consent_status_groups_struct.lua @@ -26,9 +26,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 config.ExitOnCrash = false @@ -39,6 +37,7 @@ local commonPreconditions = require('user_modules/shared_testcases/commonPrecond local sdl = require('SDL') local testCasesForExternalUCS = require('user_modules/shared_testcases/testCasesForExternalUCS') local testCasesForPolicySDLErrorsStops = require('user_modules/shared_testcases/testCasesForPolicySDLErrorsStops') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -80,7 +79,7 @@ function Test.UpdatePreloadedPT() local updateFunc = function(preloadedTable) preloadedTable.policy_table.module_config.preloaded_date = os.date("%Y-%m-%d") preloadedTable.policy_table.device_data = { - [config.deviceMAC] = { + [utils.getDeviceMAC()] = { user_consent_records = { [config.application1.registerAppInterfaceParams.appID] = { external_consent_status_groups = { diff --git a/test_scripts/Policies/External_UCS/025_ATF_P_TC_LPT_Update_PreloadedPT_without_disallowed_by_external_consent_entities_off_struct.lua b/test_scripts/Policies/External_UCS/025_ATF_P_TC_LPT_Update_PreloadedPT_without_disallowed_by_external_consent_entities_off_struct.lua index 875e191117..63a6156821 100644 --- a/test_scripts/Policies/External_UCS/025_ATF_P_TC_LPT_Update_PreloadedPT_without_disallowed_by_external_consent_entities_off_struct.lua +++ b/test_scripts/Policies/External_UCS/025_ATF_P_TC_LPT_Update_PreloadedPT_without_disallowed_by_external_consent_entities_off_struct.lua @@ -30,9 +30,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/026_ATF_P_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct.lua b/test_scripts/Policies/External_UCS/026_ATF_P_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct.lua index e0bfb19255..305569027e 100644 --- a/test_scripts/Policies/External_UCS/026_ATF_P_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct.lua +++ b/test_scripts/Policies/External_UCS/026_ATF_P_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct.lua @@ -29,9 +29,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/027_ATF_P_TC_LPT_Update_PreloadedPT_without_disallowed_by_external_consent_entities_on_struct.lua b/test_scripts/Policies/External_UCS/027_ATF_P_TC_LPT_Update_PreloadedPT_without_disallowed_by_external_consent_entities_on_struct.lua index c5f4f0b24b..bb9e115d75 100644 --- a/test_scripts/Policies/External_UCS/027_ATF_P_TC_LPT_Update_PreloadedPT_without_disallowed_by_external_consent_entities_on_struct.lua +++ b/test_scripts/Policies/External_UCS/027_ATF_P_TC_LPT_Update_PreloadedPT_without_disallowed_by_external_consent_entities_on_struct.lua @@ -30,9 +30,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/028_ATF_P_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct.lua b/test_scripts/Policies/External_UCS/028_ATF_P_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct.lua index 7ce9473bd7..d5c57ee2ce 100644 --- a/test_scripts/Policies/External_UCS/028_ATF_P_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct.lua +++ b/test_scripts/Policies/External_UCS/028_ATF_P_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct.lua @@ -29,9 +29,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared Libraries ]] diff --git a/test_scripts/Policies/External_UCS/029_ATF_N_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua b/test_scripts/Policies/External_UCS/029_ATF_N_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua index e5b93f1dcd..90c6572caa 100644 --- a/test_scripts/Policies/External_UCS/029_ATF_N_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua +++ b/test_scripts/Policies/External_UCS/029_ATF_N_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_off_struct_with_invalid_type_of_params.lua @@ -27,9 +27,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 config.ExitOnCrash = false diff --git a/test_scripts/Policies/External_UCS/030_ATF_N_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua b/test_scripts/Policies/External_UCS/030_ATF_N_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua index 852e93e438..aa7083f2ff 100644 --- a/test_scripts/Policies/External_UCS/030_ATF_N_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua +++ b/test_scripts/Policies/External_UCS/030_ATF_N_TC_LPT_Update_PreloadedPT_with_disallowed_by_external_consent_entities_on_struct_with_invalid_type_of_params.lua @@ -27,9 +27,7 @@ -- -- Note: Script is designed for EXTERNAL_PROPRIETARY flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 config.ExitOnCrash = false diff --git a/test_scripts/Policies/External_UCS/External_Consent_OFF/007_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_data_consent_disallowed.lua b/test_scripts/Policies/External_UCS/External_Consent_OFF/007_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_data_consent_disallowed.lua index 5b804d9ce2..1324c01769 100644 --- a/test_scripts/Policies/External_UCS/External_Consent_OFF/007_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_data_consent_disallowed.lua +++ b/test_scripts/Policies/External_UCS/External_Consent_OFF/007_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_data_consent_disallowed.lua @@ -105,7 +105,10 @@ Test["TEST_NAME_OFF".."_Precondition_GetListOfPermissions"] = function(self) result = { code = 0, method = "SDL.GetListOfPermissions", - allowedFunctions = {{name = "ConsentGroup001", allowed = nil}}, + allowedFunctions = { + {name = "ConsentGroup001", allowed = nil}, + {name = "ConsentGroup002", allowed = nil} + }, externalConsentStatus = {} } }) diff --git a/test_scripts/Policies/External_UCS/External_Consent_OFF/008_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_user_consent_allowed.lua b/test_scripts/Policies/External_UCS/External_Consent_OFF/008_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_user_consent_allowed.lua index e0789e72b8..d22e6069b2 100644 --- a/test_scripts/Policies/External_UCS/External_Consent_OFF/008_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_user_consent_allowed.lua +++ b/test_scripts/Policies/External_UCS/External_Consent_OFF/008_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_user_consent_allowed.lua @@ -106,7 +106,10 @@ Test["TEST_NAME_OFF".."_Precondition_GetListOfPermissions"] = function(self) result = { code = 0, method = "SDL.GetListOfPermissions", - allowedFunctions = {{name = "ConsentGroup001", allowed = nil}}, + allowedFunctions = { + {name = "ConsentGroup001", allowed = nil}, + {name = "ConsentGroup002", allowed = nil} + }, externalConsentStatus = {} } }) diff --git a/test_scripts/Policies/External_UCS/External_Consent_OFF/009_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_user_consent_disallowed.lua b/test_scripts/Policies/External_UCS/External_Consent_OFF/009_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_user_consent_disallowed.lua index d887f90f1d..80dc9dda28 100644 --- a/test_scripts/Policies/External_UCS/External_Consent_OFF/009_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_user_consent_disallowed.lua +++ b/test_scripts/Policies/External_UCS/External_Consent_OFF/009_ATF_Policies_External_Consent_OFF_disallowed_by_external_consent_entities_omitted_user_consent_disallowed.lua @@ -106,7 +106,10 @@ Test["TEST_NAME_OFF".."_Precondition_GetListOfPermissions"] = function(self) result = { code = 0, method = "SDL.GetListOfPermissions", - allowedFunctions = {{name = "ConsentGroup001", allowed = nil}}, + allowedFunctions = { + {name = "ConsentGroup001", allowed = nil}, + {name = "ConsentGroup002", allowed = nil} + }, externalConsentStatus = {} } }) diff --git a/test_scripts/Policies/External_UCS/External_Consent_ON/007_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_data_consent_disallowed.lua b/test_scripts/Policies/External_UCS/External_Consent_ON/007_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_data_consent_disallowed.lua index 63f53a329a..0fa29c52fd 100644 --- a/test_scripts/Policies/External_UCS/External_Consent_ON/007_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_data_consent_disallowed.lua +++ b/test_scripts/Policies/External_UCS/External_Consent_ON/007_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_data_consent_disallowed.lua @@ -105,7 +105,10 @@ Test[TEST_NAME_ON .. "Precondition_GetListOfPermissions"] = function(self) result = { code = 0, method = "SDL.GetListOfPermissions", - allowedFunctions = {{name = "ConsentGroup001", allowed = nil}}, + allowedFunctions = { + {name = "ConsentGroup001", allowed = nil}, + {name = "ConsentGroup002", allowed = nil} + }, externalConsentStatus = {} } }) diff --git a/test_scripts/Policies/External_UCS/External_Consent_ON/008_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_allowed.lua b/test_scripts/Policies/External_UCS/External_Consent_ON/008_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_allowed.lua index f5aa4421b1..9ac8ff1fe5 100644 --- a/test_scripts/Policies/External_UCS/External_Consent_ON/008_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_allowed.lua +++ b/test_scripts/Policies/External_UCS/External_Consent_ON/008_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_allowed.lua @@ -105,7 +105,10 @@ Test[TEST_NAME_ON .. "Precondition_GetListOfPermissions"] = function(self) result = { code = 0, method = "SDL.GetListOfPermissions", - allowedFunctions = {{name = "ConsentGroup001", allowed = nil}}, + allowedFunctions = { + {name = "ConsentGroup001", allowed = nil}, + {name = "ConsentGroup002", allowed = nil} + }, externalConsentStatus = {} } }) diff --git a/test_scripts/Policies/External_UCS/External_Consent_ON/009_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_disallowed.lua b/test_scripts/Policies/External_UCS/External_Consent_ON/009_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_disallowed.lua index 69e18c938c..4e3b0323b8 100644 --- a/test_scripts/Policies/External_UCS/External_Consent_ON/009_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_disallowed.lua +++ b/test_scripts/Policies/External_UCS/External_Consent_ON/009_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_disallowed.lua @@ -105,7 +105,10 @@ Test[TEST_NAME_ON .. "Precondition_GetListOfPermissions"] = function(self) result = { code = 0, method = "SDL.GetListOfPermissions", - allowedFunctions = {{name = "ConsentGroup001", allowed = nil}}, + allowedFunctions = { + {name = "ConsentGroup001", allowed = nil}, + {name = "ConsentGroup002", allowed = nil} + }, externalConsentStatus = {} } }) diff --git a/test_scripts/Policies/External_UCS/External_Consent_ON/010_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_omitted.lua b/test_scripts/Policies/External_UCS/External_Consent_ON/010_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_omitted.lua index b687da46e3..9897e0f8c0 100644 --- a/test_scripts/Policies/External_UCS/External_Consent_ON/010_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_omitted.lua +++ b/test_scripts/Policies/External_UCS/External_Consent_ON/010_ATF_Policies_External_Consent_ON_disallowed_by_external_consent_entities_omitted_user_consent_omitted.lua @@ -105,7 +105,10 @@ Test[TEST_NAME_ON .. "Precondition_GetListOfPermissions"] = function(self) result = { code = 0, method = "SDL.GetListOfPermissions", - allowedFunctions = {{name = "ConsentGroup001", allowed = nil}}, + allowedFunctions = { + {name = "ConsentGroup001", allowed = nil}, + {name = "ConsentGroup002", allowed = nil} + }, externalConsentStatus = {} } }) diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/001_ATF_P_GetListofPermissions_with_appID_all_ecs_in_bound_EntitySatus_ON.lua b/test_scripts/Policies/External_UCS/Informing_HMI/001_ATF_P_GetListofPermissions_with_appID_all_ecs_in_bound_EntitySatus_ON.lua index d0a9ce7b1e..194880a01e 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/001_ATF_P_GetListofPermissions_with_appID_all_ecs_in_bound_EntitySatus_ON.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/001_ATF_P_GetListofPermissions_with_appID_all_ecs_in_bound_EntitySatus_ON.lua @@ -23,14 +23,11 @@ -- Expected result: -- SDL sends do HMI received from HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +41,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_AllParams_Valid() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/003_ATF_P_GetListofPermissions_with_appID_all_ecs_upper_bound_EntitySatus_ON.lua b/test_scripts/Policies/External_UCS/Informing_HMI/003_ATF_P_GetListofPermissions_with_appID_all_ecs_upper_bound_EntitySatus_ON.lua index 8860b41855..6bd3604d77 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/003_ATF_P_GetListofPermissions_with_appID_all_ecs_upper_bound_EntitySatus_ON.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/003_ATF_P_GetListofPermissions_with_appID_all_ecs_upper_bound_EntitySatus_ON.lua @@ -23,17 +23,13 @@ -- Expected result: -- SDL sends to HMI received from HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local variables ]] - local external_consent_status = {} for i =1, 100 do @@ -52,7 +48,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_AllParams_Upper() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/004_ATF_P_GetListofPermissions_with_appID_fake_param_cut_EntitySatus_ON.lua b/test_scripts/Policies/External_UCS/Informing_HMI/004_ATF_P_GetListofPermissions_with_appID_fake_param_cut_EntitySatus_ON.lua index b1c0dd67d7..ebf992945b 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/004_ATF_P_GetListofPermissions_with_appID_fake_param_cut_EntitySatus_ON.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/004_ATF_P_GetListofPermissions_with_appID_fake_param_cut_EntitySatus_ON.lua @@ -24,14 +24,11 @@ -- Expected result: -- SDL sends to HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -45,7 +42,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_FakeParam() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/005_ATF_P_GetListofPermissions_with_appID_all_ecs_in_bound_EntitySatus_OFF.lua b/test_scripts/Policies/External_UCS/Informing_HMI/005_ATF_P_GetListofPermissions_with_appID_all_ecs_in_bound_EntitySatus_OFF.lua index 8aebe6a4e4..48c7dd732f 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/005_ATF_P_GetListofPermissions_with_appID_all_ecs_in_bound_EntitySatus_OFF.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/005_ATF_P_GetListofPermissions_with_appID_all_ecs_in_bound_EntitySatus_OFF.lua @@ -23,14 +23,11 @@ -- Expected result: -- SDL sends to HMI received from HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +41,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_AllParams_Valid() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/006_ATF_P_GetListofPermissions_with_appID_all_ecs_lower_bound_EntitySatus_OFF.lua b/test_scripts/Policies/External_UCS/Informing_HMI/006_ATF_P_GetListofPermissions_with_appID_all_ecs_lower_bound_EntitySatus_OFF.lua index fdc552cb59..719089679d 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/006_ATF_P_GetListofPermissions_with_appID_all_ecs_lower_bound_EntitySatus_OFF.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/006_ATF_P_GetListofPermissions_with_appID_all_ecs_lower_bound_EntitySatus_OFF.lua @@ -23,14 +23,11 @@ -- Expected result: -- SDL sends to HMI received from HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +41,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_AllParams_Lower() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/007_ATF_P_GetListofPermissions_with_appID_all_ecs_upper_bound_EntitySatus_OFF.lua b/test_scripts/Policies/External_UCS/Informing_HMI/007_ATF_P_GetListofPermissions_with_appID_all_ecs_upper_bound_EntitySatus_OFF.lua index 1958552eb8..7422453cd1 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/007_ATF_P_GetListofPermissions_with_appID_all_ecs_upper_bound_EntitySatus_OFF.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/007_ATF_P_GetListofPermissions_with_appID_all_ecs_upper_bound_EntitySatus_OFF.lua @@ -23,14 +23,11 @@ -- Expected result: -- SDL sends to HMI received from HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local variables ]] @@ -52,7 +49,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_AllParams_Upper() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/008_ATF_P_GetListofPermissions_with_appID_fake_param_cut_EntitySatus_OFF.lua b/test_scripts/Policies/External_UCS/Informing_HMI/008_ATF_P_GetListofPermissions_with_appID_fake_param_cut_EntitySatus_OFF.lua index 46734eb4ef..50cdb240e5 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/008_ATF_P_GetListofPermissions_with_appID_fake_param_cut_EntitySatus_OFF.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/008_ATF_P_GetListofPermissions_with_appID_fake_param_cut_EntitySatus_OFF.lua @@ -24,14 +24,11 @@ -- Expected result: -- SDL sends to HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -45,7 +42,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_FakeParam() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/009_ATF_P_GetListofPermissions_with_appID_not_stored_ecs.lua b/test_scripts/Policies/External_UCS/Informing_HMI/009_ATF_P_GetListofPermissions_with_appID_not_stored_ecs.lua index bcab4d6c35..e466d4f081 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/009_ATF_P_GetListofPermissions_with_appID_not_stored_ecs.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/009_ATF_P_GetListofPermissions_with_appID_not_stored_ecs.lua @@ -22,14 +22,11 @@ -- Expected result: -- SDL sends to HMI empty array --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +40,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_Empty() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/010_ATF_P_GetListofPermissions_no_appID_stored_ecs_present.lua b/test_scripts/Policies/External_UCS/Informing_HMI/010_ATF_P_GetListofPermissions_no_appID_stored_ecs_present.lua index 733db172a4..7d1b434aff 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/010_ATF_P_GetListofPermissions_no_appID_stored_ecs_present.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/010_ATF_P_GetListofPermissions_no_appID_stored_ecs_present.lua @@ -23,14 +23,11 @@ -- Expected result: -- SDL sends to HMI received from HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +41,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_AllParams() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/011_ATF_P_GetListofPermissions_no_appID_not_stored_ecs.lua b/test_scripts/Policies/External_UCS/Informing_HMI/011_ATF_P_GetListofPermissions_no_appID_not_stored_ecs.lua index 373ea9584d..0ddfe7f3ec 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/011_ATF_P_GetListofPermissions_no_appID_not_stored_ecs.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/011_ATF_P_GetListofPermissions_no_appID_not_stored_ecs.lua @@ -22,14 +22,11 @@ -- Expected result: -- SDL sends to HMI empty array --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +40,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_Empty() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/012_ATF_N_GetListofPermissions_no_appID_no_app_registered_stored_ecs.lua b/test_scripts/Policies/External_UCS/Informing_HMI/012_ATF_N_GetListofPermissions_no_appID_no_app_registered_stored_ecs.lua index 6da31bacfb..e15dcc6364 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/012_ATF_N_GetListofPermissions_no_appID_no_app_registered_stored_ecs.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/012_ATF_N_GetListofPermissions_no_appID_no_app_registered_stored_ecs.lua @@ -24,14 +24,11 @@ -- SDL invalidates the appID and cuts it off, the GetListOfPermissions request is treated as if sent without appID -- SDL sends to HMI received from HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -45,7 +42,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_AllParams() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/013_ATF_N_GetListofPermissions_no_appID_no_app_registered_not_stored_ecs.lua b/test_scripts/Policies/External_UCS/Informing_HMI/013_ATF_N_GetListofPermissions_no_appID_no_app_registered_not_stored_ecs.lua index a0a01d3567..6f3bace400 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/013_ATF_N_GetListofPermissions_no_appID_no_app_registered_not_stored_ecs.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/013_ATF_N_GetListofPermissions_no_appID_no_app_registered_not_stored_ecs.lua @@ -23,14 +23,11 @@ -- SDL invalidates the appID and cuts it off, the GetListOfPermissions request is treated as if sent without appID -- SDL sends to HMI empty array --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +41,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_Empty() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/014_ATF_N_GetListofPermissions_no_appID_app_unregistered_stored_ecs.lua b/test_scripts/Policies/External_UCS/Informing_HMI/014_ATF_N_GetListofPermissions_no_appID_app_unregistered_stored_ecs.lua index 73c078cddc..ba59810abe 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/014_ATF_N_GetListofPermissions_no_appID_app_unregistered_stored_ecs.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/014_ATF_N_GetListofPermissions_no_appID_app_unregistered_stored_ecs.lua @@ -25,15 +25,12 @@ -- SDL invalidates the appID and cuts it off, the GetListOfPermissions request is treated as if sent without appID -- SDL sends to HMI received from HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local mobile_session = require('mobile_session') +local utils = require ('user_modules/utils') local hmi_appid --[[ General Precondition before ATF start ]] @@ -48,7 +45,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_AllParams_First_Application() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/015_ATF_N_GetListofPermissions_no_appID_app_unregistered_not_stored_ecs.lua b/test_scripts/Policies/External_UCS/Informing_HMI/015_ATF_N_GetListofPermissions_no_appID_app_unregistered_not_stored_ecs.lua index 91c0c56bdd..669b7df92e 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/015_ATF_N_GetListofPermissions_no_appID_app_unregistered_not_stored_ecs.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/015_ATF_N_GetListofPermissions_no_appID_app_unregistered_not_stored_ecs.lua @@ -24,15 +24,12 @@ -- SDL invalidates the appID and cuts it off, the GetListOfPermissions request is treated as if sent without appID -- SDL sends to HMI empty array --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local mobile_session = require('mobile_session') +local utils = require ('user_modules/utils') local hmi_appid --[[ General Precondition before ATF start ]] @@ -47,7 +44,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_Empty_First_Application() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/016_ATF_N_GetListofPermissions_empty_due_to_missing_entity_type_OnAppPermissionChange.lua b/test_scripts/Policies/External_UCS/Informing_HMI/016_ATF_N_GetListofPermissions_empty_due_to_missing_entity_type_OnAppPermissionChange.lua index 61dcd66099..a146a313e6 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/016_ATF_N_GetListofPermissions_empty_due_to_missing_entity_type_OnAppPermissionChange.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/016_ATF_N_GetListofPermissions_empty_due_to_missing_entity_type_OnAppPermissionChange.lua @@ -23,9 +23,7 @@ -- Expected result: -- SDL sends to HMI empty array --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" -- ToDo (vvvakulenko): remove after issue "ATF does not stop HB timers by closing session and connection" is resolved config.defaultProtocolVersion = 2 @@ -34,6 +32,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -49,7 +48,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_entityType_missing() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/017_ATF_N_GetListofPermissions_empty_due_to_missing_entityID_OnAppPermissionChange.lua b/test_scripts/Policies/External_UCS/Informing_HMI/017_ATF_N_GetListofPermissions_empty_due_to_missing_entityID_OnAppPermissionChange.lua index 1cd23d64c5..99bac80da1 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/017_ATF_N_GetListofPermissions_empty_due_to_missing_entityID_OnAppPermissionChange.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/017_ATF_N_GetListofPermissions_empty_due_to_missing_entityID_OnAppPermissionChange.lua @@ -23,9 +23,7 @@ -- Expected result: -- SDL sends to HMI empty array --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" -- ToDo (vvvakulenko): remove after issue "ATF does not stop HB timers by closing session and connection" is resolved config.defaultProtocolVersion = 2 @@ -34,6 +32,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -49,7 +48,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_entityID_missing() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/018_ATF_N_GetListofPermissions_empty_due_to_missing_status_OnAppPermissionChange.lua b/test_scripts/Policies/External_UCS/Informing_HMI/018_ATF_N_GetListofPermissions_empty_due_to_missing_status_OnAppPermissionChange.lua index cfd20a4d9f..1f43d297be 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/018_ATF_N_GetListofPermissions_empty_due_to_missing_status_OnAppPermissionChange.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/018_ATF_N_GetListofPermissions_empty_due_to_missing_status_OnAppPermissionChange.lua @@ -22,10 +22,7 @@ -- -- Expected result: -- SDL sends to HMI empty array ---------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +-----------------------------------------------------------------------------------------------[[ General configuration parameters ]] -- ToDo (vvvakulenko): remove after issue "ATF does not stop HB timers by closing session and connection" is resolved config.defaultProtocolVersion = 2 @@ -34,6 +31,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -49,7 +47,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PTU_and_OnAppPermissionConsent_entityStatus_missing() diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/019_ATF_N_GetListofPermissions_empty_due_to_invalid_param_entityType_OnAppPermissionChange.lua b/test_scripts/Policies/External_UCS/Informing_HMI/019_ATF_N_GetListofPermissions_empty_due_to_invalid_param_entityType_OnAppPermissionChange.lua index 0c7a796529..dda91b0075 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/019_ATF_N_GetListofPermissions_empty_due_to_invalid_param_entityType_OnAppPermissionChange.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/019_ATF_N_GetListofPermissions_empty_due_to_invalid_param_entityType_OnAppPermissionChange.lua @@ -25,9 +25,7 @@ -- Expected result: -- SDL sends to HMI empty array --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" -- ToDo (vvvakulenko): remove after issue "ATF does not stop HB timers by closing session and connection" is resolved config.defaultProtocolVersion = 2 @@ -36,6 +34,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[Local Variables]] local params_invalid_data = @@ -65,7 +64,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end for i = 1, #params_invalid_data do diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/020_ATF_N_GetListofPermissions_empty_due_to_invalid_param_entityID_OnAppPermissionChange.lua b/test_scripts/Policies/External_UCS/Informing_HMI/020_ATF_N_GetListofPermissions_empty_due_to_invalid_param_entityID_OnAppPermissionChange.lua index 380c531da4..76f148206f 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/020_ATF_N_GetListofPermissions_empty_due_to_invalid_param_entityID_OnAppPermissionChange.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/020_ATF_N_GetListofPermissions_empty_due_to_invalid_param_entityID_OnAppPermissionChange.lua @@ -25,9 +25,7 @@ -- Expected result: -- SDL sends to HMI empty array --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" -- ToDo (vvvakulenko): remove after issue "ATF does not stop HB timers by closing session and connection" is resolved config.defaultProtocolVersion = 2 @@ -36,6 +34,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[Local Variables]] local params_invalid_data = @@ -65,7 +64,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end for i = 1, #params_invalid_data do diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/021_ATF_N_GetListofPermissions_empty_due_to_invalid_param_status_OnAppPermissionChange.lua b/test_scripts/Policies/External_UCS/Informing_HMI/021_ATF_N_GetListofPermissions_empty_due_to_invalid_param_status_OnAppPermissionChange.lua index 33d0f7de92..0506707797 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/021_ATF_N_GetListofPermissions_empty_due_to_invalid_param_status_OnAppPermissionChange.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/021_ATF_N_GetListofPermissions_empty_due_to_invalid_param_status_OnAppPermissionChange.lua @@ -25,9 +25,7 @@ -- Expected result: -- SDL sends to HMI empty array --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" -- ToDo (vvvakulenko): remove after issue "ATF does not stop HB timers by closing session and connection" is resolved config.defaultProtocolVersion = 2 @@ -36,6 +34,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[Local Variables]] local params_invalid_data = @@ -67,7 +66,7 @@ require('user_modules/AppTypes') function Test:Precondition_trigger_getting_device_consent() testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, - config.deviceMAC) + utils.getDeviceMAC()) end for i = 1, #params_invalid_data do diff --git a/test_scripts/Policies/External_UCS/Informing_HMI/022_ATF_N_OnAppPermissionConsent_not_sent_when_no_PTU.lua b/test_scripts/Policies/External_UCS/Informing_HMI/022_ATF_N_OnAppPermissionConsent_not_sent_when_no_PTU.lua index a448728aa0..f84f561f48 100644 --- a/test_scripts/Policies/External_UCS/Informing_HMI/022_ATF_N_OnAppPermissionConsent_not_sent_when_no_PTU.lua +++ b/test_scripts/Policies/External_UCS/Informing_HMI/022_ATF_N_OnAppPermissionConsent_not_sent_when_no_PTU.lua @@ -22,15 +22,12 @@ -- PTU is triggered -- HMI notification SDL.OnAppPermissionChanged is not sent --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +41,7 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Test") function Test:TestStep_No_PTU_No_OnAppPermissionConsent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) EXPECT_HMINOTIFICATION("SDL.OnAppPermissionChanged"):Times(0) commonTestCases:DelayedExp(10000) end diff --git a/test_scripts/Policies/Policies_Security/119_ATF_P_Policies_Performance_Requirement.lua b/test_scripts/Policies/Policies_Security/119_ATF_P_Policies_Performance_Requirement.lua index d29f4fc35e..3a6830e63f 100644 --- a/test_scripts/Policies/Policies_Security/119_ATF_P_Policies_Performance_Requirement.lua +++ b/test_scripts/Policies/Policies_Security/119_ATF_P_Policies_Performance_Requirement.lua @@ -13,9 +13,7 @@ -- Expected result -- SDL must correctly finish the PTU --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] @@ -23,6 +21,7 @@ local mobile_session = require("mobile_session") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local json = require("modules/json") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local app_id = config.application1.registerAppInterfaceParams.appID @@ -208,7 +207,7 @@ function Test:Activate_App() :Do( function() log("SDL->HMI: RS: SDL.GetUserFriendlyMessage") - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) log("HMI->SDL: N: SDL.OnAllowSDLFunctionality") EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do( diff --git a/test_scripts/Policies/Policies_Security/120_ATF_PolicyTable_Certificate_EMPTY_value.lua b/test_scripts/Policies/Policies_Security/120_ATF_PolicyTable_Certificate_EMPTY_value.lua index b7813f9a8b..629b75178b 100644 --- a/test_scripts/Policies/Policies_Security/120_ATF_PolicyTable_Certificate_EMPTY_value.lua +++ b/test_scripts/Policies/Policies_Security/120_ATF_PolicyTable_Certificate_EMPTY_value.lua @@ -1,12 +1,11 @@ ----- Name of requirement that is covered----- ----- [Security]: SDL behavior in case 'certificates' field is empty - ----- Description: + ----- Description: ----- Certificate have empty value in sdl_preloaded_pt JSON of module_config section ----- Expected result------ ----- SDL must continue working as assigned. ------------------------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 @@ -51,7 +50,7 @@ local function UpdatePreloadedJson_CertificateValue_Empty() if data.policy_table.functional_groupings["DataConsent-2"] then data.policy_table.functional_groupings["DataConsent-2"] = nil end - + data.policy_table.module_config.certificate = "" data = json.encode(data) @@ -126,6 +125,6 @@ function Test.Postcondition_SDLStop() end function Test.Postcondition_Restore_preloaded() commonPreconditions:RestoreFile("sdl_preloaded_pt.json") -end +end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Policy_Table_Update/121_ATF_PTU_AppID_NotListed_PT_DeviceConsented_SecondApp.lua b/test_scripts/Policies/Policy_Table_Update/121_ATF_PTU_AppID_NotListed_PT_DeviceConsented_SecondApp.lua index ff2f75802d..3b3b6b6188 100644 --- a/test_scripts/Policies/Policy_Table_Update/121_ATF_PTU_AppID_NotListed_PT_DeviceConsented_SecondApp.lua +++ b/test_scripts/Policies/Policy_Table_Update/121_ATF_PTU_AppID_NotListed_PT_DeviceConsented_SecondApp.lua @@ -18,15 +18,12 @@ -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) -- SDL->HMI: BasicCommunication.PolicyUpdate --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -46,7 +43,7 @@ local mobile_session = require('mobile_session') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_flow_SUCCEESS_EXTERNAL_PROPRIETARY() @@ -77,7 +74,7 @@ function Test:TestStep_PTU_AppID_SecondApp_NotListed_PT() config.application1.registerAppInterfaceParams.appID, config.application2.registerAppInterfaceParams.appID, }, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app1_id, hmi_app2_id}) local timeout_after_x_seconds = testCasesForPolicyTableSnapshot:get_data_from_PTS("module_config.timeout_after_x_seconds") diff --git a/test_scripts/Policies/Policy_Table_Update/122_ATF_PTU_NotSuccessful_AppID_ListedPT_NewIgnCycle.lua b/test_scripts/Policies/Policy_Table_Update/122_ATF_PTU_NotSuccessful_AppID_ListedPT_NewIgnCycle.lua index d254085fa1..fd58af3c64 100644 --- a/test_scripts/Policies/Policy_Table_Update/122_ATF_PTU_NotSuccessful_AppID_ListedPT_NewIgnCycle.lua +++ b/test_scripts/Policies/Policy_Table_Update/122_ATF_PTU_NotSuccessful_AppID_ListedPT_NewIgnCycle.lua @@ -20,15 +20,12 @@ -- PTU is requested. PTS is created. -- SDL-> HMI: SDL.PolicyUpdate() --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ Local Variables ]] local hmi_app_id1, hmi_app_id2 @@ -49,7 +46,7 @@ local mobile_session = require('mobile_session') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_flow_SUCCEESS_EXTERNAL_PROPRIETARY() @@ -76,7 +73,7 @@ function Test:Precondition_RegisterNewApplication() :Do(function(_,_data3) testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID, config.application2.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app_id1, hmi_app_id2}) local timeout_after_x_seconds = testCasesForPolicyTableSnapshot:get_data_from_PTS("module_config.timeout_after_x_seconds") @@ -147,7 +144,7 @@ function Test:TestStep_PTU_NotSuccessful_AppID_ListedPT_NewIgnCycle() :Do(function(_,_data4) testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID, config.application2.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app_id1, hmi_app_id2}) local timeout_after_x_seconds = testCasesForPolicyTableSnapshot:get_data_from_PTS("module_config.timeout_after_x_seconds") diff --git a/test_scripts/Policies/Policy_Table_Update/123_ATF_PTU_DeviceConsent_from_User.lua b/test_scripts/Policies/Policy_Table_Update/123_ATF_PTU_DeviceConsent_from_User.lua index 1423a5ed2c..81df7d428b 100644 --- a/test_scripts/Policies/Policy_Table_Update/123_ATF_PTU_DeviceConsent_from_User.lua +++ b/test_scripts/Policies/Policy_Table_Update/123_ATF_PTU_DeviceConsent_from_User.lua @@ -16,14 +16,11 @@ -- PTU is requested. PTS is created. -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Functions ]] local function check_file_exists(name) @@ -58,7 +55,7 @@ function Test:ActivateApp() EXPECT_HMIRESPONSE(requestId2) :Do(function(_, _) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/Policy_Table_Update/124_ATF_User_requests_PTU.lua b/test_scripts/Policies/Policy_Table_Update/124_ATF_User_requests_PTU.lua index a1179c6601..a1dfda4850 100644 --- a/test_scripts/Policies/Policy_Table_Update/124_ATF_User_requests_PTU.lua +++ b/test_scripts/Policies/Policy_Table_Update/124_ATF_User_requests_PTU.lua @@ -19,15 +19,12 @@ -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) -- SDL->HMI: BasicCommunication.PolicyUpdate --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +40,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_trigger_getting_device_consent() @@ -69,7 +66,7 @@ function Test:TestStep_User_requests_PTU() :Do(function(_,data) testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app1_id}) local timeout_after_x_seconds = testCasesForPolicyTableSnapshot:get_data_from_PTS("module_config.timeout_after_x_seconds") diff --git a/test_scripts/Policies/Policy_Table_Update/125_ATF_User_PressButton_HMI_PTU.lua b/test_scripts/Policies/Policy_Table_Update/125_ATF_User_PressButton_HMI_PTU.lua index 80fb9d6988..985a9a29cc 100644 --- a/test_scripts/Policies/Policy_Table_Update/125_ATF_User_PressButton_HMI_PTU.lua +++ b/test_scripts/Policies/Policy_Table_Update/125_ATF_User_PressButton_HMI_PTU.lua @@ -18,15 +18,12 @@ -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) -- SDL->HMI: BasicCommunication.PolicyUpdate --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed @@ -41,7 +38,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_flow_SUCCEESS_EXTERNAL_PROPRIETARY() @@ -68,7 +65,7 @@ function Test:TC_User_PressButton_HMI_PTU() :Do(function(_,data) testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app1_id}) local timeout_after_x_seconds = testCasesForPolicyTableSnapshot:get_data_from_PTS("module_config.timeout_after_x_seconds") diff --git a/test_scripts/Policies/Policy_Table_Update/126_ATF_OnStatusUpdate_UPDATE_NEEDED_new_PTU_request.lua b/test_scripts/Policies/Policy_Table_Update/126_ATF_OnStatusUpdate_UPDATE_NEEDED_new_PTU_request.lua index e81cf17661..29edaed4f5 100644 --- a/test_scripts/Policies/Policy_Table_Update/126_ATF_OnStatusUpdate_UPDATE_NEEDED_new_PTU_request.lua +++ b/test_scripts/Policies/Policy_Table_Update/126_ATF_OnStatusUpdate_UPDATE_NEEDED_new_PTU_request.lua @@ -18,15 +18,12 @@ -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) -- SDL->HMI: BasicCommunication.PolicyUpdate --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonTestCases = require ('user_modules/shared_testcases/commonTestCases') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +40,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_flow_SUCCEESS_EXTERNAL_PROPRIETARY() diff --git a/test_scripts/Policies/Policy_Table_Update/127_ATF_PTS_Creation_rule.lua b/test_scripts/Policies/Policy_Table_Update/127_ATF_PTS_Creation_rule.lua index e046534098..8d2345f5cc 100644 --- a/test_scripts/Policies/Policy_Table_Update/127_ATF_PTS_Creation_rule.lua +++ b/test_scripts/Policies/Policy_Table_Update/127_ATF_PTS_Creation_rule.lua @@ -14,15 +14,12 @@ -- Expected result: -- PTU is requested. PTS is created. --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -40,7 +37,6 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Test") function Test:TestStep_PTS_Creation_rule() local hmi_app1_id = self.applications[config.application1.registerAppInterfaceParams.appName] - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local result = true local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) @@ -54,14 +50,14 @@ function Test:TestStep_PTS_Creation_rule() testCasesForPolicyTable.time_trigger = timestamp() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) EXPECT_HMICALL("BasicCommunication.PolicyUpdate", { file = "/tmp/fs/mp/images/ivsu_cache/sdl_snapshot.json" }) :Do(function(_,data) result = testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app1_id}, "print") diff --git a/test_scripts/Policies/Policy_Table_Update/128_ATF_PTU_GetURLs.lua b/test_scripts/Policies/Policy_Table_Update/128_ATF_PTU_GetURLs.lua index 6dbab6f1f0..cba025497d 100644 --- a/test_scripts/Policies/Policy_Table_Update/128_ATF_PTU_GetURLs.lua +++ b/test_scripts/Policies/Policy_Table_Update/128_ATF_PTU_GetURLs.lua @@ -16,15 +16,12 @@ -- PTU is requested. PTS is created. -- SDL.GetURLs({urls[] = registered_App1, default}) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -41,7 +38,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/129_ATF_HMI_sends_GetURLs_one_app_registered.lua b/test_scripts/Policies/Policy_Table_Update/129_ATF_HMI_sends_GetURLs_one_app_registered.lua index 42791bfba5..e079421d67 100644 --- a/test_scripts/Policies/Policy_Table_Update/129_ATF_HMI_sends_GetURLs_one_app_registered.lua +++ b/test_scripts/Policies/Policy_Table_Update/129_ATF_HMI_sends_GetURLs_one_app_registered.lua @@ -16,15 +16,12 @@ -- PTU is requested. PTS is created. -- SDL.GetURLs({urls[] = registered_App1, default}) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -42,7 +39,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/130_ATF_HMI_sends_GetURLs_no_app_registered.lua b/test_scripts/Policies/Policy_Table_Update/130_ATF_HMI_sends_GetURLs_no_app_registered.lua index d912a9c6ec..50e79ce4e8 100644 --- a/test_scripts/Policies/Policy_Table_Update/130_ATF_HMI_sends_GetURLs_no_app_registered.lua +++ b/test_scripts/Policies/Policy_Table_Update/130_ATF_HMI_sends_GetURLs_no_app_registered.lua @@ -18,15 +18,12 @@ -- PTU is requested. PTS is created. -- SDL.GetURLs({urls[] = default}) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +41,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_flow_PTU_SUCCEESS_EXTERNAL_PROPRIETARY() diff --git a/test_scripts/Policies/Policy_Table_Update/131_ATF_PTS_storage_on_file_system.lua b/test_scripts/Policies/Policy_Table_Update/131_ATF_PTS_storage_on_file_system.lua index 1952fb3d04..f2c08f7dfa 100644 --- a/test_scripts/Policies/Policy_Table_Update/131_ATF_PTS_storage_on_file_system.lua +++ b/test_scripts/Policies/Policy_Table_Update/131_ATF_PTS_storage_on_file_system.lua @@ -14,15 +14,12 @@ -- The policies manager must store the PT snapshot as a JSON file which filename and -- filepath are defined in "PathToSnapshot" parameter of smartDeviceLink.ini file. --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -41,7 +38,6 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_PTS_Storage_On_File_System() local SystemFilesPath = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") local PathToSnapshot = commonFunctions:read_parameter_from_smart_device_link_ini("PathToSnapshot") - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) EXPECT_HMIRESPONSE(RequestId) @@ -52,7 +48,7 @@ function Test:TestStep_PTS_Storage_On_File_System() :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) local function check_snapshot() if ( commonSteps:file_exists( SystemFilesPath..'/' .. PathToSnapshot) == false ) then self:FailTestCase(SystemFilesPath..'/' .. PathToSnapshot.."sdl_snapshot.json doesn't exist!") diff --git a/test_scripts/Policies/Policy_Table_Update/132_ATF_Timeout_to_wait_response_PTU.lua b/test_scripts/Policies/Policy_Table_Update/132_ATF_Timeout_to_wait_response_PTU.lua index c451e28afc..6a3c21b94d 100644 --- a/test_scripts/Policies/Policy_Table_Update/132_ATF_Timeout_to_wait_response_PTU.lua +++ b/test_scripts/Policies/Policy_Table_Update/132_ATF_Timeout_to_wait_response_PTU.lua @@ -14,15 +14,12 @@ -- To define the timeout to wait a response on PTU, Policies manager must refer PTS -- "module_config" section, key . --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -41,7 +38,6 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_PTS_Timeout_wait_response_PTU() local is_test_fail = false local hmi_app_id = self.applications[config.application1.registerAppInterfaceParams.appName] - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) EXPECT_HMIRESPONSE(RequestId) @@ -51,14 +47,14 @@ function Test:TestStep_PTS_Timeout_wait_response_PTU() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) end) EXPECT_HMICALL("BasicCommunication.PolicyUpdate",{}) :Do(function(_,data) testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app_id}) local timeout_after_x_seconds = testCasesForPolicyTableSnapshot:get_data_from_Preloaded_PT("module_config.timeout_after_x_seconds") @@ -79,4 +75,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Policy_Table_Update/133_ATF_PTU_retry_timeout_definition.lua b/test_scripts/Policies/Policy_Table_Update/133_ATF_PTU_retry_timeout_definition.lua index 739d65e74a..06553738ec 100644 --- a/test_scripts/Policies/Policy_Table_Update/133_ATF_PTU_retry_timeout_definition.lua +++ b/test_scripts/Policies/Policy_Table_Update/133_ATF_PTU_retry_timeout_definition.lua @@ -15,16 +15,13 @@ -- Number and values of the "retry" elements are provided as appropriate elements in -- "seconds_between_retries" section of Local PT. --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +40,6 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Test") function Test:TestStep_PTS_Timeout_wait_response_PTU() local hmi_app_id = self.applications[config.application1.registerAppInterfaceParams.appName] - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) EXPECT_HMIRESPONSE(RequestId) @@ -53,14 +49,14 @@ function Test:TestStep_PTS_Timeout_wait_response_PTU() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) EXPECT_HMICALL("BasicCommunication.PolicyUpdate",{}) :Do(function(_,_) testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app_id}) local seconds_between_retries_pts = testCasesForPolicyTableSnapshot.seconds_between_retries local seconds_between_retries_preloaded = {} @@ -92,4 +88,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Policy_Table_Update/134_ATF_WiFi_one_application_registered.lua b/test_scripts/Policies/Policy_Table_Update/134_ATF_WiFi_one_application_registered.lua index b33938cc86..149e950be9 100644 --- a/test_scripts/Policies/Policy_Table_Update/134_ATF_WiFi_one_application_registered.lua +++ b/test_scripts/Policies/Policy_Table_Update/134_ATF_WiFi_one_application_registered.lua @@ -19,15 +19,12 @@ -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) -- SDL-> HMI: SDL.PolicyUpdate() --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -42,7 +39,7 @@ local mobile_session = require('mobile_session') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_Getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_flow_SUCCEESS_EXTERNAL_PROPRIETARY() @@ -73,7 +70,7 @@ function Test:TestStep_PTU_AppID_NotListed_PT_WiFi() :Do(function(_,_data1) testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID, config.application1.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app_id1, hmi_app_id2}) local timeout_after_x_seconds = testCasesForPolicyTableSnapshot:get_data_from_PTS("module_config.timeout_after_x_seconds") diff --git a/test_scripts/Policies/Policy_Table_Update/135_ATF_PM_sends_PTS_to_HMI.lua b/test_scripts/Policies/Policy_Table_Update/135_ATF_PM_sends_PTS_to_HMI.lua index 02c3fdb912..6e37c76cc4 100644 --- a/test_scripts/Policies/Policy_Table_Update/135_ATF_PM_sends_PTS_to_HMI.lua +++ b/test_scripts/Policies/Policy_Table_Update/135_ATF_PM_sends_PTS_to_HMI.lua @@ -14,15 +14,12 @@ -- Expected result: -- SDL->HMI:SDL.PolicyUpdate(file, timeout, retry[]) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +40,6 @@ commonFunctions:newTestCasesGroup("Preconditions") function Test:TestStep_PolicyManager_sends_PTS_to_HMI() local is_test_fail = false local hmi_app_id = self.applications[config.application1.registerAppInterfaceParams.appName] - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) EXPECT_HMIRESPONSE(RequestId) @@ -54,13 +50,13 @@ function Test:TestStep_PolicyManager_sends_PTS_to_HMI() :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) EXPECT_HMICALL("BasicCommunication.PolicyUpdate",{}) :Do(function(_,data) testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app_id}) local SystemFilesPath = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") @@ -84,4 +80,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Policy_Table_Update/136_ATF_Define_urls_PTS_will_sent_hmi.lua b/test_scripts/Policies/Policy_Table_Update/136_ATF_Define_urls_PTS_will_sent_hmi.lua index fb65e52977..3d10aebaec 100644 --- a/test_scripts/Policies/Policy_Table_Update/136_ATF_Define_urls_PTS_will_sent_hmi.lua +++ b/test_scripts/Policies/Policy_Table_Update/136_ATF_Define_urls_PTS_will_sent_hmi.lua @@ -17,14 +17,11 @@ -- Expected result: -- SDL.GetURLs({urls[] = default}, (, appID)) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -42,7 +39,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -81,4 +78,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Policy_Table_Update/137_ATF_Sending_PTS_to_mobile_application.lua b/test_scripts/Policies/Policy_Table_Update/137_ATF_Sending_PTS_to_mobile_application.lua index 8fa77b7d2c..e37dfb277d 100644 --- a/test_scripts/Policies/Policy_Table_Update/137_ATF_Sending_PTS_to_mobile_application.lua +++ b/test_scripts/Policies/Policy_Table_Update/137_ATF_Sending_PTS_to_mobile_application.lua @@ -20,15 +20,14 @@ -- Expected result: -- SDL->app: OnSystemRequest ('url', requestType:PROPRIETARY, fileType="JSON", appID) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local mobile_session = require("mobile_session") local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -85,7 +84,7 @@ function Test:Trigger_getting_device_consent() EXPECT_HMIRESPONSE(requestId2) :Do( function() - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do( function(_, d2) diff --git a/test_scripts/Policies/Policy_Table_Update/138_ATF_Sending_PTS_to_app_OnSystemRequest_appID_default.lua b/test_scripts/Policies/Policy_Table_Update/138_ATF_Sending_PTS_to_app_OnSystemRequest_appID_default.lua index 0a2a8839b3..0d62ec3f8b 100644 --- a/test_scripts/Policies/Policy_Table_Update/138_ATF_Sending_PTS_to_app_OnSystemRequest_appID_default.lua +++ b/test_scripts/Policies/Policy_Table_Update/138_ATF_Sending_PTS_to_app_OnSystemRequest_appID_default.lua @@ -24,15 +24,12 @@ -- -- SDL->: OnSystemRequest ('url', requestType:PROPRIETARY, fileType="JSON") --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local mobileSession = require("mobile_session") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local r_actual = { } @@ -54,7 +51,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:StartNewSession() diff --git a/test_scripts/Policies/Policy_Table_Update/139_ATF_PoliciesManager_changes_status_UPDATING.lua b/test_scripts/Policies/Policy_Table_Update/139_ATF_PoliciesManager_changes_status_UPDATING.lua index c581fc3047..569bd17b45 100644 --- a/test_scripts/Policies/Policy_Table_Update/139_ATF_PoliciesManager_changes_status_UPDATING.lua +++ b/test_scripts/Policies/Policy_Table_Update/139_ATF_PoliciesManager_changes_status_UPDATING.lua @@ -21,14 +21,11 @@ -- Expected result: -- SDL->HMI: SDL.OnStatusUpdate(UPDATING) right after SDL->app: OnSystemRequest --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -45,7 +42,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/140_ATF_timeout_countdown_start.lua b/test_scripts/Policies/Policy_Table_Update/140_ATF_timeout_countdown_start.lua index 2240824555..45fca43e28 100644 --- a/test_scripts/Policies/Policy_Table_Update/140_ATF_timeout_countdown_start.lua +++ b/test_scripts/Policies/Policy_Table_Update/140_ATF_timeout_countdown_start.lua @@ -22,16 +22,13 @@ -- SDL waits for SystemRequest response from within 'timeout' value, if no obtained, -- it starts retry sequence --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -48,7 +45,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/141_ATF_Got_PTU_from_mobile_application.lua b/test_scripts/Policies/Policy_Table_Update/141_ATF_Got_PTU_from_mobile_application.lua index 888baba6d8..1ff4926e20 100644 --- a/test_scripts/Policies/Policy_Table_Update/141_ATF_Got_PTU_from_mobile_application.lua +++ b/test_scripts/Policies/Policy_Table_Update/141_ATF_Got_PTU_from_mobile_application.lua @@ -22,15 +22,12 @@ -- Expected result: -- SDL->HMI: SystemRequest(requestType=PROPRIETARY, fileName, appID) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -47,7 +44,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/142_ATF_PoliciesManager_changes_status_to_UP_TO_DATE.lua b/test_scripts/Policies/Policy_Table_Update/142_ATF_PoliciesManager_changes_status_to_UP_TO_DATE.lua index a54b0f942e..5f9d6954f5 100644 --- a/test_scripts/Policies/Policy_Table_Update/142_ATF_PoliciesManager_changes_status_to_UP_TO_DATE.lua +++ b/test_scripts/Policies/Policy_Table_Update/142_ATF_PoliciesManager_changes_status_to_UP_TO_DATE.lua @@ -26,14 +26,11 @@ -- Expected result: -- SDL->HMI: OnStatusUpdate(UP_TO_DATE) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -50,7 +47,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/143_ATF_PTU_validation_rules.lua b/test_scripts/Policies/Policy_Table_Update/143_ATF_PTU_validation_rules.lua index ab1d740f7c..fc2e6c5799 100644 --- a/test_scripts/Policies/Policy_Table_Update/143_ATF_PTU_validation_rules.lua +++ b/test_scripts/Policies/Policy_Table_Update/143_ATF_PTU_validation_rules.lua @@ -27,15 +27,12 @@ -- SDL->HMI: OnStatusUpdate(UP_TO_DATE) -- SDL stops timeout started by OnSystemRequest. No other OnSystemRequest are received. --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --local testCasesForPolicyTableUpdateFile = require('user_modules/shared_testcases/testCasesForPolicyTableUpdateFile') @@ -54,7 +51,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -64,7 +61,7 @@ function Test:TestStep_PTU_validation_rules() local endpoints = {} is_verification_passed = testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID }, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {""}, "print") for i = 1, #testCasesForPolicyTableSnapshot.pts_endpoints do @@ -108,4 +105,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Policy_Table_Update/144_ATF_PTU_validation_failure.lua b/test_scripts/Policies/Policy_Table_Update/144_ATF_PTU_validation_failure.lua index b978a0c118..17b46d6f28 100644 --- a/test_scripts/Policies/Policy_Table_Update/144_ATF_PTU_validation_failure.lua +++ b/test_scripts/Policies/Policy_Table_Update/144_ATF_PTU_validation_failure.lua @@ -27,16 +27,13 @@ -- SDL->HMI: OnStatusUpdate(UPDATE_NEEDED) -- SDL removes 'policyfile' from the directory --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicySDLErrorsStops = require('user_modules/shared_testcases/testCasesForPolicySDLErrorsStops') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -53,7 +50,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/145_ATF_PTU_Merge_Into_LPT.lua b/test_scripts/Policies/Policy_Table_Update/145_ATF_PTU_Merge_Into_LPT.lua index 97da3c8321..3eb7089885 100644 --- a/test_scripts/Policies/Policy_Table_Update/145_ATF_PTU_Merge_Into_LPT.lua +++ b/test_scripts/Policies/Policy_Table_Update/145_ATF_PTU_Merge_Into_LPT.lua @@ -19,9 +19,6 @@ -- Expected result: -- Previous version of sections in LPT are replaced by a new ones --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local json = require("modules/json") local mobileSession = require("mobile_session") @@ -29,6 +26,7 @@ local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local commonPreconditions = require("user_modules/shared_testcases/commonPreconditions") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Variables ]] local policy_file_path = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") @@ -96,7 +94,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_ActivateApp() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/146_ATF_HMILvl_on_PTU_affected_in_FULL_or_LIMITED.lua b/test_scripts/Policies/Policy_Table_Update/146_ATF_HMILvl_on_PTU_affected_in_FULL_or_LIMITED.lua index 36f903352b..9d54634a47 100644 --- a/test_scripts/Policies/Policy_Table_Update/146_ATF_HMILvl_on_PTU_affected_in_FULL_or_LIMITED.lua +++ b/test_scripts/Policies/Policy_Table_Update/146_ATF_HMILvl_on_PTU_affected_in_FULL_or_LIMITED.lua @@ -18,15 +18,13 @@ -- 3) After PTU OnPermissionsChange is called for both applications. --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local json = require('json') + --[[ Local Variables ]] local HMIAppID2 diff --git a/test_scripts/Policies/Policy_Table_Update/147_ATF_Policy_Table_Update_Trigger_After_N_Kilometers.lua b/test_scripts/Policies/Policy_Table_Update/147_ATF_Policy_Table_Update_Trigger_After_N_Kilometers.lua index 93f37d1681..47f99c7d56 100644 --- a/test_scripts/Policies/Policy_Table_Update/147_ATF_Policy_Table_Update_Trigger_After_N_Kilometers.lua +++ b/test_scripts/Policies/Policy_Table_Update/147_ATF_Policy_Table_Update_Trigger_After_N_Kilometers.lua @@ -21,9 +21,7 @@ -- PTS is created by SDL: -- SDL-> HMI: SDL.PolicyUpdate() //PTU sequence started --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -31,6 +29,7 @@ config.defaultProtocolVersion = 2 local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -86,7 +85,7 @@ function Test:Precondition_Activate_App_And_Consent_Device_To_Start_PTU() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/Policy_Table_Update/148_ATF_HMILvl_on_PTU_affected_in_BACKGROUND_or_NONE.lua b/test_scripts/Policies/Policy_Table_Update/148_ATF_HMILvl_on_PTU_affected_in_BACKGROUND_or_NONE.lua index 5c4177b96d..d02c1a2dbf 100644 --- a/test_scripts/Policies/Policy_Table_Update/148_ATF_HMILvl_on_PTU_affected_in_BACKGROUND_or_NONE.lua +++ b/test_scripts/Policies/Policy_Table_Update/148_ATF_HMILvl_on_PTU_affected_in_BACKGROUND_or_NONE.lua @@ -20,7 +20,6 @@ --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] @@ -28,6 +27,7 @@ local mobileSession = require("mobile_session") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local json = require("modules/json") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local policy_file_path = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") @@ -85,7 +85,7 @@ local function activate_app(self, id) local requestId2 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", { language = "EN-US", messageCodes = { "DataConsent" } }) EXPECT_HMIRESPONSE(requestId2) :Do(function() - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/Policy_Table_Update/149_ATF_Policy_Table_Update_Trigger_After_N_Days.lua b/test_scripts/Policies/Policy_Table_Update/149_ATF_Policy_Table_Update_Trigger_After_N_Days.lua index 34e6f4617a..972e661235 100644 --- a/test_scripts/Policies/Policy_Table_Update/149_ATF_Policy_Table_Update_Trigger_After_N_Days.lua +++ b/test_scripts/Policies/Policy_Table_Update/149_ATF_Policy_Table_Update_Trigger_After_N_Days.lua @@ -18,9 +18,7 @@ -- PTS is created by SDL: -- SDL-> HMI: SDL.PolicyUpdate() //PTU sequence started --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -28,6 +26,7 @@ config.defaultProtocolVersion = 2 local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Variables ]] local exchangeDays = 30 @@ -77,7 +76,7 @@ function Test:Precondition_Activate_App_Consent_Device() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/Policy_Table_Update/150_ATF_Notifying_HMI_via_OnAppPermissionChanged.lua b/test_scripts/Policies/Policy_Table_Update/150_ATF_Notifying_HMI_via_OnAppPermissionChanged.lua index 1de22712c2..a3d4c43f7b 100644 --- a/test_scripts/Policies/Policy_Table_Update/150_ATF_Notifying_HMI_via_OnAppPermissionChanged.lua +++ b/test_scripts/Policies/Policy_Table_Update/150_ATF_Notifying_HMI_via_OnAppPermissionChanged.lua @@ -28,7 +28,6 @@ -- 6.SDL->HMI: SDL.OnAppPermissionChanged(, params) --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -37,6 +36,7 @@ local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local json = require('json') +local utils = require ('user_modules/utils') --[[ Local Variables ]] local basic_ptu_file = "files/ptu.json" @@ -75,7 +75,7 @@ function Test:Precondition_ActivateApp() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/Policy_Table_Update/151_ATF_Apply_PTU_and_OnPermissionChange_notify.lua b/test_scripts/Policies/Policy_Table_Update/151_ATF_Apply_PTU_and_OnPermissionChange_notify.lua index e77bf134f9..f83035010e 100644 --- a/test_scripts/Policies/Policy_Table_Update/151_ATF_Apply_PTU_and_OnPermissionChange_notify.lua +++ b/test_scripts/Policies/Policy_Table_Update/151_ATF_Apply_PTU_and_OnPermissionChange_notify.lua @@ -28,16 +28,14 @@ -- 4. SDL removes 'policyfile' from the directory -- 5. SDL->appID_1: onPermissionChange(permisssions) -- 6. SDL->HMI: SDL.OnAppPermissionChanged(appID_1, permissions) - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - +--------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local json = require('json') local mobile_session = require('mobile_session') +local utils = require ('user_modules/utils') --[[ Local Variables ]] local HMIAppID diff --git a/test_scripts/Policies/Policy_Table_Update/152_ATF_PTU_Merge_Of_Consumer_Friendly_Messages.lua b/test_scripts/Policies/Policy_Table_Update/152_ATF_PTU_Merge_Of_Consumer_Friendly_Messages.lua index db62a28063..9892470219 100644 --- a/test_scripts/Policies/Policy_Table_Update/152_ATF_PTU_Merge_Of_Consumer_Friendly_Messages.lua +++ b/test_scripts/Policies/Policy_Table_Update/152_ATF_PTU_Merge_Of_Consumer_Friendly_Messages.lua @@ -17,19 +17,16 @@ -- Expected result: -- Previous version of consumer_friendly_messages.messages section in LPT has to be replaced by a new one. --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") +local utils = require ('user_modules/utils') --[[ Local Variables ]] --local db_file = config.pathToSDL .. "/" .. commonFunctions:read_parameter_from_smart_device_link_ini("AppStorageFolder") .. "/policy.sqlite" local policy_file_path = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local ptu_file = "files/jsons/Policies/Policy_Table_Update/ptu_18192.json" --[[ Local Functions ]] @@ -70,7 +67,7 @@ function Test:Precondition_ActivateApp() EXPECT_HMIRESPONSE(requestId2) :Do(function(_, _) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = ServerAddress } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/Policy_Table_Update/153_ATF_PTU_Omit_Of_Consumer_Friendly_Messages.lua b/test_scripts/Policies/Policy_Table_Update/153_ATF_PTU_Omit_Of_Consumer_Friendly_Messages.lua index 5939b5f985..dd6fab8436 100644 --- a/test_scripts/Policies/Policy_Table_Update/153_ATF_PTU_Omit_Of_Consumer_Friendly_Messages.lua +++ b/test_scripts/Policies/Policy_Table_Update/153_ATF_PTU_Omit_Of_Consumer_Friendly_Messages.lua @@ -18,14 +18,12 @@ -- Previous version of consumer_friendly_messages section is retained -- Number of records is not changed --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Variables ]] local r_expected @@ -81,7 +79,7 @@ function Test:Precondition_ActivateApp() EXPECT_HMIRESPONSE(requestId2) :Do(function(_, _) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/Policy_Table_Update/154_ATF_PTU_SDL_Must_Remove_PTU_File_Got_From_Sync_After_Getting_The_Updates.lua b/test_scripts/Policies/Policy_Table_Update/154_ATF_PTU_SDL_Must_Remove_PTU_File_Got_From_Sync_After_Getting_The_Updates.lua index 6defb13cc3..23ed25c5fb 100644 --- a/test_scripts/Policies/Policy_Table_Update/154_ATF_PTU_SDL_Must_Remove_PTU_File_Got_From_Sync_After_Getting_The_Updates.lua +++ b/test_scripts/Policies/Policy_Table_Update/154_ATF_PTU_SDL_Must_Remove_PTU_File_Got_From_Sync_After_Getting_The_Updates.lua @@ -19,13 +19,11 @@ -- Expected result: -- PTU file is deleted --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local policy_file_name = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" @@ -65,7 +63,7 @@ function Test:Precondition_ActivateApp() EXPECT_HMIRESPONSE(requestId2) :Do(function(_, _) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/Policy_Table_Update/155_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATE_NEEDED.lua b/test_scripts/Policies/Policy_Table_Update/155_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATE_NEEDED.lua index efde703277..76543f6dd7 100644 --- a/test_scripts/Policies/Policy_Table_Update/155_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATE_NEEDED.lua +++ b/test_scripts/Policies/Policy_Table_Update/155_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATE_NEEDED.lua @@ -22,16 +22,13 @@ -- -- TODO: Reduce value of timeout_after_x_seconds parameter in LPT in order to make test faster --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -48,7 +45,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -56,7 +53,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_ChangeStatus_Update_Needed() local time_update_needed = {} local time_system_request = {} - local endpoints = {} + local endpoints = { { url = "http://policies.telematics.ford.com/api/policies" } } local is_test_fail = false local timeout_pts = testCasesForPolicyTableSnapshot:get_data_from_PTS("module_config.timeout_after_x_seconds") local seconds_between_retries = {} diff --git a/test_scripts/Policies/Policy_Table_Update/156_ATF_PTU_OnStatusUpdate_Trigger.lua b/test_scripts/Policies/Policy_Table_Update/156_ATF_PTU_OnStatusUpdate_Trigger.lua index 23d138bd79..7a5d774b04 100644 --- a/test_scripts/Policies/Policy_Table_Update/156_ATF_PTU_OnStatusUpdate_Trigger.lua +++ b/test_scripts/Policies/Policy_Table_Update/156_ATF_PTU_OnStatusUpdate_Trigger.lua @@ -17,14 +17,12 @@ -- Status changes in a wollowing way: -- "UPDATE_NEEDED" -> "UPDATING" -> "UP_TO_DATE" -> "UPDATE_NEEDED" -> "UPDATING" --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") +local utils = require ('user_modules/utils') --[[ Local variables ]] local policy_file_path = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" @@ -45,7 +43,6 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_Trigger_Device_consent() local is_test_fail = false self.hmi_app1_id = self.applications[config.application1.registerAppInterfaceParams.appName] - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) @@ -58,7 +55,7 @@ function Test:TestStep_Trigger_Device_consent() testCasesForPolicyTable.time_trigger = timestamp() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) -- EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATE_NEEDED"}) diff --git a/test_scripts/Policies/Policy_Table_Update/157_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATING.lua b/test_scripts/Policies/Policy_Table_Update/157_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATING.lua index d411818a20..f41cfdfd21 100644 --- a/test_scripts/Policies/Policy_Table_Update/157_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATING.lua +++ b/test_scripts/Policies/Policy_Table_Update/157_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATING.lua @@ -15,13 +15,11 @@ -- Expected result: -- SDL.OnStatusUpdate(UPDATING) notification is send right after SDL->MOB: OnSystemRequest --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -35,7 +33,7 @@ require("user_modules/AppTypes") commonFunctions:newTestCasesGroup("Precondition") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -91,4 +89,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Policy_Table_Update/158_ATF_PTU_Policies_Manager_Changes_Status_To_UP_TO_DATE.lua b/test_scripts/Policies/Policy_Table_Update/158_ATF_PTU_Policies_Manager_Changes_Status_To_UP_TO_DATE.lua index b929dde4e5..27de595ea6 100644 --- a/test_scripts/Policies/Policy_Table_Update/158_ATF_PTU_Policies_Manager_Changes_Status_To_UP_TO_DATE.lua +++ b/test_scripts/Policies/Policy_Table_Update/158_ATF_PTU_Policies_Manager_Changes_Status_To_UP_TO_DATE.lua @@ -15,13 +15,11 @@ -- Expected result: -- SDL.OnStatusUpdate(UP_TO_DATE) notification is send right after successful validation of received PTU --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -35,7 +33,7 @@ require("user_modules/AppTypes") commonFunctions:newTestCasesGroup("Precondition") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/159_ATF_PTU_Requirements_For_HMILevel_Of_The_Application_Taking_Part_In_Policy_Update.lua b/test_scripts/Policies/Policy_Table_Update/159_ATF_PTU_Requirements_For_HMILevel_Of_The_Application_Taking_Part_In_Policy_Update.lua index 7f015057ef..f0d255d01b 100644 --- a/test_scripts/Policies/Policy_Table_Update/159_ATF_PTU_Requirements_For_HMILevel_Of_The_Application_Taking_Part_In_Policy_Update.lua +++ b/test_scripts/Policies/Policy_Table_Update/159_ATF_PTU_Requirements_For_HMILevel_Of_The_Application_Taking_Part_In_Policy_Update.lua @@ -19,7 +19,6 @@ -- app_1 doesn't take part in PTU (except of the case when app_1 is the only application being run on SDL) --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] @@ -28,6 +27,7 @@ local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") local commonTestCases = require("user_modules/shared_testcases/commonTestCases") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local hmiLevels = { } @@ -99,7 +99,7 @@ function Test:TestStep_ActivateApp_2() EXPECT_HMIRESPONSE(requestId2) :Do(function(_, _) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) end) end end) diff --git a/test_scripts/Policies/Policy_Table_Update/160_ATF_Default_Policy_For_The_App_After_PTU.lua b/test_scripts/Policies/Policy_Table_Update/160_ATF_Default_Policy_For_The_App_After_PTU.lua index c6c2879131..64ae56ecee 100644 --- a/test_scripts/Policies/Policy_Table_Update/160_ATF_Default_Policy_For_The_App_After_PTU.lua +++ b/test_scripts/Policies/Policy_Table_Update/160_ATF_Default_Policy_For_The_App_After_PTU.lua @@ -19,9 +19,7 @@ -- b) PTU successfully passed -- c) SDL respons SUCCESS for allowed RPC and DISALLOW for disallow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 config.application1.registerAppInterfaceParams.appName = "SPT" @@ -33,6 +31,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -86,7 +85,7 @@ function Test:Precondition_Register_Activate_App_And_Consent_Device() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/Policy_Table_Update/161_ATF_User_Trigger_PTU_While_Another_Is_In_Progress.lua b/test_scripts/Policies/Policy_Table_Update/161_ATF_User_Trigger_PTU_While_Another_Is_In_Progress.lua index cd043b6ad3..cded5fef83 100644 --- a/test_scripts/Policies/Policy_Table_Update/161_ATF_User_Trigger_PTU_While_Another_Is_In_Progress.lua +++ b/test_scripts/Policies/Policy_Table_Update/161_ATF_User_Trigger_PTU_While_Another_Is_In_Progress.lua @@ -19,15 +19,14 @@ -- c) PoliciesManager starts the PTU sequence: -- d) PTS is created by SDL: SDL-> HMI: SDL.PolicyUpdate() //PTU sequence started --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -51,7 +50,7 @@ function Test:Precondition_Activate_App_And_Consent_Device_To_Start_PTU() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/Policy_Table_Update/162_ATF_Policies_UTF-8_Encoding.lua b/test_scripts/Policies/Policy_Table_Update/162_ATF_Policies_UTF-8_Encoding.lua index a1f09ff15c..a2f973bbb8 100644 --- a/test_scripts/Policies/Policy_Table_Update/162_ATF_Policies_UTF-8_Encoding.lua +++ b/test_scripts/Policies/Policy_Table_Update/162_ATF_Policies_UTF-8_Encoding.lua @@ -16,12 +16,10 @@ -- Expected result: -- The texts in Russian & Chinese in appropriate are parsed correctly by SDL --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local db_file = config.pathToSDL .. "/" .. commonFunctions:read_parameter_from_smart_device_link_ini("AppStorageFolder") .. "/policy.sqlite" @@ -86,7 +84,7 @@ function Test:Precondition_ActivateApp() EXPECT_HMIRESPONSE(requestId2) :Do(function(_, _) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/Policy_Table_Update/163_P_ATF_Register_NewApp_not_exist_inLocalPT_PTU.lua b/test_scripts/Policies/Policy_Table_Update/163_P_ATF_Register_NewApp_not_exist_inLocalPT_PTU.lua index 740272b8d7..7cc8c0e4fb 100644 --- a/test_scripts/Policies/Policy_Table_Update/163_P_ATF_Register_NewApp_not_exist_inLocalPT_PTU.lua +++ b/test_scripts/Policies/Policy_Table_Update/163_P_ATF_Register_NewApp_not_exist_inLocalPT_PTU.lua @@ -16,13 +16,13 @@ ------------------------------------------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local mobile_session = require('mobile_session') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Functions ]] local registerAppInterfaceParams = @@ -60,7 +60,7 @@ require("user_modules/AppTypes") commonFunctions:newTestCasesGroup ("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PolicyUpdateStarted() diff --git a/test_scripts/Policies/Policy_Table_Update/164_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU.lua b/test_scripts/Policies/Policy_Table_Update/164_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU.lua index 470ff59dbb..c5ae25db58 100644 --- a/test_scripts/Policies/Policy_Table_Update/164_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU.lua +++ b/test_scripts/Policies/Policy_Table_Update/164_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU.lua @@ -21,13 +21,13 @@ ------------------------------------------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local mobile_session = require('mobile_session') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Functions ]] local registerAppInterfaceParams = @@ -65,7 +65,7 @@ require("user_modules/AppTypes") commonFunctions:newTestCasesGroup ("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PolicyUpdateStarted() diff --git a/test_scripts/Policies/Policy_Table_Update/165_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp.lua b/test_scripts/Policies/Policy_Table_Update/165_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp.lua index 0c3fd75fb4..d923e9b6e0 100644 --- a/test_scripts/Policies/Policy_Table_Update/165_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp.lua +++ b/test_scripts/Policies/Policy_Table_Update/165_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp.lua @@ -22,7 +22,6 @@ ------------------------------------------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appHMIType = { "MEDIA" } --[[ Required Shared libraries ]] @@ -30,6 +29,7 @@ local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local mobile_session = require('mobile_session') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Functions ]] local registerAppInterfaceParams = @@ -67,7 +67,7 @@ require("user_modules/AppTypes") commonFunctions:newTestCasesGroup ("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_PolicyUpdateStarted() diff --git a/test_scripts/Policies/Policy_Table_Update/166_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default.lua b/test_scripts/Policies/Policy_Table_Update/166_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default.lua index 80d2b30076..39815c5201 100644 --- a/test_scripts/Policies/Policy_Table_Update/166_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default.lua +++ b/test_scripts/Policies/Policy_Table_Update/166_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default.lua @@ -17,15 +17,12 @@ -- PTU is requested. PTS is created. -- SDL.GetURLs({urls[] = default urls}) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +40,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/167_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default_not_registered.lua b/test_scripts/Policies/Policy_Table_Update/167_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default_not_registered.lua index aba60e9cbb..d09f4fb01c 100644 --- a/test_scripts/Policies/Policy_Table_Update/167_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default_not_registered.lua +++ b/test_scripts/Policies/Policy_Table_Update/167_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default_not_registered.lua @@ -17,15 +17,12 @@ -- PTU is requested. PTS is created. -- SDL.GetURLs({urls[] = default urls}) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +40,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/168_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default_registered.lua b/test_scripts/Policies/Policy_Table_Update/168_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default_registered.lua index 3df39e25aa..ab533c014f 100644 --- a/test_scripts/Policies/Policy_Table_Update/168_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default_registered.lua +++ b/test_scripts/Policies/Policy_Table_Update/168_ATF_HMI_sends_GetURLs_one_app_registered_urls_3default_registered.lua @@ -17,15 +17,12 @@ -- PTU is requested. PTS is created. -- SDL.GetURLs({urls[] = registered_App1, default}) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +40,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/Policy_Table_Update/169_ATF_HMILvl_on_PTU_affected_app_in_LIMITED.lua b/test_scripts/Policies/Policy_Table_Update/169_ATF_HMILvl_on_PTU_affected_app_in_LIMITED.lua index bf3afbf41c..744fd1637f 100644 --- a/test_scripts/Policies/Policy_Table_Update/169_ATF_HMILvl_on_PTU_affected_app_in_LIMITED.lua +++ b/test_scripts/Policies/Policy_Table_Update/169_ATF_HMILvl_on_PTU_affected_app_in_LIMITED.lua @@ -18,14 +18,12 @@ -- 3) After PTU OnPermissionsChange is called --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local json = require('json') + --[[ Local Variables ]] local HMIAppID2 diff --git a/test_scripts/Policies/Policy_Table_Update/170_ATF_PTU_Trigger_On_Navi_App_Registration_And_No_Certificate.lua b/test_scripts/Policies/Policy_Table_Update/170_ATF_PTU_Trigger_On_Navi_App_Registration_And_No_Certificate.lua index 20786f971b..21ac723089 100644 --- a/test_scripts/Policies/Policy_Table_Update/170_ATF_PTU_Trigger_On_Navi_App_Registration_And_No_Certificate.lua +++ b/test_scripts/Policies/Policy_Table_Update/170_ATF_PTU_Trigger_On_Navi_App_Registration_And_No_Certificate.lua @@ -17,15 +17,14 @@ -- Expected result: -- a) SDL send SDL.OnStatusUpdate(UPDATE_NEEDED) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -45,7 +44,7 @@ function Test:Precondition_Activate_App_And_Consent_Device() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/Policy_Table_Update/171_ATF_Policies_Memory_Allocation_For_PTU.lua b/test_scripts/Policies/Policy_Table_Update/171_ATF_Policies_Memory_Allocation_For_PTU.lua index 1486804185..c0e392cc64 100644 --- a/test_scripts/Policies/Policy_Table_Update/171_ATF_Policies_Memory_Allocation_For_PTU.lua +++ b/test_scripts/Policies/Policy_Table_Update/171_ATF_Policies_Memory_Allocation_For_PTU.lua @@ -17,13 +17,10 @@ -- Expected result: -- PTU finished successfully and LPT is updated --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] - config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") - + local utils = require ('user_modules/utils') --[[ Local Variables ]] local db_file = config.pathToSDL .. "/" .. commonFunctions:read_parameter_from_smart_device_link_ini("AppStorageFolder") .. "/policy.sqlite" @@ -73,7 +70,7 @@ EXPECT_HMIRESPONSE(requestId2) :Do(function(_, _) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) @@ -130,4 +127,4 @@ StopSDL() end -return Test +return Test diff --git a/test_scripts/Policies/Policy_Table_Update/172_ATF_PTU_request_after_N_ignition_cycles.lua b/test_scripts/Policies/Policy_Table_Update/172_ATF_PTU_request_after_N_ignition_cycles.lua index 4f0062c0cb..bbdb9fd533 100644 --- a/test_scripts/Policies/Policy_Table_Update/172_ATF_PTU_request_after_N_ignition_cycles.lua +++ b/test_scripts/Policies/Policy_Table_Update/172_ATF_PTU_request_after_N_ignition_cycles.lua @@ -20,7 +20,6 @@ -- SDL must trigger a PolicyTableUpdate sequence --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appHMIType = {"DEFAULT"} --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 @@ -28,6 +27,7 @@ config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -49,7 +49,7 @@ function Test:Precondition_Activate_App_Consent_Device_And_Update_Policy() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) -- GetCurrentTimeStampDeviceConsent() EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) diff --git a/test_scripts/Policies/Related_HMI_API/173_ATF_OnAllowSDLFunctionality_allowed_false_with_device.lua b/test_scripts/Policies/Related_HMI_API/173_ATF_OnAllowSDLFunctionality_allowed_false_with_device.lua index 230556af48..77ee176a1c 100644 --- a/test_scripts/Policies/Related_HMI_API/173_ATF_OnAllowSDLFunctionality_allowed_false_with_device.lua +++ b/test_scripts/Policies/Related_HMI_API/173_ATF_OnAllowSDLFunctionality_allowed_false_with_device.lua @@ -11,18 +11,16 @@ -- device ('device' param) as NOT consented in Local PT ("user_consent_records"-> "device" sub-section) and send BasicCommunication.ActivateApp with -- 'level' param of the value from 'default_hmi' key of 'pre-DataConsent'section of Local PT to HMI. App should stay in NONE HMI level --------------------------------------------------------------------------------------------- -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ Local variables ]] local device_consent local device_consent_group -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -36,7 +34,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -44,7 +42,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_Allowed_false_with_device() device_consent_group = testCasesForPolicyTableSnapshot:get_data_from_PTS("app_policies.device.groups.1") - device_consent = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records.device.consent_groups.DataConsent-2") + device_consent = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records.device.consent_groups.DataConsent-2") --print("device_consent = " ..device_consent) if( (device_consent == nil) or (device_consent_group == nil)) then self:FailTestCase("Device is not consented after user consent.") @@ -55,7 +53,7 @@ function Test:TestStep_Allowed_false_with_device() self:FailTestCase("Device is not consented after user consent.") else self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = false, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = false}}) + {allowed = false, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = false}}) end end end @@ -88,4 +86,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Related_HMI_API/174_ATF_OnAllowSDLFunctionality_allowed_false_without_device.lua b/test_scripts/Policies/Related_HMI_API/174_ATF_OnAllowSDLFunctionality_allowed_false_without_device.lua index afd34633fe..0e7668a651 100644 --- a/test_scripts/Policies/Related_HMI_API/174_ATF_OnAllowSDLFunctionality_allowed_false_without_device.lua +++ b/test_scripts/Policies/Related_HMI_API/174_ATF_OnAllowSDLFunctionality_allowed_false_without_device.lua @@ -10,13 +10,12 @@ -- In case PoliciesManager receives SDL.OnAllowSDLFunctionality with 'allowed=false' and without 'device' param from HMI, PoliciesManager must record -- all of currently registered devices as NOT consented in Local PT ("device_data" - > "", "", etc. - >"user_consent_records"- > "device" sub-section). --------------------------------------------------------------------------------------------- -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ Local variables ]] local device_consent @@ -34,7 +33,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -42,7 +41,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_Allowed_false_without_device() device_consent_group = testCasesForPolicyTableSnapshot:get_data_from_PTS("app_policies.device.groups.1") - device_consent = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records.device.consent_groups.DataConsent-2") + device_consent = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records.device.consent_groups.DataConsent-2") if( (device_consent == nil) or (device_consent_group == nil)) then self:FailTestCase("Device is not consented after user consent.") elseif (device_consent_group ~= "DataConsent-2") then diff --git a/test_scripts/Policies/Related_HMI_API/175_ATF_OnAllowSDLFunctionality_allowed_true_without_device.lua b/test_scripts/Policies/Related_HMI_API/175_ATF_OnAllowSDLFunctionality_allowed_true_without_device.lua index da7a12b80e..0816ad45fc 100644 --- a/test_scripts/Policies/Related_HMI_API/175_ATF_OnAllowSDLFunctionality_allowed_true_without_device.lua +++ b/test_scripts/Policies/Related_HMI_API/175_ATF_OnAllowSDLFunctionality_allowed_true_without_device.lua @@ -11,12 +11,10 @@ -- SDL->HMI:BC.ActivateApp(params, level: <”default_hmi”-value-from-assigned-policies>) -- SDL->app: OnHMIStatus(params, level: <”default_hmi”-value-from-assigned-policies>) --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -42,7 +40,7 @@ function Test:TestStep_RegisterApp_allowed_true_without_device() :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) end) EXPECT_HMICALL("BasicCommunication.PolicyUpdate",{}) diff --git a/test_scripts/Policies/Related_HMI_API/176_ATF_OnAllowSDLFunctionality_allowed_false_with_device.lua b/test_scripts/Policies/Related_HMI_API/176_ATF_OnAllowSDLFunctionality_allowed_false_with_device.lua index 5d68a4e37c..c690f9becc 100644 --- a/test_scripts/Policies/Related_HMI_API/176_ATF_OnAllowSDLFunctionality_allowed_false_with_device.lua +++ b/test_scripts/Policies/Related_HMI_API/176_ATF_OnAllowSDLFunctionality_allowed_false_with_device.lua @@ -14,16 +14,11 @@ -- app stays in NONE level on HMI. -- HMI->SDL: BasicCommunication.ActivateApp_response --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') - ---[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -48,13 +43,13 @@ function Test:TestStep_RegisterApp_allowed_false_without_device() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = false, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = false}}) + {allowed = false, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = false}}) end) end) EXPECT_HMICALL("BasicCommunication.ActivateApp", {appID = self.applications[config.application1.registerAppInterfaceParams.appName], level = "NONE"}) - :Do(function(_,data) - self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) + :Do(function(_,data) + self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) end) EXPECT_NOTIFICATION("OnHMIStatus"):Times(0) @@ -64,7 +59,7 @@ function Test:TestStep_CheckDeviceConsentGroup() os.execute("sleep 3") local result = commonFunctions:is_db_contains(config.pathToSDL.."/storage/policy.sqlite", "SELECT is_consented FROM device_consent_group", {"0"} ) if(result ~= true) then - self:FailTestCase("Error: Value of is_consented on policy DB should be false(0).") + self:FailTestCase("Error: Value of is_consented on policy DB should be false(0).") end end @@ -74,4 +69,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Related_HMI_API/177_ATF_OnAllowSDLFunctionality_allowed_true_with_device.lua b/test_scripts/Policies/Related_HMI_API/177_ATF_OnAllowSDLFunctionality_allowed_true_with_device.lua index 40b404fb98..857eff8706 100644 --- a/test_scripts/Policies/Related_HMI_API/177_ATF_OnAllowSDLFunctionality_allowed_true_with_device.lua +++ b/test_scripts/Policies/Related_HMI_API/177_ATF_OnAllowSDLFunctionality_allowed_true_with_device.lua @@ -17,16 +17,11 @@ -- HMI displays the device consent pormpt. User makes choice. -- HMI->SDL: OnAllowSDLFunctionality --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') - ---[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -50,14 +45,14 @@ function Test:TestStep_ActivateApp_allowed_true_with_device() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) EXPECT_HMICALL("BasicCommunication.PolicyUpdate",{}) :Do(function(_,data) self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) testCasesForPolicyTableSnapshot:extract_pts({self.applications[config.application1.registerAppInterfaceParams.appName]}) - device_consent = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records.device.consent_groups.DataConsent-2") + device_consent = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records.device.consent_groups.DataConsent-2") if(device_consent ~= true) then self:FailTestCase("Device is not consented after user consented it.") @@ -77,4 +72,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Related_HMI_API/178_ATF_OnAppPermissionConsent_without_appID.lua b/test_scripts/Policies/Related_HMI_API/178_ATF_OnAppPermissionConsent_without_appID.lua index 19a135d269..f09544ce1a 100644 --- a/test_scripts/Policies/Related_HMI_API/178_ATF_OnAppPermissionConsent_without_appID.lua +++ b/test_scripts/Policies/Related_HMI_API/178_ATF_OnAppPermissionConsent_without_appID.lua @@ -23,14 +23,12 @@ -- 9. HMI->SDL: OnAppPermissionConsent {params} -- 10. PoliciesManager: update "" subsection of "user_consent_records" subsection of "" section of "device_data" section in Local PT --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +42,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_ExitApplication() @@ -100,8 +98,8 @@ function Test:TestStep_check_LocalPT_for_updates() EXPECT_HMICALL("BasicCommunication.PolicyUpdate",{}) :Do(function(_,data) local is_test_fail = false - local app_consent_location = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Location-1") - local app_consent_notifications = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Notifications") + local app_consent_location = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Location-1") + local app_consent_notifications = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Notifications") if(app_consent_location ~= true) then commonFunctions:printError("Error: consent_groups.Location function for appID should be true") diff --git a/test_scripts/Policies/Related_HMI_API/179_ATF_OnAppPermissionConsent_with_appID.lua b/test_scripts/Policies/Related_HMI_API/179_ATF_OnAppPermissionConsent_with_appID.lua index fd8465f0f1..36fc939dd4 100644 --- a/test_scripts/Policies/Related_HMI_API/179_ATF_OnAppPermissionConsent_with_appID.lua +++ b/test_scripts/Policies/Related_HMI_API/179_ATF_OnAppPermissionConsent_with_appID.lua @@ -23,14 +23,12 @@ -- 9. HMI->SDL: OnAppPermissionConsent {params} -- 10. PoliciesManager: update "" subsection of "user_consent_records" subsection of "" section of "device_data" section in Local PT --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +42,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_ExitApplication() @@ -96,8 +94,8 @@ function Test:TestStep_check_LocalPT_for_updates() EXPECT_HMICALL("BasicCommunication.PolicyUpdate",{}) :Do(function(_,data) testCasesForPolicyTableSnapshot:extract_pts({self.applications[config.application1.registerAppInterfaceParams.appName]}) - local app_consent_location = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Location-1") - local app_consent_notifications = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Notifications") + local app_consent_location = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Location-1") + local app_consent_notifications = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Notifications") if(app_consent_location ~= true) then commonFunctions:printError("Error: consent_groups.Location function for appID should be true") diff --git a/test_scripts/Policies/Related_HMI_API/180_ATF_GetUserFriendlyMessage_language_section_is_absent_in_LocalPT.lua b/test_scripts/Policies/Related_HMI_API/180_ATF_GetUserFriendlyMessage_language_section_is_absent_in_LocalPT.lua index a5701ce5ab..e0d9b77681 100644 --- a/test_scripts/Policies/Related_HMI_API/180_ATF_GetUserFriendlyMessage_language_section_is_absent_in_LocalPT.lua +++ b/test_scripts/Policies/Related_HMI_API/180_ATF_GetUserFriendlyMessage_language_section_is_absent_in_LocalPT.lua @@ -11,10 +11,6 @@ -- HMI->SDL: SDL.GetUserFriendlyMessage ("messageCodes": "AppPermissions") -- SDL->HMI: SDL.GetUserFriendlyMessage ("messages": {messageCode: "AppPermissions", ttsString: "%appName% is requesting the use of the following ....", line1: "Grant Requested", line2: "Permission(s)?"}) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') @@ -64,4 +60,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Related_HMI_API/181_ATF_GetUserFriendlyMessage_Language_not_found_in_localPT.lua b/test_scripts/Policies/Related_HMI_API/181_ATF_GetUserFriendlyMessage_Language_not_found_in_localPT.lua index fa2533cd3d..507deb78af 100644 --- a/test_scripts/Policies/Related_HMI_API/181_ATF_GetUserFriendlyMessage_Language_not_found_in_localPT.lua +++ b/test_scripts/Policies/Related_HMI_API/181_ATF_GetUserFriendlyMessage_Language_not_found_in_localPT.lua @@ -11,9 +11,6 @@ -- HMI->SDL: SDL.GetUserFriendlyMessage ("messageCodes": "AppPermissions") -- SDL->HMI: SDL.GetUserFriendlyMessage ("messages": {messageCode: "AppPermissions", ttsString: "%appName% is requesting the use of the following ....", line1: "Grant Requested", line2: "Permission(s)?"}) --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Related_HMI_API/182_ATF_GetUserFriendlyMessage_with_Language.lua b/test_scripts/Policies/Related_HMI_API/182_ATF_GetUserFriendlyMessage_with_Language.lua index 8838b1d6b1..2d7348c3ff 100644 --- a/test_scripts/Policies/Related_HMI_API/182_ATF_GetUserFriendlyMessage_with_Language.lua +++ b/test_scripts/Policies/Related_HMI_API/182_ATF_GetUserFriendlyMessage_with_Language.lua @@ -11,9 +11,6 @@ -- HMI->SDL: SDL.GetUserFriendlyMessage ("messageCodes": "AppPermissions") -- SDL->HMI: SDL.GetUserFriendlyMessage ("messages": {messageCode: "AppPermissions", ttsString: "%appName% is requesting the use of the following ....", line1: "Grant Requested", line2: "Permission(s)?"}) --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Related_HMI_API/183_ATF_PolManager_provides_data_consent_prompt_on_HMI_request.lua b/test_scripts/Policies/Related_HMI_API/183_ATF_PolManager_provides_data_consent_prompt_on_HMI_request.lua index f36932ff28..ace00778df 100644 --- a/test_scripts/Policies/Related_HMI_API/183_ATF_PolManager_provides_data_consent_prompt_on_HMI_request.lua +++ b/test_scripts/Policies/Related_HMI_API/183_ATF_PolManager_provides_data_consent_prompt_on_HMI_request.lua @@ -22,16 +22,11 @@ -- SDL->HMI: SDL.GetUserFriendlyMessage ("messages": -- {messageCode: "AppPermissions", ttsString: "%appName% is requesting the use of the following ....", line1: "Grant Requested", line2: "Permission(s)?"} ring: "%appName% is requesting the use of the following ....", line1: "Grant Requested", line2: "Permission(s)?"}) --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') - ---[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -59,7 +54,7 @@ function Test:TestStep_ActivateApp_StatusNeeded() :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) -- EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", { status = "UPDATE_NEEDED" }) diff --git a/test_scripts/Policies/Related_HMI_API/184_ATF_GetListOfPermissions_without_appID.lua b/test_scripts/Policies/Related_HMI_API/184_ATF_GetListOfPermissions_without_appID.lua index 29dd5c7ab0..229916f675 100644 --- a/test_scripts/Policies/Related_HMI_API/184_ATF_GetListOfPermissions_without_appID.lua +++ b/test_scripts/Policies/Related_HMI_API/184_ATF_GetListOfPermissions_without_appID.lua @@ -12,14 +12,12 @@ -- On getting SDL.GetListOfPermissions without appID parameter, PoliciesManager must respond with the list of s -- that have the field "user_consent_prompt" in corresponding and are assigned to the currently registered applications (section "" -> "groups") --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ Local Functions ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -35,7 +33,6 @@ require('user_modules/AppTypes') --[[ Test ]] commonFunctions:newTestCasesGroup("Test") function Test:TestStep_GetListOfPermissions_without_appID() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) --Allow SDL functionality @@ -46,7 +43,7 @@ function Test:TestStep_GetListOfPermissions_without_appID() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) end @@ -86,7 +83,7 @@ function Test:TestStep_trigger_user_request_update_from_HMI() end function Test:TestStep_verify_PermissionConsent() - local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.DrivingCharacteristics-3") + local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.DrivingCharacteristics-3") if(app_permission ~= true) then self:FailTestCase("DrivingCharacteristics-3 is not assigned to application, real: " ..app_permission) end diff --git a/test_scripts/Policies/Related_HMI_API/185_ATF_GetListOfPermissions_with_appID.lua b/test_scripts/Policies/Related_HMI_API/185_ATF_GetListOfPermissions_with_appID.lua index 5d90a3e10d..6a5c72e799 100644 --- a/test_scripts/Policies/Related_HMI_API/185_ATF_GetListOfPermissions_with_appID.lua +++ b/test_scripts/Policies/Related_HMI_API/185_ATF_GetListOfPermissions_with_appID.lua @@ -12,14 +12,12 @@ -- On getting SDL.GetListOfPermissions with appID parameter, PoliciesManager must respond with the list of s -- that have the field "user_consent_prompt" in corresponding and are assigned to the currently registered applications (section "" -> "groups") --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ Local Functions ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -35,7 +33,6 @@ require('user_modules/AppTypes') --[[ Test ]] commonFunctions:newTestCasesGroup("Test") function Test:TestStep_GetListOfPermissions_with_appID() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) --Allow SDL functionality @@ -46,7 +43,7 @@ function Test:TestStep_GetListOfPermissions_with_appID() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) end @@ -86,7 +83,7 @@ function Test:TestStep_trigger_user_request_update_from_HMI() end function Test:TestStep_verify_PermissionConsent() - local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.DrivingCharacteristics-3") + local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.DrivingCharacteristics-3") if(app_permission ~= true) then self:FailTestCase("DrivingCharacteristics-3 is not assigned to application, real: " ..app_permission) end diff --git a/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua b/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua index 0ce420c61a..a51a373ae1 100644 --- a/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua +++ b/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua @@ -10,13 +10,12 @@ -- Expected result: -- SDL->HMI: BasicCommunication.PolicyUpdate --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -68,8 +67,8 @@ function Test:Precondtion_Activate_App_Consent_Update() hmiDisplayLanguageDesired = "EN-US", deviceInfo = { - name = "127.0.0.1", - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI", isSDLAllowed = false } @@ -82,7 +81,7 @@ function Test:Precondtion_Activate_App_Consent_Update() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/Related_HMI_API/187_ATF_Get_Status_Update_Request_from_HMI.lua b/test_scripts/Policies/Related_HMI_API/187_ATF_Get_Status_Update_Request_from_HMI.lua index 536e5917c1..7b25d3ee18 100644 --- a/test_scripts/Policies/Related_HMI_API/187_ATF_Get_Status_Update_Request_from_HMI.lua +++ b/test_scripts/Policies/Related_HMI_API/187_ATF_Get_Status_Update_Request_from_HMI.lua @@ -22,13 +22,10 @@ -- 4. Status: UPDATING -- 6. Status: UP_TO_DATE --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -51,7 +48,7 @@ function Test:Test_1_UPDATE_NEEDED() EXPECT_HMIRESPONSE(requestId2) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) local reqId = self.hmiConnection:SendRequest("SDL.GetStatusUpdate") EXPECT_HMIRESPONSE(reqId, { status = "UPDATE_NEEDED" }) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/224_ATF_pt_update_validation_rules_request_type_array_omitted.lua b/test_scripts/Policies/Validation_of_PolicyTables/224_ATF_pt_update_validation_rules_request_type_array_omitted.lua index d6a6073d20..f4032796ce 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/224_ATF_pt_update_validation_rules_request_type_array_omitted.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/224_ATF_pt_update_validation_rules_request_type_array_omitted.lua @@ -18,9 +18,7 @@ -- a) assign "RequestType" field from "default" section of PolicyDataBase to such app -- b) copy "RequestType" field from "default" section to "" section of PolicyDataBase --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] @@ -29,6 +27,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require ('user_modules/shared_testcases/commonSteps') local mobile_session = require('mobile_session') local config = require('config') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -174,7 +173,7 @@ local function activateApp(self, HMIAppID) --hmi side: send request SDL.OnAllowSDLFunctionality self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") diff --git a/test_scripts/Policies/Validation_of_PolicyTables/225_ATF_pt_update_validation_rules_request_type_array_has_one_invalid_value.lua b/test_scripts/Policies/Validation_of_PolicyTables/225_ATF_pt_update_validation_rules_request_type_array_has_one_invalid_value.lua index daeaca67eb..55aec7e3e3 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/225_ATF_pt_update_validation_rules_request_type_array_has_one_invalid_value.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/225_ATF_pt_update_validation_rules_request_type_array_has_one_invalid_value.lua @@ -16,18 +16,17 @@ -- Expected result: -- SDL must: cut off the invalid value of "RequestType" array --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] Test = require('connecttest') local config = require('config') config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local json = require("modules/json") local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local mobile_session = require('mobile_session') +local utils = require ('user_modules/utils') require('cardinalities') require('user_modules/AppTypes') @@ -113,7 +112,7 @@ local function activateAppInSpecificLevel(self, HMIAppID, hmi_level) --hmi side: send request SDL.OnAllowSDLFunctionality self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") diff --git a/test_scripts/Policies/Validation_of_PolicyTables/226_ATF_pt_update_validation_rules_request_type_array_has_only_one_value_is_invalid.lua b/test_scripts/Policies/Validation_of_PolicyTables/226_ATF_pt_update_validation_rules_request_type_array_has_only_one_value_is_invalid.lua index 5800ad2cc7..ec867a8950 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/226_ATF_pt_update_validation_rules_request_type_array_has_only_one_value_is_invalid.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/226_ATF_pt_update_validation_rules_request_type_array_has_only_one_value_is_invalid.lua @@ -18,18 +18,17 @@ -- a) assign "RequestType" field from "default" section of PolicyDataBase to such app -- b) copy "RequestType" field from "default" section to "" section of PolicyDataBase --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] Test = require('connecttest') local config = require('config') config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local json = require("modules/json") local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local mobile_session = require('mobile_session') +local utils = require ('user_modules/utils') require('cardinalities') require('user_modules/AppTypes') @@ -156,7 +155,7 @@ local function activateAppInSpecificLevel(self, HMIAppID, hmi_level) --hmi side: send request SDL.OnAllowSDLFunctionality self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") diff --git a/test_scripts/Policies/Validation_of_PolicyTables/227_ATF_usage_and_error_counts_update_count_sync_out_of_memory.lua b/test_scripts/Policies/Validation_of_PolicyTables/227_ATF_usage_and_error_counts_update_count_sync_out_of_memory.lua index 7c9c8660d5..1353f34252 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/227_ATF_usage_and_error_counts_update_count_sync_out_of_memory.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/227_ATF_usage_and_error_counts_update_count_sync_out_of_memory.lua @@ -15,7 +15,6 @@ -- SDL must: increment "count_sync_out_of_memory" section value of Local Policy Table. --------------------------------------------------------------------------------------------- config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/228_ATF_usage_and_error_counts_update_count_of_sync_reboots.lua b/test_scripts/Policies/Validation_of_PolicyTables/228_ATF_usage_and_error_counts_update_count_of_sync_reboots.lua index a438dfcd02..32fd8b2226 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/228_ATF_usage_and_error_counts_update_count_of_sync_reboots.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/228_ATF_usage_and_error_counts_update_count_of_sync_reboots.lua @@ -14,7 +14,6 @@ -- Expected result: -- SDL must: increment "count_of_sync_reboots" section value of Local Policy Table. --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') @@ -23,7 +22,6 @@ local commonSteps = require('user_modules/shared_testcases/commonSteps') Test = require('user_modules/dummy_connecttest') local config = require('config') config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" require('user_modules/AppTypes') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/229_ATF_usage_and_error_counts_update_count_of_iap_buffer_full.lua b/test_scripts/Policies/Validation_of_PolicyTables/229_ATF_usage_and_error_counts_update_count_of_iap_buffer_full.lua index e2fcd7b943..26b246544c 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/229_ATF_usage_and_error_counts_update_count_of_iap_buffer_full.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/229_ATF_usage_and_error_counts_update_count_of_iap_buffer_full.lua @@ -15,7 +15,6 @@ -- SDL must: increment "count_of_iap_buffer_full" section value of Local Policy Table. --------------------------------------------------------------------------------------------- config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/230_ATF_usage_and_error_counts_update_minutes_in_hmi_none.lua b/test_scripts/Policies/Validation_of_PolicyTables/230_ATF_usage_and_error_counts_update_minutes_in_hmi_none.lua index 8ff909c479..e1fa5a5afa 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/230_ATF_usage_and_error_counts_update_minutes_in_hmi_none.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/230_ATF_usage_and_error_counts_update_minutes_in_hmi_none.lua @@ -25,18 +25,17 @@ -- Expected result: -- SDL must: increment value of "minutes_in_hmi_none" for this minutes in Local Policy Table. --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] Test = require('connecttest') local config = require('config') config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local json = require("modules/json") local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local mobile_session = require('mobile_session') +local utils = require ('user_modules/utils') require('cardinalities') require('user_modules/AppTypes') @@ -299,7 +298,7 @@ local function activateAppInSpecificLevel(self, HMIAppID, hmi_level) --hmi side: send request SDL.OnAllowSDLFunctionality self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") diff --git a/test_scripts/Policies/Validation_of_PolicyTables/231_ATF_usage_and_error_counts_update_minutes_in_hmi_limited.lua b/test_scripts/Policies/Validation_of_PolicyTables/231_ATF_usage_and_error_counts_update_minutes_in_hmi_limited.lua index 61a23e1e5e..83fc518a28 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/231_ATF_usage_and_error_counts_update_minutes_in_hmi_limited.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/231_ATF_usage_and_error_counts_update_minutes_in_hmi_limited.lua @@ -26,7 +26,6 @@ -- SDL must: increment value of "minutes_in_hmi_limited" for this minutes in Local Policy Table. --------------------------------------------------------------------------------------------- config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.isMediaApplication = true --[[ Required Shared libraries ]] @@ -34,6 +33,7 @@ local json = require("modules/json") local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local mobile_session = require('mobile_session') +local utils = require ('user_modules/utils') commonSteps:DeleteLogsFiles() commonSteps:DeletePolicyTable() @@ -305,7 +305,7 @@ local function activateAppInSpecificLevel(self, HMIAppID, hmi_level) --hmi side: send request SDL.OnAllowSDLFunctionality self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") diff --git a/test_scripts/Policies/Validation_of_PolicyTables/232_ATF_usage_and_error_counts_update_minutes_in_hmi_full.lua b/test_scripts/Policies/Validation_of_PolicyTables/232_ATF_usage_and_error_counts_update_minutes_in_hmi_full.lua index 6c4624d5b6..eda0852b85 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/232_ATF_usage_and_error_counts_update_minutes_in_hmi_full.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/232_ATF_usage_and_error_counts_update_minutes_in_hmi_full.lua @@ -30,13 +30,13 @@ Test = require('connecttest') local config = require('config') config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local json = require("modules/json") local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local mobile_session = require('mobile_session') +local utils = require ('user_modules/utils') require('cardinalities') require('user_modules/AppTypes') @@ -299,7 +299,7 @@ local function activateAppInSpecificLevel(self, HMIAppID, hmi_level) --hmi side: send request SDL.OnAllowSDLFunctionality self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") diff --git a/test_scripts/Policies/Validation_of_PolicyTables/233_ATF_usage_and_error_counts_update_minutes_in_hmi_background.lua b/test_scripts/Policies/Validation_of_PolicyTables/233_ATF_usage_and_error_counts_update_minutes_in_hmi_background.lua index c253a2ce1f..b82bd2e204 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/233_ATF_usage_and_error_counts_update_minutes_in_hmi_background.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/233_ATF_usage_and_error_counts_update_minutes_in_hmi_background.lua @@ -25,18 +25,17 @@ -- Expected result: -- SDL must: increment value of "minutes_in_hmi_none" for this minutes in Local Policy Table. --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] Test = require('connecttest') local config = require('config') config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local json = require("modules/json") local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local mobile_session = require('mobile_session') +local utils = require ('user_modules/utils') require('cardinalities') require('user_modules/AppTypes') @@ -302,7 +301,7 @@ local function activateAppInSpecificLevel(self, HMIAppID, hmi_level) --hmi side: send request SDL.OnAllowSDLFunctionality self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") diff --git a/test_scripts/Policies/Validation_of_PolicyTables/234_ATF_preloaded_pt_validation_rules_for_omited_parameters_exist.lua b/test_scripts/Policies/Validation_of_PolicyTables/234_ATF_preloaded_pt_validation_rules_for_omited_parameters_exist.lua index 21eca856fb..a7e6a338e1 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/234_ATF_preloaded_pt_validation_rules_for_omited_parameters_exist.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/234_ATF_preloaded_pt_validation_rules_for_omited_parameters_exist.lua @@ -14,7 +14,6 @@ -- Expected result: -- PolicyManager shut SDL down --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/237_ATF_preloaded_pt_validation_rules_for_required_parameters.lua b/test_scripts/Policies/Validation_of_PolicyTables/237_ATF_preloaded_pt_validation_rules_for_required_parameters.lua index b4ce71898e..d26940543d 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/237_ATF_preloaded_pt_validation_rules_for_required_parameters.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/237_ATF_preloaded_pt_validation_rules_for_required_parameters.lua @@ -14,9 +14,6 @@ -- Expected result: -- SDL is shutdown --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/240_ATF_preloaded_pt_exists_with_read_permissions.lua b/test_scripts/Policies/Validation_of_PolicyTables/240_ATF_preloaded_pt_exists_with_read_permissions.lua index e0c5d14a3e..0c9b67ff3d 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/240_ATF_preloaded_pt_exists_with_read_permissions.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/240_ATF_preloaded_pt_exists_with_read_permissions.lua @@ -14,10 +14,6 @@ -- Expected result: -- SDL started successfully --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/243_ATF_preloaded_pt_exists.lua b/test_scripts/Policies/Validation_of_PolicyTables/243_ATF_preloaded_pt_exists.lua index 828e562b9f..15f13496fa 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/243_ATF_preloaded_pt_exists.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/243_ATF_preloaded_pt_exists.lua @@ -16,9 +16,6 @@ -- Expected result: -- SDL started successfully --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/245_ATF_preloaded_pt_parameter_trigger_in_local_pt.lua b/test_scripts/Policies/Validation_of_PolicyTables/245_ATF_preloaded_pt_parameter_trigger_in_local_pt.lua index 8da7fb083d..753b873508 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/245_ATF_preloaded_pt_parameter_trigger_in_local_pt.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/245_ATF_preloaded_pt_parameter_trigger_in_local_pt.lua @@ -16,15 +16,12 @@ -- Expected result: -- SDL must change the value of "preloaded_pt" field to "false" --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require ('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General configuration parameters ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -203,7 +200,7 @@ end function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_Status_UP_TO_DATE() @@ -234,4 +231,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/246_ATF_preloaded_pt_requesttype_parameters_all_are_invalid.lua b/test_scripts/Policies/Validation_of_PolicyTables/246_ATF_preloaded_pt_requesttype_parameters_all_are_invalid.lua index 2303b34b29..8f0aab1373 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/246_ATF_preloaded_pt_requesttype_parameters_all_are_invalid.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/246_ATF_preloaded_pt_requesttype_parameters_all_are_invalid.lua @@ -14,7 +14,6 @@ -- Expected result: -- SDL must shutdown --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') @@ -36,7 +35,6 @@ end --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.ExitOnCrash = false commonSteps:DeleteLogsFileAndPolicyTable() diff --git a/test_scripts/Policies/Validation_of_PolicyTables/247_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_exists.lua b/test_scripts/Policies/Validation_of_PolicyTables/247_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_exists.lua index 802ca311e3..e5e8049f2a 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/247_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_exists.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/247_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_exists.lua @@ -17,7 +17,6 @@ -- Expected result: -- SDL must leave fields&values of "consumer_friendly_messages" section in LocalPT base without changes --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/248_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_do_not_exists.lua b/test_scripts/Policies/Validation_of_PolicyTables/248_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_do_not_exists.lua index 3c4bb947c1..9b02478b9b 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/248_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_do_not_exists.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/248_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_do_not_exists.lua @@ -17,7 +17,6 @@ -- Expected result: -- SDL must add fields&values of "consumer_friendly_messages" section to LocalPT based on updated PreloadedPT --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/249_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_exists_in_both.lua b/test_scripts/Policies/Validation_of_PolicyTables/249_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_exists_in_both.lua index 9806b5af89..1695f3494a 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/249_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_exists_in_both.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/249_ATF_merge_preloaded_pt_into_local_pt_consumer_frendly_messages_exists_in_both.lua @@ -17,7 +17,6 @@ -- Expected result: -- SDL must overwrite fields&values of "consumer_friendly_messages" section at LocalPT based on updated PreloadedPT --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/250_ATF_merge_preloaded_pt_into_local_pt_app_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/250_ATF_merge_preloaded_pt_into_local_pt_app_policies.lua index b286f9f258..4e9abb6428 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/250_ATF_merge_preloaded_pt_into_local_pt_app_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/250_ATF_merge_preloaded_pt_into_local_pt_app_policies.lua @@ -16,7 +16,6 @@ -- leave the "" sub-section of "app_policies" section at LocalPT without changes -- overwrite fields&values of "default", "device", "pre_DataConsent" subsections based on updated PreloadedPT --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/251_ATF_merge_preloaded_pt_into_local_pt_functional_groupings_exists.lua b/test_scripts/Policies/Validation_of_PolicyTables/251_ATF_merge_preloaded_pt_into_local_pt_functional_groupings_exists.lua index 04d0b460a0..4d64aaf64e 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/251_ATF_merge_preloaded_pt_into_local_pt_functional_groupings_exists.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/251_ATF_merge_preloaded_pt_into_local_pt_functional_groupings_exists.lua @@ -15,7 +15,6 @@ -- Expected result: -- SDL must leave the "functional_group_name" sectionat LocalPT without changes (with all 3 groups) --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') @@ -298,4 +297,4 @@ function Test.Postcondition() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/252_ATF_merge_preloaded_pt_into_local_pt_functional_groupings_does_not_exist.lua b/test_scripts/Policies/Validation_of_PolicyTables/252_ATF_merge_preloaded_pt_into_local_pt_functional_groupings_does_not_exist.lua index e3bc7b4fe9..664b310f11 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/252_ATF_merge_preloaded_pt_into_local_pt_functional_groupings_does_not_exist.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/252_ATF_merge_preloaded_pt_into_local_pt_functional_groupings_does_not_exist.lua @@ -15,7 +15,6 @@ -- Expected result: -- SDL must add the "functional_group_name" sectionat LocalPT without changes (with all 4 groups) --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/253_ATF_merge_preloaded_pt_into_local_pt_usage_and_error_counts.lua b/test_scripts/Policies/Validation_of_PolicyTables/253_ATF_merge_preloaded_pt_into_local_pt_usage_and_error_counts.lua index e6bb07ea7d..024ece23e3 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/253_ATF_merge_preloaded_pt_into_local_pt_usage_and_error_counts.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/253_ATF_merge_preloaded_pt_into_local_pt_usage_and_error_counts.lua @@ -15,10 +15,6 @@ -- Expected result: -- SDL must leave all fields & their values of "usage_and_error_count" section as it was in the database without changes --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/254_ATF_merge_preloaded_pt_into_local_pt_device_data.lua b/test_scripts/Policies/Validation_of_PolicyTables/254_ATF_merge_preloaded_pt_into_local_pt_device_data.lua index ca40647437..aa8a657062 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/254_ATF_merge_preloaded_pt_into_local_pt_device_data.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/254_ATF_merge_preloaded_pt_into_local_pt_device_data.lua @@ -15,15 +15,13 @@ -- Expected result: -- SDL must leave all fields & their values of "device_data" section as it was in the database without changes --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') local json = require("modules/json") +local utils = require ('user_modules/utils') --[[ General configuration parameters ]] Test = require('connecttest') @@ -37,7 +35,7 @@ local TESTED_DATA = { preloaded_date = {"1988-12-01","2015-05-02"}, device = { --device_data - id = tostring(config.deviceMAC), + id = tostring(utils.getDeviceMAC()), hardware = tostring(config.application1.registerAppInterfaceParams.deviceInfo.hardware), firmware_rev = tostring(config.application1.registerAppInterfaceParams.deviceInfo.firmwareRev), os = tostring(config.application1.registerAppInterfaceParams.deviceInfo.os), @@ -46,7 +44,7 @@ local TESTED_DATA = { max_number_rfcom_ports = tostring(config.application1.registerAppInterfaceParams.deviceInfo.maxNumberRFCOMMPorts) }, device_consent_group = { - device_id = tostring(config.deviceMAC), + device_id = tostring(utils.getDeviceMAC()), functional_group_id = "DataConsent-2", is_consented = "1", input = "GUI", @@ -269,7 +267,7 @@ function Test:TestStep_VerifyInitialLocalPT() end function Test:TestStep_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:TestStep_VerifyLocalPT_DeviceConsent() diff --git a/test_scripts/Policies/Validation_of_PolicyTables/255_ATF_merge_preloaded_pt_into_local_pt_launch.lua b/test_scripts/Policies/Validation_of_PolicyTables/255_ATF_merge_preloaded_pt_into_local_pt_launch.lua index 8559f328aa..1eb01ae608 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/255_ATF_merge_preloaded_pt_into_local_pt_launch.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/255_ATF_merge_preloaded_pt_into_local_pt_launch.lua @@ -14,10 +14,6 @@ -- Expected result: -- SDL must merge all updates from PreloadedPT to existing database by rules --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/256_ATF_merge_preloaded_pt_into_local_pt_launch_does_not_changed.lua b/test_scripts/Policies/Validation_of_PolicyTables/256_ATF_merge_preloaded_pt_into_local_pt_launch_does_not_changed.lua index 8c6ec0785b..8d970d67b7 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/256_ATF_merge_preloaded_pt_into_local_pt_launch_does_not_changed.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/256_ATF_merge_preloaded_pt_into_local_pt_launch_does_not_changed.lua @@ -14,10 +14,6 @@ -- Expected result: -- SDL must not update the created database --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') @@ -283,4 +279,4 @@ function Test.Postcondition() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/257_ATF_merge_preloaded_pt_into_local_pt_module_config.lua b/test_scripts/Policies/Validation_of_PolicyTables/257_ATF_merge_preloaded_pt_into_local_pt_module_config.lua index 9a55e30f5f..b4a326cfdd 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/257_ATF_merge_preloaded_pt_into_local_pt_module_config.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/257_ATF_merge_preloaded_pt_into_local_pt_module_config.lua @@ -20,9 +20,6 @@ -- leave fields and values of "vehicle_make", “model”, “year” params as they were in the database without changes -- overwrite the values with the new ones from PreloadedPT for all other fields --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/258_ATF_pt_snapshot_path_is_correct.lua b/test_scripts/Policies/Validation_of_PolicyTables/258_ATF_pt_snapshot_path_is_correct.lua index 2910b77202..0a60a43a1c 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/258_ATF_pt_snapshot_path_is_correct.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/258_ATF_pt_snapshot_path_is_correct.lua @@ -14,7 +14,6 @@ -- SDL must continue working --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -23,6 +22,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local SDL = require('modules/SDL') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -46,7 +46,7 @@ end commonFunctions:newTestCasesGroup("Test") function Test:TestStep_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:TestStep_Check_snapshot_created() @@ -71,4 +71,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/259_ATF_pt_snapshot_path_is_incorrect.lua b/test_scripts/Policies/Validation_of_PolicyTables/259_ATF_pt_snapshot_path_is_incorrect.lua index 85108bf690..1fc9a7527b 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/259_ATF_pt_snapshot_path_is_incorrect.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/259_ATF_pt_snapshot_path_is_incorrect.lua @@ -14,7 +14,6 @@ -- SDL must shutdown --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --TODO(istoimenova): shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 config.ExitOnCrash = false diff --git a/test_scripts/Policies/Validation_of_PolicyTables/260_ATF_local_pt_from_preloaded_pt_master_reset.lua b/test_scripts/Policies/Validation_of_PolicyTables/260_ATF_local_pt_from_preloaded_pt_master_reset.lua index 89e5543c39..a1cd259cd1 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/260_ATF_local_pt_from_preloaded_pt_master_reset.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/260_ATF_local_pt_from_preloaded_pt_master_reset.lua @@ -15,9 +15,6 @@ -- Expected result: -- SDL must populate the LocalPT with items from PreloadedPT --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/261_ATF_pt_snapshot_validation_rules_for_optional_parameters.lua b/test_scripts/Policies/Validation_of_PolicyTables/261_ATF_pt_snapshot_validation_rules_for_optional_parameters.lua index f459698c6e..5f5bbecc45 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/261_ATF_pt_snapshot_validation_rules_for_optional_parameters.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/261_ATF_pt_snapshot_validation_rules_for_optional_parameters.lua @@ -13,15 +13,12 @@ -- Expected result: -- SDL must store the PT snapshot with optional parameters and keep running --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start]] config.defaultProtocolVersion = 2 @@ -46,7 +43,7 @@ end --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -55,7 +52,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_CheckPTS() local result = testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {self.applications[config.application1.registerAppInterfaceParams.appName]}, "print") if(result == false) then @@ -70,4 +67,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/262_ATF_pt_snapshot_validation_rules_for_omitted_parameters.lua b/test_scripts/Policies/Validation_of_PolicyTables/262_ATF_pt_snapshot_validation_rules_for_omitted_parameters.lua index 8ea935b4cc..5744f4e7c5 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/262_ATF_pt_snapshot_validation_rules_for_omitted_parameters.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/262_ATF_pt_snapshot_validation_rules_for_omitted_parameters.lua @@ -13,15 +13,12 @@ -- Expected result: -- SDL must store the PT snapshot without omitted parameters and keep running --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start]] config.defaultProtocolVersion = 2 @@ -45,7 +42,7 @@ end --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -54,7 +51,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_CheckPTS() local result = testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {self.applications[config.application1.registerAppInterfaceParams.appName]}, "print") if(result == false) then @@ -68,4 +65,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/263_ATF_pt_snapshot_validation_rules_for_required_parameters.lua b/test_scripts/Policies/Validation_of_PolicyTables/263_ATF_pt_snapshot_validation_rules_for_required_parameters.lua index 2ebda66e0e..edce65abe8 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/263_ATF_pt_snapshot_validation_rules_for_required_parameters.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/263_ATF_pt_snapshot_validation_rules_for_required_parameters.lua @@ -13,15 +13,12 @@ -- Expected result: -- SDL must store the PT snapshot without required parameters log the corresponding error internally and keep running --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start]] config.defaultProtocolVersion = 2 @@ -45,7 +42,7 @@ end --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -54,7 +51,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_CheckPTS() local result = testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {self.applications[config.application1.registerAppInterfaceParams.appName]}, "print") if(result == false) then @@ -68,4 +65,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/264_ATF_pt_snapshot_creation_rule.lua b/test_scripts/Policies/Validation_of_PolicyTables/264_ATF_pt_snapshot_creation_rule.lua index 4d7c7430e8..1be471a1fc 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/264_ATF_pt_snapshot_creation_rule.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/264_ATF_pt_snapshot_creation_rule.lua @@ -13,15 +13,12 @@ -- Expected result: -- SDL must copy the Local Policy Table into memory and remove "messages" sub-section from "consumer_friendly_messages" section and store information as PT snapshot --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local json = require("modules/json") local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start]] config.defaultProtocolVersion = 2 @@ -64,7 +61,7 @@ end --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -82,4 +79,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/265_ATF_pt_snapshot_storage_on_file_system.lua b/test_scripts/Policies/Validation_of_PolicyTables/265_ATF_pt_snapshot_storage_on_file_system.lua index 9508e8ee32..08baa118d0 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/265_ATF_pt_snapshot_storage_on_file_system.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/265_ATF_pt_snapshot_storage_on_file_system.lua @@ -13,19 +13,18 @@ -- Expected result: -- SDL must store the PT snapshot as a JSON file which filename and filepath are defined in "PathToSnapshot" parameter of smartDeviceLink.ini file. --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] Test = require('connecttest') local config = require('config') require('user_modules/AppTypes') config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') require('cardinalities') local mobile_session = require('mobile_session') +local utils = require ('user_modules/utils') --[[ Local Variables ]] local POLICY_SNAPSHOT_FILE_NAME = "sdl_mega_snapshot.json" @@ -194,8 +193,8 @@ function Test:Precondition_ActivateApp() hmiDisplayLanguageDesired = "EN-US", deviceInfo = { - name = "127.0.0.1", - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI", isSDLAllowed = false } @@ -212,7 +211,7 @@ function Test:Precondition_ActivateApp() local RequestId2 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId2,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/266_ATF_pt_update_validation_rules_optional_parameters_type.lua b/test_scripts/Policies/Validation_of_PolicyTables/266_ATF_pt_update_validation_rules_optional_parameters_type.lua index 9889451979..4782e5de8e 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/266_ATF_pt_update_validation_rules_optional_parameters_type.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/266_ATF_pt_update_validation_rules_optional_parameters_type.lua @@ -16,10 +16,10 @@ -- Expected result: -- SDL must invalidate this received PolicyTableUpdated and log corresponding error internally --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -30,7 +30,6 @@ Test = require('connecttest') local config = require('config') require('user_modules/AppTypes') config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" local function activateAppInSpecificLevel(self) local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) @@ -49,7 +48,7 @@ local function activateAppInSpecificLevel(self) --hmi side: send request SDL.OnAllowSDLFunctionality self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") diff --git a/test_scripts/Policies/Validation_of_PolicyTables/267_ATF_pt_update_validation_rules_required_parameters_type.lua b/test_scripts/Policies/Validation_of_PolicyTables/267_ATF_pt_update_validation_rules_required_parameters_type.lua index 6417c8e827..d20c39fe7b 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/267_ATF_pt_update_validation_rules_required_parameters_type.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/267_ATF_pt_update_validation_rules_required_parameters_type.lua @@ -16,12 +16,12 @@ -- Expected result: -- SDL must invalidate this received PolicyTableUpdated and log corresponding error internally --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local json = require("modules/json") local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicySDLErrorsStops = require ('user_modules/shared_testcases/testCasesForPolicySDLErrorsStops') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -32,7 +32,6 @@ local config = require('config') require('cardinalities') require('user_modules/AppTypes') config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Local Variables ]] --local basePtuFile = "files/ptu.json" @@ -136,7 +135,7 @@ local function activateAppInSpecificLevel(self, HMIAppID, hmi_level) --hmi side: send request SDL.OnAllowSDLFunctionality self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") diff --git a/test_scripts/Policies/Validation_of_PolicyTables/268_ATF_pt_update_validation_rules_general.lua b/test_scripts/Policies/Validation_of_PolicyTables/268_ATF_pt_update_validation_rules_general.lua index 5f47157a91..dee8cc4cbb 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/268_ATF_pt_update_validation_rules_general.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/268_ATF_pt_update_validation_rules_general.lua @@ -31,7 +31,6 @@ commonSteps:DeleteLogsFileAndPolicyTable() Test = require('connecttest') local config = require('config') config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" require('cardinalities') require('user_modules/AppTypes') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/269_ATF_pt_update_validation_rules_consumer_friendly_message.lua b/test_scripts/Policies/Validation_of_PolicyTables/269_ATF_pt_update_validation_rules_consumer_friendly_message.lua index c9de2cae2c..d4455aa92a 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/269_ATF_pt_update_validation_rules_consumer_friendly_message.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/269_ATF_pt_update_validation_rules_consumer_friendly_message.lua @@ -16,17 +16,16 @@ -- Expected result: -- In case "en-us" sub-section for at least one is not found in PTUpdate , PoliciesManager must reject PTU and assume it as invalid --------------------------------------------------------------------------------------------- - --[[ Required Shared libraries ]] local json = require("modules/json") local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicySDLErrorsStops = require ('user_modules/shared_testcases/testCasesForPolicySDLErrorsStops') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ General configuration parameters ]] Test = require('connecttest') @@ -153,7 +152,7 @@ local function activateAppInSpecificLevel(self, HMIAppID, hmi_level) --hmi side: send request SDL.OnAllowSDLFunctionality self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") @@ -423,4 +422,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/270_ATF_Validate_default_hmi_default_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/270_ATF_Validate_default_hmi_default_policies.lua index f5075956ae..ca54c264df 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/270_ATF_Validate_default_hmi_default_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/270_ATF_Validate_default_hmi_default_policies.lua @@ -16,12 +16,10 @@ -- Expected result: -- PoliciesManager must validate "default_hmi" sub-section in "default" and treat it as valid -> PTU invalid --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -36,7 +34,6 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_Activate_app() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) EXPECT_HMIRESPONSE(RequestId) :Do(function(_,data) @@ -45,7 +42,7 @@ function Test:Precondition_Activate_app() EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,_data1) self.hmiConnection:SendResponse(_data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -94,4 +91,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/271_ATF_Validate_preconsented_groups_default_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/271_ATF_Validate_preconsented_groups_default_policies.lua index 69af0334d8..068fba1d5f 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/271_ATF_Validate_preconsented_groups_default_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/271_ATF_Validate_preconsented_groups_default_policies.lua @@ -15,12 +15,10 @@ -- Expected result: -- PoliciesManager must validate "preconsented_groups" sub-section in "default" and treat it as valid -> PTU is valid --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -35,7 +33,6 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_Activate_app() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) EXPECT_HMIRESPONSE(RequestId) :Do(function(_,data) @@ -44,7 +41,7 @@ function Test:Precondition_Activate_app() EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -102,4 +99,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/272_ATF_Validate_groups_default_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/272_ATF_Validate_groups_default_policies.lua index 8a748a0d30..c4aa108680 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/272_ATF_Validate_groups_default_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/272_ATF_Validate_groups_default_policies.lua @@ -15,12 +15,10 @@ -- Expected result: -- PoliciesManager must validate "groups" sub-section in "default" and treat it as valid -> PTU is valid --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -42,7 +40,7 @@ function Test:Precondition_Activate_app() local RequestIdGetMes = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/273_ATF_Validate_default_hmi_appId_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/273_ATF_Validate_default_hmi_appId_policies.lua index 69c77b0cf5..0e98440c84 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/273_ATF_Validate_default_hmi_appId_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/273_ATF_Validate_default_hmi_appId_policies.lua @@ -18,13 +18,13 @@ -- PoliciesManager must validate "default_hmi" sub-section in "" and treat it as valid -> PTU valid --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -53,7 +53,6 @@ function Test:Precondition_Register_app() end function Test:Precondition_Activate_app() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", {appID = self.HMIAppID2 }) EXPECT_HMIRESPONSE(RequestId,{}) :Do(function(_,data) @@ -63,7 +62,7 @@ function Test:Precondition_Activate_app() EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -120,4 +119,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/274_ATF_Validate_appID_and_steal_focus_false.lua b/test_scripts/Policies/Validation_of_PolicyTables/274_ATF_Validate_appID_and_steal_focus_false.lua index 6058b466ca..de85d5bfca 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/274_ATF_Validate_appID_and_steal_focus_false.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/274_ATF_Validate_appID_and_steal_focus_false.lua @@ -16,13 +16,13 @@ -- respond (resultCode:DISALLOWED, success:false) to mobile application --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -127,7 +127,7 @@ function Test:Precondition_Activate_app() EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -180,4 +180,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/275_ATF_Validate_appID_and_steal_focus_true.lua b/test_scripts/Policies/Validation_of_PolicyTables/275_ATF_Validate_appID_and_steal_focus_true.lua index eae08bfb5c..07cf784da9 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/275_ATF_Validate_appID_and_steal_focus_true.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/275_ATF_Validate_appID_and_steal_focus_true.lua @@ -19,13 +19,13 @@ -- PoliciesManager must allow SDL to pass RPC --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -130,7 +130,7 @@ function Test:Precondition_Activate_app() EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -204,4 +204,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/276_ATF_Validate_appID_and_keep_context_true.lua b/test_scripts/Policies/Validation_of_PolicyTables/276_ATF_Validate_appID_and_keep_context_true.lua index ac9ec242a1..b939b3e956 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/276_ATF_Validate_appID_and_keep_context_true.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/276_ATF_Validate_appID_and_keep_context_true.lua @@ -19,13 +19,13 @@ -- PoliciesManager must allow SDL to pass RPC --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -130,7 +130,7 @@ function Test:Precondition_Activate_app() EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -204,4 +204,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/277_ATF_Validate_appID_and_keep_context_false.lua b/test_scripts/Policies/Validation_of_PolicyTables/277_ATF_Validate_appID_and_keep_context_false.lua index 18e3a7734c..af80b5cfe3 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/277_ATF_Validate_appID_and_keep_context_false.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/277_ATF_Validate_appID_and_keep_context_false.lua @@ -16,13 +16,13 @@ -- respond (resultCode:DISALLOWED, success:false) to mobile application --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -127,7 +127,7 @@ function Test:Precondition_Activate_app() EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -181,4 +181,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/278_ATF_Validate_groups_appID_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/278_ATF_Validate_groups_appID_policies.lua index dff5086ee9..552358c07b 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/278_ATF_Validate_groups_appID_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/278_ATF_Validate_groups_appID_policies.lua @@ -17,13 +17,13 @@ -- PoliciesManager must validate "groups" sub-section in "" and treat it as valid -> PTU is valid --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -52,7 +52,6 @@ function Test:Precondition_Register_app() end function Test:Precondition_Activate_app() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", {appID = self.HMIAppID2 }) EXPECT_HMIRESPONSE(RequestId,{}) :Do(function(_,data) @@ -62,7 +61,7 @@ function Test:Precondition_Activate_app() EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -118,4 +117,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/279_ATF_Store_vin_from_GetVehicleData_in_PT.lua b/test_scripts/Policies/Validation_of_PolicyTables/279_ATF_Store_vin_from_GetVehicleData_in_PT.lua index cb7af4d787..425a7889ae 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/279_ATF_Store_vin_from_GetVehicleData_in_PT.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/279_ATF_Store_vin_from_GetVehicleData_in_PT.lua @@ -15,7 +15,6 @@ -- PoliciesManager writes to "module_meta" section of created LocalPT --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 diff --git a/test_scripts/Policies/Validation_of_PolicyTables/280_ATF_Reset_ignition_cycles_since_last_exchange_in_PT.lua b/test_scripts/Policies/Validation_of_PolicyTables/280_ATF_Reset_ignition_cycles_since_last_exchange_in_PT.lua index cb67722a31..6a0fa2f6b7 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/280_ATF_Reset_ignition_cycles_since_last_exchange_in_PT.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/280_ATF_Reset_ignition_cycles_since_last_exchange_in_PT.lua @@ -19,7 +19,6 @@ -- On successful PolicyTable exchange, Policies Manager must reset to "0" the value in 'ignition_cycles_since_last_exchange" --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 config.application1.registerAppInterfaceParams.appHMIType = { "MEDIA" } @@ -29,6 +28,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonTestCases = require ('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[ Local variables ]] local ignition_cycles_before_ptu @@ -149,7 +149,7 @@ function Test:TestStep_Ignition_cycles_since_last_exchange_not_reset_after_RAI() end end function Test:TestStep_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:TestStep_flow_SUCCEESS_EXTERNAL_PROPRIETARY() diff --git a/test_scripts/Policies/Validation_of_PolicyTables/281_ATF_Store_ignition_cycles_since_last_exchange_in_PT.lua b/test_scripts/Policies/Validation_of_PolicyTables/281_ATF_Store_ignition_cycles_since_last_exchange_in_PT.lua index 9ebfdc142c..a31eb8db13 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/281_ATF_Store_ignition_cycles_since_last_exchange_in_PT.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/281_ATF_Store_ignition_cycles_since_last_exchange_in_PT.lua @@ -19,7 +19,6 @@ -- Pollicies Manager must increment the value in 'ignition_cycles_since_last_exchange' section of LocalPT --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 diff --git a/test_scripts/Policies/Validation_of_PolicyTables/282_ATF_PT_Exchanged_X_Days_After_Epoch_In_PTS.lua b/test_scripts/Policies/Validation_of_PolicyTables/282_ATF_PT_Exchanged_X_Days_After_Epoch_In_PTS.lua index e40830168c..5e41cabfea 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/282_ATF_PT_Exchanged_X_Days_After_Epoch_In_PTS.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/282_ATF_PT_Exchanged_X_Days_After_Epoch_In_PTS.lua @@ -14,15 +14,14 @@ -- Expected result: -- a) pt_exchanged_x_days_after_epoch value is equal to time of successfully updating --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -63,7 +62,7 @@ function Test:Precondition_Activate_App_Consent_Device_And_Update_Policy() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) -- GetCurrentTimeStampDeviceConsent() EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) @@ -129,4 +128,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/283_ATF_Store_pt_exchanged_at_odometer_x_in_PT.lua b/test_scripts/Policies/Validation_of_PolicyTables/283_ATF_Store_pt_exchanged_at_odometer_x_in_PT.lua index 8b6163d79d..f676583ff2 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/283_ATF_Store_pt_exchanged_at_odometer_x_in_PT.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/283_ATF_Store_pt_exchanged_at_odometer_x_in_PT.lua @@ -18,13 +18,13 @@ -- value must be stored in LocalPT in "pt_exchanged_at_odometer_x" of "meta_data" section --------------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -47,7 +47,7 @@ function Test:Precondition_Activate_app() EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/284_ATF_Store_wers_country_code_in_PT.lua b/test_scripts/Policies/Validation_of_PolicyTables/284_ATF_Store_wers_country_code_in_PT.lua index b191d75343..6e8029cb58 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/284_ATF_Store_wers_country_code_in_PT.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/284_ATF_Store_wers_country_code_in_PT.lua @@ -17,7 +17,6 @@ -- SDL must set received value to "wers_country_code" section of "module_meta" section in PolicyTable --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 diff --git a/test_scripts/Policies/Validation_of_PolicyTables/285_ATF_Store_language_in_PT.lua b/test_scripts/Policies/Validation_of_PolicyTables/285_ATF_Store_language_in_PT.lua index 97db7a1e65..02479ac53c 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/285_ATF_Store_language_in_PT.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/285_ATF_Store_language_in_PT.lua @@ -17,7 +17,6 @@ -- SDL must set received value to "language" section of "module_meta" section in PolicyTable --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 diff --git a/test_scripts/Policies/Validation_of_PolicyTables/286_ATF_RAI_ccpu_version_via_GetSystemInfo.lua b/test_scripts/Policies/Validation_of_PolicyTables/286_ATF_RAI_ccpu_version_via_GetSystemInfo.lua index 51b29a41d2..89bc898936 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/286_ATF_RAI_ccpu_version_via_GetSystemInfo.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/286_ATF_RAI_ccpu_version_via_GetSystemInfo.lua @@ -15,7 +15,6 @@ -- SDL must request 'ccpu_version' ONLY once in ign cycle --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 diff --git a/test_scripts/Policies/Validation_of_PolicyTables/287_ATF_Validate_appHMIType_appID_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/287_ATF_Validate_appHMIType_appID_policies.lua index fdcb9a6cc2..8aa5099f10 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/287_ATF_Validate_appHMIType_appID_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/287_ATF_Validate_appHMIType_appID_policies.lua @@ -17,13 +17,13 @@ -- PoliciesManager must validate "appHMIType" sub-section in "" and treat it as valid -> PTU is valid --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -61,7 +61,7 @@ function Test:Precondition_Activate_app() EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -118,4 +118,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/288_ATF_EmptyArray_preconsented_groups_preDataConsent.lua b/test_scripts/Policies/Validation_of_PolicyTables/288_ATF_EmptyArray_preconsented_groups_preDataConsent.lua index c61d41ce36..084f3e8d5d 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/288_ATF_EmptyArray_preconsented_groups_preDataConsent.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/288_ATF_EmptyArray_preconsented_groups_preDataConsent.lua @@ -16,7 +16,6 @@ -- PoliciesManager must validate "preconsented_groups" sub-section in "pre_DataConsent" and treat it as invalid -> PTU invalid --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 config.ExitOnCrash = false diff --git a/test_scripts/Policies/Validation_of_PolicyTables/289_ATF_EmptyValue_preconsented_groups_preDataConsent.lua b/test_scripts/Policies/Validation_of_PolicyTables/289_ATF_EmptyValue_preconsented_groups_preDataConsent.lua index f1623db9ab..e8c41d0cb7 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/289_ATF_EmptyValue_preconsented_groups_preDataConsent.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/289_ATF_EmptyValue_preconsented_groups_preDataConsent.lua @@ -16,7 +16,6 @@ -- PoliciesManager must validate "preconsented_groups" sub-section in "pre_DataConsent" and treat it as invalid -> PTU invalid --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 config.ExitOnCrash = false diff --git a/test_scripts/Policies/Validation_of_PolicyTables/290_ATF_Nonfunctional_preconsented_groups_preDataConsent.lua b/test_scripts/Policies/Validation_of_PolicyTables/290_ATF_Nonfunctional_preconsented_groups_preDataConsent.lua index cef8ccc052..b777edbf11 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/290_ATF_Nonfunctional_preconsented_groups_preDataConsent.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/290_ATF_Nonfunctional_preconsented_groups_preDataConsent.lua @@ -16,7 +16,6 @@ -- PoliciesManager must validate "preconsented_groups" sub-section in "pre_DataConsent" and treat it as invalid -> PTU invalid --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/Validation_of_PolicyTables/291_ATF_Valid_preconsented_groups_preDataConsent.lua b/test_scripts/Policies/Validation_of_PolicyTables/291_ATF_Valid_preconsented_groups_preDataConsent.lua index ddb83a0c14..8e2fb83708 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/291_ATF_Valid_preconsented_groups_preDataConsent.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/291_ATF_Valid_preconsented_groups_preDataConsent.lua @@ -16,7 +16,6 @@ -- PoliciesManager must validate "preconsented_groups" sub-section in "pre_DataConsent" and treat it as valid->PTU is valid --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 diff --git a/test_scripts/Policies/Validation_of_PolicyTables/292_ATF_Valid_default_hmi_preDataConsent.lua b/test_scripts/Policies/Validation_of_PolicyTables/292_ATF_Valid_default_hmi_preDataConsent.lua index c5796888ea..26c03c00ea 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/292_ATF_Valid_default_hmi_preDataConsent.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/292_ATF_Valid_default_hmi_preDataConsent.lua @@ -16,7 +16,6 @@ -- PoliciesManager must validate "default_hmi"(BACKGROUND) sub-section in "pre_DataConsent" and treat it valid --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 diff --git a/test_scripts/Policies/Validation_of_PolicyTables/293_ATF_Validate_default_priority_preDataConsent.lua b/test_scripts/Policies/Validation_of_PolicyTables/293_ATF_Validate_default_priority_preDataConsent.lua index adfcaef268..d2c98e76c8 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/293_ATF_Validate_default_priority_preDataConsent.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/293_ATF_Validate_default_priority_preDataConsent.lua @@ -16,16 +16,13 @@ -- Expected result: -- PoliciesManager must not provide to HMI the app`s priority value --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -56,8 +53,8 @@ function Test:Precondition_Connect_device() { deviceList = { { - id = config.deviceMAC, - name = "127.0.0.1", + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI" } } diff --git a/test_scripts/Policies/Validation_of_PolicyTables/294_ATF_Validate_nondefault_priority_preDataConsent.lua b/test_scripts/Policies/Validation_of_PolicyTables/294_ATF_Validate_nondefault_priority_preDataConsent.lua index 31f85477d1..33c32392dc 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/294_ATF_Validate_nondefault_priority_preDataConsent.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/294_ATF_Validate_nondefault_priority_preDataConsent.lua @@ -17,15 +17,13 @@ -- Expected result: -- PoliciesManager must not provide to HMI the app`s priority value --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -54,8 +52,8 @@ function Test:Precondition_Connect_device() { deviceList = { { - id = config.deviceMAC, - name = "127.0.0.1", + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI" } } diff --git a/test_scripts/Policies/Validation_of_PolicyTables/295_ATF_Validate_preDataConsent_and_stealFocus_false.lua b/test_scripts/Policies/Validation_of_PolicyTables/295_ATF_Validate_preDataConsent_and_stealFocus_false.lua index 7185646da5..b27286fd46 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/295_ATF_Validate_preDataConsent_and_stealFocus_false.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/295_ATF_Validate_preDataConsent_and_stealFocus_false.lua @@ -15,9 +15,6 @@ -- PoliciesManager must validate "steal_focus" section, SDL must reject RPC-> -- respond (resultCode:DISALLOWED, success:false) to mobile application --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') @@ -73,4 +70,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/296_ATF_Validate_preDataConsent_and_stealFocus_true.lua b/test_scripts/Policies/Validation_of_PolicyTables/296_ATF_Validate_preDataConsent_and_stealFocus_true.lua index 631bd659d7..7a0af50df7 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/296_ATF_Validate_preDataConsent_and_stealFocus_true.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/296_ATF_Validate_preDataConsent_and_stealFocus_true.lua @@ -15,9 +15,6 @@ -- PoliciesManager must validate "steal_focus" section-> -- PoliciesManager must allow SDL to pas RPC --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') @@ -93,4 +90,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/297_ATF_Validate_preDataConsent_and_keepContext_false.lua b/test_scripts/Policies/Validation_of_PolicyTables/297_ATF_Validate_preDataConsent_and_keepContext_false.lua index d707f4cf72..bb54d76fb8 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/297_ATF_Validate_preDataConsent_and_keepContext_false.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/297_ATF_Validate_preDataConsent_and_keepContext_false.lua @@ -20,9 +20,6 @@ Test = require('connecttest') require('cardinalities') require('user_modules/AppTypes') ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') @@ -73,4 +70,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/298_ATF_Validate_preDataConsent_and_keepContext_true.lua b/test_scripts/Policies/Validation_of_PolicyTables/298_ATF_Validate_preDataConsent_and_keepContext_true.lua index 77f53b1038..91be927c4e 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/298_ATF_Validate_preDataConsent_and_keepContext_true.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/298_ATF_Validate_preDataConsent_and_keepContext_true.lua @@ -15,9 +15,6 @@ -- PoliciesManager must validate "keep_context" section-> -- PoliciesManager must allow SDL to pass RPC --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') @@ -93,4 +90,4 @@ function Test.Postcondition_SDLStop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/299_ATF_Memory_Kb_Constraints_Ignoring.lua b/test_scripts/Policies/Validation_of_PolicyTables/299_ATF_Memory_Kb_Constraints_Ignoring.lua index 390bd2a014..6aa3b91790 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/299_ATF_Memory_Kb_Constraints_Ignoring.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/299_ATF_Memory_Kb_Constraints_Ignoring.lua @@ -17,9 +17,7 @@ -- a) PutFile SUCCESS resultCode - memory_kb parameter is ignored for app -- b) PutFile OUT_OF_MEMORY resultCode - AppDirectoryQuota applies for app --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 config.application1.registerAppInterfaceParams.appName = "SPT" @@ -31,6 +29,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -65,7 +64,7 @@ function Test:TestStep_PredataConsent_Send_PutFile_Bigger_Than_AppDirectoryQuota end function Test:TestStep_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:TestStep_Default_Send_PutFile_Bigger_Than_AppDirectoryQuota_OUT_OF_MEMORY() diff --git a/test_scripts/Policies/Validation_of_PolicyTables/300_ATF_HP_Applying_Heart_Beat_Timeout_Ms_From_PT.lua b/test_scripts/Policies/Validation_of_PolicyTables/300_ATF_HP_Applying_Heart_Beat_Timeout_Ms_From_PT.lua index 80af820cdd..baf4fdb578 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/300_ATF_HP_Applying_Heart_Beat_Timeout_Ms_From_PT.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/300_ATF_HP_Applying_Heart_Beat_Timeout_Ms_From_PT.lua @@ -17,10 +17,6 @@ -- Expected result: -- a) SDL send HB with time specified in pre_DataConsent section (4000 ms) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/301_ATF_usage_and_error_counts_update_app_registration_language_vui.lua b/test_scripts/Policies/Validation_of_PolicyTables/301_ATF_usage_and_error_counts_update_app_registration_language_vui.lua index d0e44608c2..45e06d4023 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/301_ATF_usage_and_error_counts_update_app_registration_language_vui.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/301_ATF_usage_and_error_counts_update_app_registration_language_vui.lua @@ -16,18 +16,17 @@ -- SDL must: must write "languageDesired" value received via RegisterAppInterface into Local Policy Table -- as "app_registration_language_vui" key value of "usage_and_error_counts"- >"app_level" - > section. --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] Test = require('connecttest') local config = require('config') config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local json = require("modules/json") local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTableSnapshot = require ('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') require('cardinalities') require('user_modules/AppTypes') @@ -332,7 +331,7 @@ local function activateAppInSpecificLevel(self, HMIAppID, hmi_level) --hmi side: send request SDL.OnAllowSDLFunctionality self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") diff --git a/test_scripts/Policies/Validation_of_PolicyTables/302_ATF_HP_Applying_Heart_Beat_Timeout_Ms_After_PTU.lua b/test_scripts/Policies/Validation_of_PolicyTables/302_ATF_HP_Applying_Heart_Beat_Timeout_Ms_After_PTU.lua index f03fda6e25..3e69d958a5 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/302_ATF_HP_Applying_Heart_Beat_Timeout_Ms_After_PTU.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/302_ATF_HP_Applying_Heart_Beat_Timeout_Ms_After_PTU.lua @@ -18,15 +18,12 @@ -- Expected result: -- a) SDL send HB with time specified in pre_DataConsent section (4000 ms) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') +local utils = require ('user_modules/utils') --Heartbeat is supported after protocolversion 3 config.defaultProtocolVersion = 3 @@ -83,11 +80,11 @@ function Test:Precondition_RegisterApp() end function Test:Precondition_Activate_Consent_App() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_Update_Policy_With_heart_beat_timeout_ms_Param() - testCasesForPolicyTable:flow_SUCCEESS_EXTERNAL_PROPRIETARY(self, config.application1.registerAppInterfaceParams.appID, config.deviceMAC, + testCasesForPolicyTable:flow_SUCCEESS_EXTERNAL_PROPRIETARY(self, config.application1.registerAppInterfaceParams.appID, utils.getDeviceMAC(), self.HMIAppID, nil, nil, "ptu_heart_beat_timeout_ms_app_1234567.json") end diff --git a/test_scripts/Policies/Validation_of_PolicyTables/303_ATF_HP_Usage_And_Error_Counts_For_AppID.lua b/test_scripts/Policies/Validation_of_PolicyTables/303_ATF_HP_Usage_And_Error_Counts_For_AppID.lua index 60660b3637..8a03780882 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/303_ATF_HP_Usage_And_Error_Counts_For_AppID.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/303_ATF_HP_Usage_And_Error_Counts_For_AppID.lua @@ -15,7 +15,6 @@ -- a) App present in usage_and_error_counts section in PTS --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -26,6 +25,7 @@ require('cardinalities') --[[ Required Shared libraries ]] local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') +local utils = require ('user_modules/utils') require('user_modules/AppTypes') --[[ General Precondition before ATF start ]] @@ -57,12 +57,12 @@ function Test:Activate_App_Consent_Device_And_Check_Error_Count_For_App_In_PTS() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) end) - :Times(AtLeast(1)) + :Times(AtLeast(1)) end) end) EXPECT_NOTIFICATION("OnHMIStatus", {hmiLevel = "FULL", systemContext = "MAIN"}) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/304_ATF_HP_Validation_Count_Of_User_Selections.lua b/test_scripts/Policies/Validation_of_PolicyTables/304_ATF_HP_Validation_Count_Of_User_Selections.lua index a7fcbc6852..1b73cd8b72 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/304_ATF_HP_Validation_Count_Of_User_Selections.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/304_ATF_HP_Validation_Count_Of_User_Selections.lua @@ -18,7 +18,6 @@ -- a) "count_of_user_selections" in PTS is equal actual numbers of app activation --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -29,6 +28,7 @@ require('cardinalities') --[[ Required Shared libraries ]] local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') +local utils = require ('user_modules/utils') require('user_modules/AppTypes') --[[ General Precondition before ATF start ]] @@ -48,7 +48,7 @@ function Test:Precondition_Activate_App_Consent_Device() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/306_ATF_Update_count_of_run_attempts_while_revoked_in_PT.lua b/test_scripts/Policies/Validation_of_PolicyTables/306_ATF_Update_count_of_run_attempts_while_revoked_in_PT.lua index 82be8e7d61..16208cb518 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/306_ATF_Update_count_of_run_attempts_while_revoked_in_PT.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/306_ATF_Update_count_of_run_attempts_while_revoked_in_PT.lua @@ -22,13 +22,13 @@ -- PoliciesManager increments "count_of_run_attempts_while_revoked" at PolicyTable --------------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Variables ]] local HMIAppID @@ -48,7 +48,7 @@ require('cardinalities') --[[ Precondtions]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:TestStep_PTU_appPermissionsConsentNeeded_true() diff --git a/test_scripts/Policies/Validation_of_PolicyTables/307_ATF_Validate_preDataConsent_RequestType_disallowed.lua b/test_scripts/Policies/Validation_of_PolicyTables/307_ATF_Validate_preDataConsent_RequestType_disallowed.lua index d859acc5b5..e67de731cb 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/307_ATF_Validate_preDataConsent_RequestType_disallowed.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/307_ATF_Validate_preDataConsent_RequestType_disallowed.lua @@ -18,7 +18,6 @@ -- PoliciesManager must ignore RPC, SDL must respond (resultCode:DISALLOWED, success:false) to mobile application --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[ToDo: should be removed when fixed: "ATF does not stop HB timers by closing session and connection" config.defaultProtocolVersion = 2 @@ -137,4 +136,4 @@ end function Test.Postcondition_Restore_preloaded() Restore_preloaded() -end \ No newline at end of file +end diff --git a/test_scripts/Policies/Validation_of_PolicyTables/308_ATF_Check_app_registration_language_gui.lua b/test_scripts/Policies/Validation_of_PolicyTables/308_ATF_Check_app_registration_language_gui.lua index e6d99c0e8f..a8c7c10fa6 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/308_ATF_Check_app_registration_language_gui.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/308_ATF_Check_app_registration_language_gui.lua @@ -19,9 +19,7 @@ -- Expected: -- 4. PolciesManager writes to "app_registration_language_gui" field at LocalPT --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appHMIType = { "MEDIA" } config.defaultProtocolVersion = 2 diff --git a/test_scripts/Policies/Validation_of_PolicyTables/309_ATF_Check_count_of_rejected_rpcs_calls.lua b/test_scripts/Policies/Validation_of_PolicyTables/309_ATF_Check_count_of_rejected_rpcs_calls.lua index a6849d62d2..054a8f3150 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/309_ATF_Check_count_of_rejected_rpcs_calls.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/309_ATF_Check_count_of_rejected_rpcs_calls.lua @@ -19,9 +19,6 @@ -- Expected: -- PoliciesManager increments "count_of_rejected_rpcs_calls" field at PolicyTable --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/Validation_of_PolicyTables/310_ATF_Check_count_of_removals_for_bad_behavior_REQUEST_WHILE_IN_NONE_HMI_LEVEL.lua b/test_scripts/Policies/Validation_of_PolicyTables/310_ATF_Check_count_of_removals_for_bad_behavior_REQUEST_WHILE_IN_NONE_HMI_LEVEL.lua index 049daf439c..71c9a134b8 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/310_ATF_Check_count_of_removals_for_bad_behavior_REQUEST_WHILE_IN_NONE_HMI_LEVEL.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/310_ATF_Check_count_of_removals_for_bad_behavior_REQUEST_WHILE_IN_NONE_HMI_LEVEL.lua @@ -27,9 +27,8 @@ -- 3. PoliciesManager increments value of -- Thic - +--------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 config.ExitOnCrash = false @@ -38,6 +37,7 @@ local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local Preconditions = require('user_modules/shared_testcases/commonPreconditions') local mobile_session = require('mobile_session') + -- local variables local count_of_requests = 10 -- local HMIAppID diff --git a/test_scripts/Policies/Validation_of_PolicyTables/311_ATF_Check_count_of_removals_for_bad_behavior_too_many_pending_requests.lua b/test_scripts/Policies/Validation_of_PolicyTables/311_ATF_Check_count_of_removals_for_bad_behavior_too_many_pending_requests.lua index 5618d5d30c..5a3b3dd5f7 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/311_ATF_Check_count_of_removals_for_bad_behavior_too_many_pending_requests.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/311_ATF_Check_count_of_removals_for_bad_behavior_too_many_pending_requests.lua @@ -22,9 +22,7 @@ -- Application is unregistered: SDL->appID: OnAppUnregistered(TOO_MANY_REQUESTS) -- PoliciesManager increments value of --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 config.ExitOnCrash = false @@ -33,6 +31,7 @@ local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonPreconditions = require("user_modules/shared_testcases/commonPreconditions") local commonTestCases = require("user_modules/shared_testcases/commonTestCases") +local utils = require ('user_modules/utils') -- local variables local count_of_requests = 10 @@ -63,7 +62,7 @@ function Test:ActivateApp() local requestId2 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", { language = "EN-US", messageCodes = { "DataConsent" } }) EXPECT_HMIRESPONSE(requestId2) :Do(function() - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, d2) self.hmiConnection:SendResponse(d2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/312_ATF_Check_count_of_removals_for_bad_behavior_too_many_requests.lua b/test_scripts/Policies/Validation_of_PolicyTables/312_ATF_Check_count_of_removals_for_bad_behavior_too_many_requests.lua index 64a72b6e91..ce9c15a8ff 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/312_ATF_Check_count_of_removals_for_bad_behavior_too_many_requests.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/312_ATF_Check_count_of_removals_for_bad_behavior_too_many_requests.lua @@ -23,9 +23,8 @@ -- Expected: -- 3. PoliciesManager increments value of - +--------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] @@ -33,6 +32,7 @@ local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local mobile_session = require('mobile_session') local Preconditions = require('user_modules/shared_testcases/commonPreconditions') + -- local variables local count_of_requests = 10 local HMIAppID diff --git a/test_scripts/Policies/Validation_of_PolicyTables/313_ATF_Check_count_of_rpcs_sent_in_hmi_none.lua b/test_scripts/Policies/Validation_of_PolicyTables/313_ATF_Check_count_of_rpcs_sent_in_hmi_none.lua index 18e3ffc4bb..90febc2f37 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/313_ATF_Check_count_of_rpcs_sent_in_hmi_none.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/313_ATF_Check_count_of_rpcs_sent_in_hmi_none.lua @@ -16,10 +16,7 @@ -- Expected: -- 2. PoliciesManager increment "count_of_rpcs_sent_in_hmi_none" at LocalPT for this app - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - +--------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') @@ -56,4 +53,4 @@ function Test:CheckDB_updated_count_of_rejections_duplicate_name() end end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/Validation_of_PolicyTables/314_ATF_Check_count_of_user_selections.lua b/test_scripts/Policies/Validation_of_PolicyTables/314_ATF_Check_count_of_user_selections.lua index 43cd8b5202..1319958c88 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/314_ATF_Check_count_of_user_selections.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/314_ATF_Check_count_of_user_selections.lua @@ -18,7 +18,6 @@ -- 3. PoliciesMananger increments "count_of_rejections_duplicate_name" filed at PolicyTable --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 diff --git a/test_scripts/Policies/appID_Management/031_ATF_Register_App_Interface_App_Unauthorized.lua b/test_scripts/Policies/appID_Management/031_ATF_Register_App_Interface_App_Unauthorized.lua index 91d878a711..0534e0e500 100644 --- a/test_scripts/Policies/appID_Management/031_ATF_Register_App_Interface_App_Unauthorized.lua +++ b/test_scripts/Policies/appID_Management/031_ATF_Register_App_Interface_App_Unauthorized.lua @@ -21,16 +21,13 @@ -- currently registered appName is different from value in policy table -> -- SDL->app: OnAppInterfaceUnregistered (APP_UNAUTHORIZED) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local testCasesForPolicyAppIdManagament = require("user_modules/shared_testcases/testCasesForPolicyAppIdManagament") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +41,7 @@ local mobileSession = require("mobile_session") commonFunctions:newTestCasesGroup("Preconditions") function Test:Pecondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:UpdatePolicy() diff --git a/test_scripts/Policies/appID_Management/032_ATF_Register_App_Interface_Successful_Nickname_Validation.lua b/test_scripts/Policies/appID_Management/032_ATF_Register_App_Interface_Successful_Nickname_Validation.lua index f28183008a..05804c0f1a 100644 --- a/test_scripts/Policies/appID_Management/032_ATF_Register_App_Interface_Successful_Nickname_Validation.lua +++ b/test_scripts/Policies/appID_Management/032_ATF_Register_App_Interface_Successful_Nickname_Validation.lua @@ -21,16 +21,13 @@ -- SDL must successfully register such application: -- RegisterAppInterface_response (, success: true) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyAppIdManagament = require("user_modules/shared_testcases/testCasesForPolicyAppIdManagament") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -42,7 +39,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Pecondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:UpdatePolicy() diff --git a/test_scripts/Policies/appID_Management/033_ATF_Register_App_Interface_Order_Of_Nickname_Validation.lua b/test_scripts/Policies/appID_Management/033_ATF_Register_App_Interface_Order_Of_Nickname_Validation.lua index f3c2acd24e..684a36a19a 100644 --- a/test_scripts/Policies/appID_Management/033_ATF_Register_App_Interface_Order_Of_Nickname_Validation.lua +++ b/test_scripts/Policies/appID_Management/033_ATF_Register_App_Interface_Order_Of_Nickname_Validation.lua @@ -22,16 +22,13 @@ -- Expected result: -- SDL returns RegisterAppInterface's response (DISALLOWED, success: false) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local testCasesForPolicyAppIdManagament = require("user_modules/shared_testcases/testCasesForPolicyAppIdManagament") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +40,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Pecondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:UpdatePolicy() diff --git a/test_scripts/Policies/appID_Management/034_ATF_Register_App_Interface_Disallowed.lua b/test_scripts/Policies/appID_Management/034_ATF_Register_App_Interface_Disallowed.lua index d8dc25815b..58076db06d 100644 --- a/test_scripts/Policies/appID_Management/034_ATF_Register_App_Interface_Disallowed.lua +++ b/test_scripts/Policies/appID_Management/034_ATF_Register_App_Interface_Disallowed.lua @@ -18,16 +18,13 @@ -- Expected result: -- SDL must respond with the following data: success = false, resultCode = "DISALLOWED" --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local testCasesForPolicyAppIdManagament = require("user_modules/shared_testcases/testCasesForPolicyAppIdManagament") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -39,7 +36,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Pecondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:UpdatePolicy() diff --git a/test_scripts/Policies/appID_Management/035_ATF_Register_App_Interface_Case-insensitivity_Of_AppName.lua b/test_scripts/Policies/appID_Management/035_ATF_Register_App_Interface_Case-insensitivity_Of_AppName.lua index df9ddbd6e8..fd14d8a55d 100644 --- a/test_scripts/Policies/appID_Management/035_ATF_Register_App_Interface_Case-insensitivity_Of_AppName.lua +++ b/test_scripts/Policies/appID_Management/035_ATF_Register_App_Interface_Case-insensitivity_Of_AppName.lua @@ -19,16 +19,13 @@ -- Expected result: -- SDL must respond with the following data: success = true, resultCode = "SUCCESS" --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local testCasesForPolicyAppIdManagament = require("user_modules/shared_testcases/testCasesForPolicyAppIdManagament") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -40,7 +37,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Pecondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:UpdatePolicy() @@ -68,4 +65,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/appID_Management/036_ATF_Change_Registration_Disallowed.lua b/test_scripts/Policies/appID_Management/036_ATF_Change_Registration_Disallowed.lua index 78dd06b8e4..8b9bc690ed 100644 --- a/test_scripts/Policies/appID_Management/036_ATF_Change_Registration_Disallowed.lua +++ b/test_scripts/Policies/appID_Management/036_ATF_Change_Registration_Disallowed.lua @@ -18,10 +18,6 @@ -- Expected result: -- Response has the following data: success = false, resultCode = "DISALLOWED" --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local testCasesForPolicyAppIdManagament = require("user_modules/shared_testcases/testCasesForPolicyAppIdManagament") @@ -29,6 +25,7 @@ local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local commonTestCases = require("user_modules/shared_testcases/commonTestCases") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -40,7 +37,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Pecondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_UpdatePolicy() diff --git a/test_scripts/Policies/appID_Management/037_ATF_Register_App_Interface_Assign_Existing_Policies.lua b/test_scripts/Policies/appID_Management/037_ATF_Register_App_Interface_Assign_Existing_Policies.lua index c8ae092178..6bee5f39d4 100644 --- a/test_scripts/Policies/appID_Management/037_ATF_Register_App_Interface_Assign_Existing_Policies.lua +++ b/test_scripts/Policies/appID_Management/037_ATF_Register_App_Interface_Assign_Existing_Policies.lua @@ -23,10 +23,6 @@ -- Status of response: sucess = false, resultCode = "DISALLOWED" --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local testCasesForPolicyAppIdManagament = require("user_modules/shared_testcases/testCasesForPolicyAppIdManagament") @@ -34,6 +30,7 @@ local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTableSnapshot = require("user_modules/shared_testcases/testCasesForPolicyTableSnapshot") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -45,7 +42,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Pecondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:UpdatePolicy() diff --git a/test_scripts/Policies/appID_Management/038_ATF_Register_App_Interface_Without_Data_Consent_Assign_pre_DataConsent_Policies.lua b/test_scripts/Policies/appID_Management/038_ATF_Register_App_Interface_Without_Data_Consent_Assign_pre_DataConsent_Policies.lua index 7ecbebb2b4..9c3fbc3ec8 100644 --- a/test_scripts/Policies/appID_Management/038_ATF_Register_App_Interface_Without_Data_Consent_Assign_pre_DataConsent_Policies.lua +++ b/test_scripts/Policies/appID_Management/038_ATF_Register_App_Interface_Without_Data_Consent_Assign_pre_DataConsent_Policies.lua @@ -18,13 +18,10 @@ -- 1. sdl_snapshot is created. -- 2. Application is added to policy and assigns pre_DataConsent group --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") +local utils = require ('user_modules/utils') --[[ Local Functions ]] local function get_permission_code(app_id) diff --git a/test_scripts/Policies/appID_Management/039_ATF_Register_App_Interface_With_Data_Consent_Assign_Default_Policies.lua b/test_scripts/Policies/appID_Management/039_ATF_Register_App_Interface_With_Data_Consent_Assign_Default_Policies.lua index 06029badf9..274151146b 100644 --- a/test_scripts/Policies/appID_Management/039_ATF_Register_App_Interface_With_Data_Consent_Assign_Default_Policies.lua +++ b/test_scripts/Policies/appID_Management/039_ATF_Register_App_Interface_With_Data_Consent_Assign_Default_Policies.lua @@ -24,13 +24,10 @@ -- Status of response: success = true, resultCode = "SUCCESS" for PutFile -- Status of response: success = false, resultCode = "DISALLOWED" for GetVehicleData --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() diff --git a/test_scripts/Policies/appID_Management/040_ATF_Register_App_Interface_Case-insensitivity_Of_AppId.lua b/test_scripts/Policies/appID_Management/040_ATF_Register_App_Interface_Case-insensitivity_Of_AppId.lua index 0d95c29521..4cc41ec923 100644 --- a/test_scripts/Policies/appID_Management/040_ATF_Register_App_Interface_Case-insensitivity_Of_AppId.lua +++ b/test_scripts/Policies/appID_Management/040_ATF_Register_App_Interface_Case-insensitivity_Of_AppId.lua @@ -19,16 +19,13 @@ -- SDL must allow application registration, not considering the case letters when comparing -- with appID from policies: SDL->appID: SUCCESS: RegisterAppInterface() --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local testCasesForPolicyAppIdManagament = require("user_modules/shared_testcases/testCasesForPolicyAppIdManagament") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -40,7 +37,7 @@ require("user_modules/AppTypes") --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Pecondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:UpdatePolicy() diff --git a/test_scripts/Policies/appID_Management/041_ATF_OnAppPermissionChanged_appRevoked_true.lua b/test_scripts/Policies/appID_Management/041_ATF_OnAppPermissionChanged_appRevoked_true.lua index 4aea1e2f7d..16f596696f 100644 --- a/test_scripts/Policies/appID_Management/041_ATF_OnAppPermissionChanged_appRevoked_true.lua +++ b/test_scripts/Policies/appID_Management/041_ATF_OnAppPermissionChanged_appRevoked_true.lua @@ -17,16 +17,15 @@ -- Expected result: -- SDL -> HMI: OnAppPermissionChanged (, appRevoked=true, params) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] -- local mobileSession = require("mobile_session") local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local json = require("modules/json") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local ptu_table @@ -78,7 +77,7 @@ function Test:ActivateApp() EXPECT_HMIRESPONSE(requestId2) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/appID_Management/042_ATF_PolicyTable_RAI_with_NULL_policies_RPCs_DISALLOWED.lua b/test_scripts/Policies/appID_Management/042_ATF_PolicyTable_RAI_with_NULL_policies_RPCs_DISALLOWED.lua index c5a4805ccd..c1f729d1c4 100644 --- a/test_scripts/Policies/appID_Management/042_ATF_PolicyTable_RAI_with_NULL_policies_RPCs_DISALLOWED.lua +++ b/test_scripts/Policies/appID_Management/042_ATF_PolicyTable_RAI_with_NULL_policies_RPCs_DISALLOWED.lua @@ -12,16 +12,15 @@ -- 2. MOB-SDL - send the list of RPCs -- 3. SDL responce, success = false, resultCode = "DISALLOWED" --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local json = require("modules/json") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local ptu_table @@ -76,7 +75,7 @@ function Test:ActivateApp() EXPECT_HMIRESPONSE(requestId2) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/appID_Management/043_ATF_HMI_Status_Appid_Gets_Null_In_Case_Of_PTU.lua b/test_scripts/Policies/appID_Management/043_ATF_HMI_Status_Appid_Gets_Null_In_Case_Of_PTU.lua index 4ad42bd58f..94ab4bf7f9 100644 --- a/test_scripts/Policies/appID_Management/043_ATF_HMI_Status_Appid_Gets_Null_In_Case_Of_PTU.lua +++ b/test_scripts/Policies/appID_Management/043_ATF_HMI_Status_Appid_Gets_Null_In_Case_Of_PTU.lua @@ -20,9 +20,7 @@ -- OnHMIStatus: hmiLevel="NONE", systemContext="MAIN", audioStreamingState="NOT_AUDIBLE" -- --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appName = "App1" config.application1.registerAppInterfaceParams.appHMIType = { "DEFAULT" } config.application2.registerAppInterfaceParams.appHMIType = { "MEDIA" } @@ -34,6 +32,7 @@ local testCasesForPolicyAppIdManagament = require("user_modules/shared_testcases local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -46,7 +45,7 @@ local HMIAppID --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Pecondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:UpdatePolicy() diff --git a/test_scripts/Policies/appID_Management/044_ATF_HMI_Status_Value_Of_AppId_In_PT_Is_Null.lua b/test_scripts/Policies/appID_Management/044_ATF_HMI_Status_Value_Of_AppId_In_PT_Is_Null.lua index ad0daa85f6..97b681e125 100644 --- a/test_scripts/Policies/appID_Management/044_ATF_HMI_Status_Value_Of_AppId_In_PT_Is_Null.lua +++ b/test_scripts/Policies/appID_Management/044_ATF_HMI_Status_Value_Of_AppId_In_PT_Is_Null.lua @@ -18,9 +18,7 @@ -- 1. status = "REJECTED" -- 2. hmiLevel = "NONE" --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appName = "App1" config.application1.registerAppInterfaceParams.appHMIType = { "DEFAULT" } config.application2.registerAppInterfaceParams.appHMIType = { "MEDIA" } @@ -32,6 +30,7 @@ local testCasesForPolicyAppIdManagament = require("user_modules/shared_testcases local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -44,7 +43,7 @@ local HMIAppID --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Pecondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:UpdatePolicy() diff --git a/test_scripts/Policies/appID_Management/045_ATF_Register_App_Interface_Assign_Default_Policies_To_Application_Which_Appid_Does_Not_Exist_In_LPT.lua b/test_scripts/Policies/appID_Management/045_ATF_Register_App_Interface_Assign_Default_Policies_To_Application_Which_Appid_Does_Not_Exist_In_LPT.lua index d689ab873c..e36ab81985 100644 --- a/test_scripts/Policies/appID_Management/045_ATF_Register_App_Interface_Assign_Default_Policies_To_Application_Which_Appid_Does_Not_Exist_In_LPT.lua +++ b/test_scripts/Policies/appID_Management/045_ATF_Register_App_Interface_Assign_Default_Policies_To_Application_Which_Appid_Does_Not_Exist_In_LPT.lua @@ -17,12 +17,10 @@ -- Expected result: -- Default permissions is assigned for app --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local db_file = config.pathToSDL .. "/" .. commonFunctions:read_parameter_from_smart_device_link_ini("AppStorageFolder") .. "/policy.sqlite" @@ -94,7 +92,7 @@ function Test:TestStep_ActivateApp() EXPECT_HMIRESPONSE(requestId2) :Do(function(_, _) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/appID_Management/046_ATF_Register_App_Interface_Assign_Existing_Policies_To_Application_Which_Appid_Exists_In_LPT.lua b/test_scripts/Policies/appID_Management/046_ATF_Register_App_Interface_Assign_Existing_Policies_To_Application_Which_Appid_Exists_In_LPT.lua index ffe027dd9c..1f98d94931 100644 --- a/test_scripts/Policies/appID_Management/046_ATF_Register_App_Interface_Assign_Existing_Policies_To_Application_Which_Appid_Exists_In_LPT.lua +++ b/test_scripts/Policies/appID_Management/046_ATF_Register_App_Interface_Assign_Existing_Policies_To_Application_Which_Appid_Exists_In_LPT.lua @@ -19,13 +19,13 @@ -- Permissions in payload of OnPermissionsChange() notification is the same as defined in LPT (specific) --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local policy_file_name = "PolicyTableUpdate" @@ -73,7 +73,7 @@ function Test:ActivateApp() EXPECT_HMIRESPONSE(requestId2) :Do(function(_, _) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/build_options/047_ATF_SDL_Build_DEXTENDED_POLICY_EXTERNAL_PROPRIETARY.lua b/test_scripts/Policies/build_options/047_ATF_SDL_Build_DEXTENDED_POLICY_EXTERNAL_PROPRIETARY.lua index d9741400ad..fc54cc2a2b 100644 --- a/test_scripts/Policies/build_options/047_ATF_SDL_Build_DEXTENDED_POLICY_EXTERNAL_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/047_ATF_SDL_Build_DEXTENDED_POLICY_EXTERNAL_PROPRIETARY.lua @@ -15,14 +15,11 @@ -- PTU passes successfully --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -36,7 +33,7 @@ require('user_modules/AppTypes') --[[ Test ]] commonFunctions:newTestCasesGroup("Test") function Test:TestStep_Device_Consented() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:TestStep_SUCCEESS_Flow_EXTERNAL_PROPRIETARY() @@ -49,4 +46,4 @@ function Test.Postcondition_Stop_SDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/build_options/048_ATF_SDL_Build_Flag_DEXTENDED_POLICY_PROPRIETARY.lua b/test_scripts/Policies/build_options/048_ATF_SDL_Build_Flag_DEXTENDED_POLICY_PROPRIETARY.lua index c3e16f7a83..0e1e3ee7fe 100644 --- a/test_scripts/Policies/build_options/048_ATF_SDL_Build_Flag_DEXTENDED_POLICY_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/048_ATF_SDL_Build_Flag_DEXTENDED_POLICY_PROPRIETARY.lua @@ -15,9 +15,8 @@ -- PTU passes successfully --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local mobile_session = require("mobile_session") diff --git a/test_scripts/Policies/build_options/050_ATF_Request_PTU_Trigger_PTU_failed_previous_IGN_ON_HTTP.lua b/test_scripts/Policies/build_options/050_ATF_Request_PTU_Trigger_PTU_failed_previous_IGN_ON_HTTP.lua index f210cdf8bc..ebd8a953af 100644 --- a/test_scripts/Policies/build_options/050_ATF_Request_PTU_Trigger_PTU_failed_previous_IGN_ON_HTTP.lua +++ b/test_scripts/Policies/build_options/050_ATF_Request_PTU_Trigger_PTU_failed_previous_IGN_ON_HTTP.lua @@ -21,9 +21,7 @@ -- PTU is requested. PTS is created. -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appHMIType = { "MEDIA" } config.ExitOnCrash = false diff --git a/test_scripts/Policies/build_options/051_ATF_Policy_Table_Update_Trigger_After_N_Kilometers_HTTP.lua b/test_scripts/Policies/build_options/051_ATF_Policy_Table_Update_Trigger_After_N_Kilometers_HTTP.lua index 72f858d122..96e5bb5fb9 100644 --- a/test_scripts/Policies/build_options/051_ATF_Policy_Table_Update_Trigger_After_N_Kilometers_HTTP.lua +++ b/test_scripts/Policies/build_options/051_ATF_Policy_Table_Update_Trigger_After_N_Kilometers_HTTP.lua @@ -25,9 +25,7 @@ -- Expected result: -- PTU flow started --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: Should be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -35,6 +33,7 @@ config.defaultProtocolVersion = 2 local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -91,7 +90,7 @@ function Test:Precondition_Activate_App_Start_PTU() EXPECT_HMIRESPONSE(RequestId) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/build_options/052_ATF_PTU_Trigger_IGN_Cycles_HTTP.lua b/test_scripts/Policies/build_options/052_ATF_PTU_Trigger_IGN_Cycles_HTTP.lua index 80e1722fc7..b493a7f8b7 100644 --- a/test_scripts/Policies/build_options/052_ATF_PTU_Trigger_IGN_Cycles_HTTP.lua +++ b/test_scripts/Policies/build_options/052_ATF_PTU_Trigger_IGN_Cycles_HTTP.lua @@ -18,9 +18,7 @@ -- gets equal to the value of field "exchange_after_x_ignition_cycles" ("module_config" section) ----PTU sequence is triggered and SDL sends to HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" Test = require('connecttest') --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/053_ATF_Policy_Table_Update_Trigger_After_N_Days_HTTP.lua b/test_scripts/Policies/build_options/053_ATF_Policy_Table_Update_Trigger_After_N_Days_HTTP.lua index d018d7858b..6e42ec7518 100644 --- a/test_scripts/Policies/build_options/053_ATF_Policy_Table_Update_Trigger_After_N_Days_HTTP.lua +++ b/test_scripts/Policies/build_options/053_ATF_Policy_Table_Update_Trigger_After_N_Days_HTTP.lua @@ -18,9 +18,7 @@ -- SDL initiates PTU: SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) -- PTS is created by SDL: SDL-> HMI: SDL.PolicyUpdate() //PTU sequence started --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/054_ATF_Request_PTU_UPDATE_NEEDED_new_PTU_Request_HTTP.lua b/test_scripts/Policies/build_options/054_ATF_Request_PTU_UPDATE_NEEDED_new_PTU_Request_HTTP.lua index 53e8ddc346..fd526b008a 100644 --- a/test_scripts/Policies/build_options/054_ATF_Request_PTU_UPDATE_NEEDED_new_PTU_Request_HTTP.lua +++ b/test_scripts/Policies/build_options/054_ATF_Request_PTU_UPDATE_NEEDED_new_PTU_Request_HTTP.lua @@ -17,10 +17,6 @@ -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) -- SDL->HMI: BasicCommunication.PolicyUpdate --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/055_ATF_Policy_Table_Snapshot_Creation_HTTP.lua b/test_scripts/Policies/build_options/055_ATF_Policy_Table_Snapshot_Creation_HTTP.lua index 2385c924a4..bd845b99fc 100644 --- a/test_scripts/Policies/build_options/055_ATF_Policy_Table_Snapshot_Creation_HTTP.lua +++ b/test_scripts/Policies/build_options/055_ATF_Policy_Table_Snapshot_Creation_HTTP.lua @@ -14,10 +14,6 @@ -- PTU is requested. PTS is created. -- For HTTP sdl_snapshot.json is not saved to file system. --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/056_ATF_PTU_Transfer_Several_Apps_Different_HMI_Levels_HTTP.lua b/test_scripts/Policies/build_options/056_ATF_PTU_Transfer_Several_Apps_Different_HMI_Levels_HTTP.lua index 42b23e21f1..2b51fef96d 100644 --- a/test_scripts/Policies/build_options/056_ATF_PTU_Transfer_Several_Apps_Different_HMI_Levels_HTTP.lua +++ b/test_scripts/Policies/build_options/056_ATF_PTU_Transfer_Several_Apps_Different_HMI_Levels_HTTP.lua @@ -21,7 +21,6 @@ -- app_1 doesn't take part in PTU (except of the case when app_1 is the only application being run on SDL) --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/057_ATF_PTS_Define_URL_to_send_PTS_HTTP.lua b/test_scripts/Policies/build_options/057_ATF_PTS_Define_URL_to_send_PTS_HTTP.lua index c5c7546a7d..29985658b5 100644 --- a/test_scripts/Policies/build_options/057_ATF_PTS_Define_URL_to_send_PTS_HTTP.lua +++ b/test_scripts/Policies/build_options/057_ATF_PTS_Define_URL_to_send_PTS_HTTP.lua @@ -18,10 +18,6 @@ -- SDL.GetURLs({urls[] = default}, (, appID)) -- SDL-> ->OnSystemRequest(params, url, timeout) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/build_options/058_ATF_HMI_sends_GetURLs_no_app_registered_HTTP.lua b/test_scripts/Policies/build_options/058_ATF_HMI_sends_GetURLs_no_app_registered_HTTP.lua index 4373ac5553..db42e950f2 100644 --- a/test_scripts/Policies/build_options/058_ATF_HMI_sends_GetURLs_no_app_registered_HTTP.lua +++ b/test_scripts/Policies/build_options/058_ATF_HMI_sends_GetURLs_no_app_registered_HTTP.lua @@ -19,10 +19,6 @@ -- PTU is requested. PTS is created. -- SDL.GetURLs({urls[] = default}) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') @@ -30,7 +26,6 @@ local testCasesForPolicyTable = require('user_modules/shared_testcases/testCases local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local mobile_session = require('mobile_session') - --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() commonSteps:DeleteLogsFileAndPolicyTable() @@ -106,4 +101,4 @@ function Test.Postcondition_Stop_SDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/build_options/059_ATF_HMI_sends_GetURLs_one_app_registered_HTTP.lua b/test_scripts/Policies/build_options/059_ATF_HMI_sends_GetURLs_one_app_registered_HTTP.lua index da732cb9bf..3752ee7310 100644 --- a/test_scripts/Policies/build_options/059_ATF_HMI_sends_GetURLs_one_app_registered_HTTP.lua +++ b/test_scripts/Policies/build_options/059_ATF_HMI_sends_GetURLs_one_app_registered_HTTP.lua @@ -17,10 +17,6 @@ -- PTU is requested. PTS is created. -- SDL.GetURLs({urls[] = registered_App1, default}) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/060_ATF_Timeout_to_wait_response_PTU_HTTP.lua b/test_scripts/Policies/build_options/060_ATF_Timeout_to_wait_response_PTU_HTTP.lua index c1a1516315..cdcf28b07b 100644 --- a/test_scripts/Policies/build_options/060_ATF_Timeout_to_wait_response_PTU_HTTP.lua +++ b/test_scripts/Policies/build_options/060_ATF_Timeout_to_wait_response_PTU_HTTP.lua @@ -15,9 +15,7 @@ -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) -- SDL->HMI:BC.PolicyUpdate(file, timeout, retry[]) where --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/061_ATF_Sending_PTS_to_Mobile_Application_HTTP.lua b/test_scripts/Policies/build_options/061_ATF_Sending_PTS_to_Mobile_Application_HTTP.lua index 695cc8ef16..632ff3b984 100644 --- a/test_scripts/Policies/build_options/061_ATF_Sending_PTS_to_Mobile_Application_HTTP.lua +++ b/test_scripts/Policies/build_options/061_ATF_Sending_PTS_to_Mobile_Application_HTTP.lua @@ -19,10 +19,6 @@ -- Expected result: -- SDL->app: OnSystemRequest ('url', requestType:HTTP, fileType="JSON", appID) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/062_ATF_Timeout_Countdown_Start_PTU_Response_HTTP.lua b/test_scripts/Policies/build_options/062_ATF_Timeout_Countdown_Start_PTU_Response_HTTP.lua index b451900e6e..bcb70eac89 100644 --- a/test_scripts/Policies/build_options/062_ATF_Timeout_Countdown_Start_PTU_Response_HTTP.lua +++ b/test_scripts/Policies/build_options/062_ATF_Timeout_Countdown_Start_PTU_Response_HTTP.lua @@ -22,10 +22,6 @@ --SDL waits for SystemRequest response from within 'timeout' value, --if no obtained, it starts retry sequence --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/063_ATF_PoliciesManager_Sets_Status_UPDATING_HTTP.lua b/test_scripts/Policies/build_options/063_ATF_PoliciesManager_Sets_Status_UPDATING_HTTP.lua index 654ea8fe13..6cc45ba439 100644 --- a/test_scripts/Policies/build_options/063_ATF_PoliciesManager_Sets_Status_UPDATING_HTTP.lua +++ b/test_scripts/Policies/build_options/063_ATF_PoliciesManager_Sets_Status_UPDATING_HTTP.lua @@ -21,10 +21,6 @@ -- Expected result: -- SDL->HMI: SDL.OnStatusUpdate(UPDATING) right after SDL->app: OnSystemRequest --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/064_ATF_Received_PTU_From_Mobile_Application_HTTP.lua b/test_scripts/Policies/build_options/064_ATF_Received_PTU_From_Mobile_Application_HTTP.lua index 92a6591956..1b08145864 100644 --- a/test_scripts/Policies/build_options/064_ATF_Received_PTU_From_Mobile_Application_HTTP.lua +++ b/test_scripts/Policies/build_options/064_ATF_Received_PTU_From_Mobile_Application_HTTP.lua @@ -21,7 +21,6 @@ -- LPT is updated successfully --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/066_ATF_PTU_Validation_Failure_HTTP.lua b/test_scripts/Policies/build_options/066_ATF_PTU_Validation_Failure_HTTP.lua index bbe44226a0..6e54361895 100644 --- a/test_scripts/Policies/build_options/066_ATF_PTU_Validation_Failure_HTTP.lua +++ b/test_scripts/Policies/build_options/066_ATF_PTU_Validation_Failure_HTTP.lua @@ -21,7 +21,6 @@ -- SDL->HMI: OnStatusUpdate(UPDATE_NEEDED) --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] @@ -126,7 +125,7 @@ function Test:RAI_PTU() function(_, d1) log("SDL->HMI: N: BC.OnAppRegistered") self.applications[config.application1.registerAppInterfaceParams.appID] = d1.params.application.appID - EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", { status = "UPDATE_NEEDED" }, { status = "UPDATING" }, { status = "UPDATE_NEEDED" }) + EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", { status = "UPDATE_NEEDED" }, { status = "UPDATING" }, { status = "UPDATE_NEEDED" }, { status = "UPDATING" }) :Do( function(_, d2) log("SDL->HMI: N: SDL.OnStatusUpdate", d2.params.status) diff --git a/test_scripts/Policies/build_options/067_ATF_PoliciesManager_Sets_Status_to_UP_TO_DATE_HTTP.lua b/test_scripts/Policies/build_options/067_ATF_PoliciesManager_Sets_Status_to_UP_TO_DATE_HTTP.lua index e80e04c4b7..c50971385f 100644 --- a/test_scripts/Policies/build_options/067_ATF_PoliciesManager_Sets_Status_to_UP_TO_DATE_HTTP.lua +++ b/test_scripts/Policies/build_options/067_ATF_PoliciesManager_Sets_Status_to_UP_TO_DATE_HTTP.lua @@ -25,10 +25,6 @@ -- Expected result: -- SDL->HMI: OnStatusUpdate(UP_TO_DATE) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/068_ATF_PTU_Merge_Into_Local_PT_HTTP.lua b/test_scripts/Policies/build_options/068_ATF_PTU_Merge_Into_Local_PT_HTTP.lua index 2339dc6d3b..f848994aa8 100644 --- a/test_scripts/Policies/build_options/068_ATF_PTU_Merge_Into_Local_PT_HTTP.lua +++ b/test_scripts/Policies/build_options/068_ATF_PTU_Merge_Into_Local_PT_HTTP.lua @@ -27,9 +27,7 @@ -- SDL replaces the following sections of the Local Policy Table with the --corresponding sections from PTU: module_config, functional_groupings and app_policies --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appHMIType = { "MEDIA" } config.application2.registerAppInterfaceParams.appHMIType = { "DEFAULT" } @@ -41,6 +39,7 @@ local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') +local utils = require ('user_modules/utils') --[[ Local Functions ]] local function is_table_equal(t1, t2) @@ -77,16 +76,15 @@ local ptu commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_ConnectDevice() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") commonTestCases:DelayedExp(2000) self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", { deviceList = { { - id = config.deviceMAC, + id = utils.getDeviceMAC(), isSDLAllowed = true, - name = ServerAddress, + name = utils.getDeviceName(), transportType = "WIFI" } } @@ -173,7 +171,7 @@ function Test:TestStep_RegisterNewApp() self:FailTestCase("OnSystemRequest, HTTP for app1 is not received.") end end) - + commonTestCases:DelayedExp(10000) end diff --git a/test_scripts/Policies/build_options/069_ATF_PTU_Merge_Into_Local_PT_ConsumerFriendlyMessages_HTTP.lua b/test_scripts/Policies/build_options/069_ATF_PTU_Merge_Into_Local_PT_ConsumerFriendlyMessages_HTTP.lua index 15b592b103..ed2660e500 100644 --- a/test_scripts/Policies/build_options/069_ATF_PTU_Merge_Into_Local_PT_ConsumerFriendlyMessages_HTTP.lua +++ b/test_scripts/Policies/build_options/069_ATF_PTU_Merge_Into_Local_PT_ConsumerFriendlyMessages_HTTP.lua @@ -28,19 +28,15 @@ --corresponding sections from PTU: module_config, functional_groupings, app_policies --and consumer_friendly_messages->'messages' --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Variables ]] --local db_file = config.pathToSDL .. "/" .. commonFunctions:read_parameter_from_smart_device_link_ini("AppStorageFolder") .. "/policy.sqlite" local policy_file_path = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local ptu_file = "files/jsons/Policies/Policy_Table_Update/ptu_18192.json" --[[ Local Functions ]] @@ -101,7 +97,7 @@ function Test:Precondition_ActivateApp() EXPECT_HMIRESPONSE(requestId2) :Do(function(_, _) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = ServerAddress } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/build_options/070_ATF_PTU_Merge_Into_Local_PT_ConsumerFriendlyMessages_Omitted_HTTP.lua b/test_scripts/Policies/build_options/070_ATF_PTU_Merge_Into_Local_PT_ConsumerFriendlyMessages_Omitted_HTTP.lua index 0979950dad..50a0d35096 100644 --- a/test_scripts/Policies/build_options/070_ATF_PTU_Merge_Into_Local_PT_ConsumerFriendlyMessages_Omitted_HTTP.lua +++ b/test_scripts/Policies/build_options/070_ATF_PTU_Merge_Into_Local_PT_ConsumerFriendlyMessages_Omitted_HTTP.lua @@ -28,14 +28,15 @@ -- SDL replaces the following sections of the Local Policy Table with the --corresponding sections from PTU: module_config, functional_groupings and app_policies --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +--[[ General Settings for configuration ]] +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local mobile_session = require("mobile_session") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local json = require("modules/json") +local utils = require ('user_modules/utils') --[[ Local Variables ]] local db_file = config.pathToSDL .. "/" .. commonFunctions:read_parameter_from_smart_device_link_ini("AppStorageFolder") .. "/policy.sqlite" @@ -66,8 +67,8 @@ function Test:ConnectMobile() { deviceList = { { - id = config.deviceMAC, - name = "127.0.0.1", + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI" } } @@ -91,8 +92,8 @@ function Test:RegisterApp() { deviceInfo = { - id = config.deviceMAC, - name = "127.0.0.1", + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI" } } @@ -154,15 +155,11 @@ function Test:PerformPTUSuccess() end function Test:ValidateNumberMessages() - self.mobileSession:ExpectAny() - :ValidIf(function(_, _) - r_actual = get_num_records() - if r_expected ~= r_actual then - return false, "Expected number of records: " .. r_expected .. ", got: " .. r_actual - end - print("Number of records: " .. r_actual) - return true - end) + r_actual = get_num_records() + if r_expected ~= r_actual then + self:FailTestCase("Expected number of records: " .. r_expected .. ", got: " .. r_actual) + end + print("Number of records: " .. r_actual) end --[[ Postconditions ]] diff --git a/test_scripts/Policies/build_options/071_ATF_PTU_Local_PT_Start_Retry_Sequence_HTTP.lua b/test_scripts/Policies/build_options/071_ATF_PTU_Local_PT_Start_Retry_Sequence_HTTP.lua index 2cab313782..a2b5a2ca07 100644 --- a/test_scripts/Policies/build_options/071_ATF_PTU_Local_PT_Start_Retry_Sequence_HTTP.lua +++ b/test_scripts/Policies/build_options/071_ATF_PTU_Local_PT_Start_Retry_Sequence_HTTP.lua @@ -22,9 +22,6 @@ -- Timeout expires and retry sequence started -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobile_session = require("mobile_session") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") diff --git a/test_scripts/Policies/build_options/072_ATF_PTU_PM_Sets_Status_UPDATE_NEEDED_HTTP.lua b/test_scripts/Policies/build_options/072_ATF_PTU_PM_Sets_Status_UPDATE_NEEDED_HTTP.lua index 9d2d32bfd1..663c7687e6 100644 --- a/test_scripts/Policies/build_options/072_ATF_PTU_PM_Sets_Status_UPDATE_NEEDED_HTTP.lua +++ b/test_scripts/Policies/build_options/072_ATF_PTU_PM_Sets_Status_UPDATE_NEEDED_HTTP.lua @@ -16,9 +16,7 @@ -- Expected result: -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/073_ATF_PTU_Retry_Sequence_Retry_Timeout_Computation_HTTP.lua b/test_scripts/Policies/build_options/073_ATF_PTU_Retry_Sequence_Retry_Timeout_Computation_HTTP.lua index 6f73785ee8..af212b0915 100644 --- a/test_scripts/Policies/build_options/073_ATF_PTU_Retry_Sequence_Retry_Timeout_Computation_HTTP.lua +++ b/test_scripts/Policies/build_options/073_ATF_PTU_Retry_Sequence_Retry_Timeout_Computation_HTTP.lua @@ -29,9 +29,7 @@ -- t[4] = timeout_after_x_seconds + seconds_between_retries[4] + t[3] -- t[5] = timeout_after_x_seconds + seconds_between_retries[5] + t[4] --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/074_ATF_PTU_Restarting_Policy_Table_Exchange_HTTP.lua b/test_scripts/Policies/build_options/074_ATF_PTU_Restarting_Policy_Table_Exchange_HTTP.lua index 007fe31be9..b3274c93fb 100644 --- a/test_scripts/Policies/build_options/074_ATF_PTU_Restarting_Policy_Table_Exchange_HTTP.lua +++ b/test_scripts/Policies/build_options/074_ATF_PTU_Restarting_Policy_Table_Exchange_HTTP.lua @@ -21,27 +21,24 @@ -- SDL->app: OnSystemRequest() --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonTestCases = require ('user_modules/shared_testcases/commonTestCases') -local events = require('events') --[[ Local Variables ]] local seconds_between_retries = {1, 1, 1, 1, 1} -- in min local timeout_after_x_seconds = 30 -- in sec local timeout = {} -- in sec -timeout[1] = timeout_after_x_seconds -timeout[2] = timeout[1] + seconds_between_retries[1] -timeout[3] = timeout[1] + timeout[2] + seconds_between_retries[2] -timeout[4] = timeout[1] + timeout[3] + seconds_between_retries[3] -timeout[5] = timeout[1] + timeout[4] + seconds_between_retries[4] -timeout[6] = timeout[1] + timeout[5] + seconds_between_retries[5] +timeout[1] = timeout_after_x_seconds -- 30 +timeout[2] = timeout_after_x_seconds + seconds_between_retries[1] -- 30 + 1 = 31 +timeout[3] = timeout_after_x_seconds + seconds_between_retries[2] + timeout[2] -- 30 + 1 + 31 = 62 +timeout[4] = timeout_after_x_seconds + seconds_between_retries[3] + timeout[3] -- 30 + 1 + 62 = 93 +timeout[5] = timeout_after_x_seconds + seconds_between_retries[4] + timeout[4] -- 30 + 1 + 93 = 124 +timeout[6] = timeout_after_x_seconds + seconds_between_retries[5] + timeout[5] -- 30 + 1 + 124 = 155 local onsysrequest_app1 = false local onsysrequest_app2 = false @@ -81,16 +78,6 @@ local function SetRetryValuesInPreloadedFile() file:close() end -local function DelayedExp(time) - local event = events.Event() - event.matches = function(self, e) return self == e end - EXPECT_EVENT(event, "Delayed event") - :Timeout(time + 1000) - RUN_AFTER(function() - RAISE_EVENT(event, event) - end, time) - end - --[[ Preconditions ]] function Test.Precondition_StopSDL() StopSDL() @@ -136,7 +123,8 @@ local function DelayedExp(time) --[[ Test ]] function Test:TestStep_Register_App_And_Check_Retry_Timeouts() - print("Wait retry sequence to elapse: " .. (timeout[1] + timeout[2] + timeout[3] + timeout[4] + timeout[5] + timeout[6]) .. "sec. + 2min tolerance") + local totalTimeout = timeout[1] + timeout[2] + timeout[3] + timeout[4] + timeout[5] + timeout[6] + 30 + print("Wait retry sequence to elapse: " .. totalTimeout .. "sec.") local startPTUtime = 0 local firstTryTime = 0 local secondTryTime = 0 @@ -164,8 +152,10 @@ local function DelayedExp(time) maxNumberRFCOMMPorts = 1 } }) + EXPECT_RESPONSE(CorIdRAI, { success = true, resultCode = "SUCCESS"}) EXPECT_NOTIFICATION("OnSystemRequest") :ValidIf(function(exp,data) + if(data.payload.requestType == "HTTP") then if exp.occurences == 2 then @@ -173,62 +163,62 @@ local function DelayedExp(time) return true end - if exp.occurences == 3 and timeout[2] == (os.time() - startPTUtime) then + if exp.occurences == 3 and (os.time() - startPTUtime) >= timeout[1] - 1 and (os.time() - startPTUtime) <= timeout[1] + 1 then firstTryTime = os.time() - print ("first retry time: " .. timeout[2]) + print ("first retry time: " .. timeout[1]) return true - elseif exp.occurences == 3 and timeout[2] ~= (os.time() - startPTUtime) then + elseif exp.occurences == 3 and timeout[1] ~= (os.time() - startPTUtime) then firstTryTime = os.time() - print ("Wrong first retry time! Expected: " .. timeout[2] .. " Actual: " .. (os.time() - startPTUtime) ) + print ("Wrong first retry time! Expected: " .. timeout[1] .. " Actual: " .. (os.time() - startPTUtime) ) return false end - if exp.occurences == 4 and timeout[3] == (os.time() - firstTryTime) then + if exp.occurences == 4 and (os.time() - firstTryTime) >= timeout[2] - 1 and (os.time() - firstTryTime) <= timeout[2] + 1 then secondTryTime = os.time() - print ("second retry time: " .. timeout[3]) + print ("second retry time: " .. timeout[2]) return true - elseif exp.occurences == 4 and timeout[3] ~= (os.time() - firstTryTime) then + elseif exp.occurences == 4 and timeout[2] ~= (os.time() - firstTryTime) then secondTryTime = os.time() - print ("Wrong second retry time! Expected: " .. timeout[3] .. " Actual: " .. (os.time() - firstTryTime) ) + print ("Wrong second retry time! Expected: " .. timeout[2] .. " Actual: " .. (os.time() - firstTryTime) ) return false end - if exp.occurences == 5 and timeout[4] == (os.time() - secondTryTime) then + if exp.occurences == 5 and (os.time() - secondTryTime) >= timeout[3] - 1 and (os.time() - secondTryTime) <= timeout[3] + 1 then thirdTryTime = os.time() - print ("third retry time: " .. timeout[4]) + print ("third retry time: " .. timeout[3]) return true - elseif exp.occurences == 5 and timeout[4] ~= (os.time() - secondTryTime) then + elseif exp.occurences == 5 and timeout[3] ~= (os.time() - secondTryTime) then thirdTryTime = os.time() - print ("Wrong third retry time! Expected: " .. timeout[4] .. " Actual: " .. (os.time() - secondTryTime) ) + print ("Wrong third retry time! Expected: " .. timeout[3] .. " Actual: " .. (os.time() - secondTryTime) ) return false end - if exp.occurences == 6 and timeout[5] == (os.time() - thirdTryTime) then + if exp.occurences == 6 and (os.time() - thirdTryTime) >= timeout[4] - 1 and (os.time() - thirdTryTime) <= timeout[4] + 1 then fourthTryTime = os.time() - print ("fourth retry time: " .. timeout[5]) + print ("fourth retry time: " .. timeout[4]) return true - elseif exp.occurences == 6 and timeout[5] ~= (os.time() - thirdTryTime) then + elseif exp.occurences == 6 and timeout[4] ~= (os.time() - thirdTryTime) then fourthTryTime = os.time() - print ("Wrong fourth retry time! Expected: " .. timeout[5] .. " Actual: " .. (os.time() - thirdTryTime) ) + print ("Wrong fourth retry time! Expected: " .. timeout[4] .. " Actual: " .. (os.time() - thirdTryTime) ) return false end - if exp.occurences == 7 and timeout[6] == (os.time() - fourthTryTime) then - print ("fifth retry time: " .. timeout[6]) + if exp.occurences == 7 and (os.time() - fourthTryTime) >= timeout[5] - 1 and (os.time() - fourthTryTime) <= timeout[5] + 1 then + print ("fifth retry time: " .. timeout[5]) return true - elseif exp.occurences == 7 and timeout[6] ~= (os.time() - fourthTryTime) then - print ("Wrong fifth retry time! Expected: " .. timeout[6] .. " Actual: " .. (os.time() - fourthTryTime) ) + elseif exp.occurences == 7 and timeout[5] ~= (os.time() - fourthTryTime) then + print ("Wrong fifth retry time! Expected: " .. timeout[5] .. " Actual: " .. (os.time() - fourthTryTime) ) return false end + end - return false + return true end) :Times(#seconds_between_retries + 2) -- 6 HTTP, 1 LOCK_SCREEN_ICON_URL - - DelayedExp((timeout[1] + timeout[2] + timeout[3] + timeout[4] + timeout[5] + timeout[6])*1000 + 2*60000) --msec - EXPECT_RESPONSE(CorIdRAI, { success = true, resultCode = "SUCCESS"}) + :Timeout(totalTimeout * 1000) + commonTestCases:DelayedExp(totalTimeout * 1000) end function Test:TestStep_StartSession2() diff --git a/test_scripts/Policies/build_options/075_ATF_PTU_Retry_Sequence_Retry_Timeout_Expiration_HTTP.lua b/test_scripts/Policies/build_options/075_ATF_PTU_Retry_Sequence_Retry_Timeout_Expiration_HTTP.lua index 5c5ae1cb79..63a8eb06aa 100644 --- a/test_scripts/Policies/build_options/075_ATF_PTU_Retry_Sequence_Retry_Timeout_Expiration_HTTP.lua +++ b/test_scripts/Policies/build_options/075_ATF_PTU_Retry_Sequence_Retry_Timeout_Expiration_HTTP.lua @@ -24,9 +24,7 @@ -- Expected result: -- Number of retries corresponds to number of elements in 'seconds_between_retries' array --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/076_ATF_PTU_Changes_Applied_OnPermissionChange_Notification_App_HTTP.lua b/test_scripts/Policies/build_options/076_ATF_PTU_Changes_Applied_OnPermissionChange_Notification_App_HTTP.lua index 1a53006b39..f15e6989be 100644 --- a/test_scripts/Policies/build_options/076_ATF_PTU_Changes_Applied_OnPermissionChange_Notification_App_HTTP.lua +++ b/test_scripts/Policies/build_options/076_ATF_PTU_Changes_Applied_OnPermissionChange_Notification_App_HTTP.lua @@ -19,8 +19,8 @@ -- SDL->HMI:OnStatusUpdate("UP_TO_DATE") -- SDL->app: onPermissionChange(permisssions) --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +--[[ General Settings for configuration ]] +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local mobile_session = require("mobile_session") diff --git a/test_scripts/Policies/build_options/077_ATF_PTU_Changes_Applied_OnPermissionChange_Notification_HMI_HTTP.lua b/test_scripts/Policies/build_options/077_ATF_PTU_Changes_Applied_OnPermissionChange_Notification_HMI_HTTP.lua index a924f4608e..9547e686ef 100644 --- a/test_scripts/Policies/build_options/077_ATF_PTU_Changes_Applied_OnPermissionChange_Notification_HMI_HTTP.lua +++ b/test_scripts/Policies/build_options/077_ATF_PTU_Changes_Applied_OnPermissionChange_Notification_HMI_HTTP.lua @@ -22,7 +22,6 @@ -- SDL->HMI: SDL.OnAppPermissionChanged(appID, params) --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/078_ATF_PTU_HMI_Level_Affected_Apps_FULL_LIMITED_HTTP.lua b/test_scripts/Policies/build_options/078_ATF_PTU_HMI_Level_Affected_Apps_FULL_LIMITED_HTTP.lua index 618b00db46..6d0a0e91e5 100644 --- a/test_scripts/Policies/build_options/078_ATF_PTU_HMI_Level_Affected_Apps_FULL_LIMITED_HTTP.lua +++ b/test_scripts/Policies/build_options/078_ATF_PTU_HMI_Level_Affected_Apps_FULL_LIMITED_HTTP.lua @@ -20,7 +20,6 @@ -- 2) Mobile application 2 remains in LIMITED --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.isMediaApplication = true config.application1.registerAppInterfaceParams.appHMIType = { "MEDIA" } config.application2.registerAppInterfaceParams.isMediaApplication = false diff --git a/test_scripts/Policies/build_options/079_ATF_PTU_HMI_Level_Affected_Apps_NONE_BACKGROUND_HTTP.lua b/test_scripts/Policies/build_options/079_ATF_PTU_HMI_Level_Affected_Apps_NONE_BACKGROUND_HTTP.lua index b950bb14b9..b273bb08f5 100644 --- a/test_scripts/Policies/build_options/079_ATF_PTU_HMI_Level_Affected_Apps_NONE_BACKGROUND_HTTP.lua +++ b/test_scripts/Policies/build_options/079_ATF_PTU_HMI_Level_Affected_Apps_NONE_BACKGROUND_HTTP.lua @@ -21,7 +21,6 @@ -- 1) SDL->appID_2: NONE OnHMIStatus -- should keep last value NONE --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appHMIType = { "DEFAULT" } config.application1.registerAppInterfaceParams.isMediaApplication = false diff --git a/test_scripts/Policies/build_options/080_ATF_PTU_OnStatsusUpdate_Trigger_UPDATE_NEEDED_HTTP.lua b/test_scripts/Policies/build_options/080_ATF_PTU_OnStatsusUpdate_Trigger_UPDATE_NEEDED_HTTP.lua index fce9e558ff..3c97e7cf3b 100644 --- a/test_scripts/Policies/build_options/080_ATF_PTU_OnStatsusUpdate_Trigger_UPDATE_NEEDED_HTTP.lua +++ b/test_scripts/Policies/build_options/080_ATF_PTU_OnStatsusUpdate_Trigger_UPDATE_NEEDED_HTTP.lua @@ -15,9 +15,6 @@ -- Expected result: --SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/081_ATF_PTU_OnStatsusUpdate_Trigger_UPDATING_HTTP.lua b/test_scripts/Policies/build_options/081_ATF_PTU_OnStatsusUpdate_Trigger_UPDATING_HTTP.lua index f73dbb5fd2..8b4930d4fb 100644 --- a/test_scripts/Policies/build_options/081_ATF_PTU_OnStatsusUpdate_Trigger_UPDATING_HTTP.lua +++ b/test_scripts/Policies/build_options/081_ATF_PTU_OnStatsusUpdate_Trigger_UPDATING_HTTP.lua @@ -20,9 +20,6 @@ -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) -- SDL->HMI: SDL.OnStatusUpdate(UPDATING) right after SDL->app: OnSystemRequest --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/082_ATF_PTU_OnStatsusUpdate_Trigger_UP_TO_DATE_HTTP.lua b/test_scripts/Policies/build_options/082_ATF_PTU_OnStatsusUpdate_Trigger_UP_TO_DATE_HTTP.lua index 71f4f88bdd..e75591fd9c 100644 --- a/test_scripts/Policies/build_options/082_ATF_PTU_OnStatsusUpdate_Trigger_UP_TO_DATE_HTTP.lua +++ b/test_scripts/Policies/build_options/082_ATF_PTU_OnStatsusUpdate_Trigger_UP_TO_DATE_HTTP.lua @@ -26,10 +26,6 @@ -- Expected result: -- SDL->HMI: OnStatusUpdate(UP_TO_DATE) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') @@ -68,4 +64,4 @@ function Test.Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/build_options/083_ATF_PTU_UTF8_Encoding_Check_HTTP.lua b/test_scripts/Policies/build_options/083_ATF_PTU_UTF8_Encoding_Check_HTTP.lua index b1aaad5571..fd60420e68 100644 --- a/test_scripts/Policies/build_options/083_ATF_PTU_UTF8_Encoding_Check_HTTP.lua +++ b/test_scripts/Policies/build_options/083_ATF_PTU_UTF8_Encoding_Check_HTTP.lua @@ -17,9 +17,6 @@ -- Expected result: -- The texts in Russian & Chinese in appropriate are parsed correctly by SDL --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") diff --git a/test_scripts/Policies/build_options/084_ATF_Default_Policy_For_The_App_After_PTU_HTTP.lua b/test_scripts/Policies/build_options/084_ATF_Default_Policy_For_The_App_After_PTU_HTTP.lua index 8c7f204be3..b2e60238c6 100644 --- a/test_scripts/Policies/build_options/084_ATF_Default_Policy_For_The_App_After_PTU_HTTP.lua +++ b/test_scripts/Policies/build_options/084_ATF_Default_Policy_For_The_App_After_PTU_HTTP.lua @@ -8,7 +8,6 @@ -- In case Policies Manager assigns the "default" policies to app AND the value of "default" policies was updated in case of PolicyTable update --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/085_ATF_PTU_In_Progress_New_App_Registers_HTTP.lua b/test_scripts/Policies/build_options/085_ATF_PTU_In_Progress_New_App_Registers_HTTP.lua index eadf28fd5f..836015594e 100644 --- a/test_scripts/Policies/build_options/085_ATF_PTU_In_Progress_New_App_Registers_HTTP.lua +++ b/test_scripts/Policies/build_options/085_ATF_PTU_In_Progress_New_App_Registers_HTTP.lua @@ -22,9 +22,7 @@ -- SDL adds application with App 2 data into LocalPT according to general rules -- of adding app data into LocalPT --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/086_ATF_PTU_Merging_wtih_LPT_HTTP.lua b/test_scripts/Policies/build_options/086_ATF_PTU_Merging_wtih_LPT_HTTP.lua index 95a4fd629d..3649ffb5ac 100644 --- a/test_scripts/Policies/build_options/086_ATF_PTU_Merging_wtih_LPT_HTTP.lua +++ b/test_scripts/Policies/build_options/086_ATF_PTU_Merging_wtih_LPT_HTTP.lua @@ -24,10 +24,6 @@ --module_config, functional_groupings and app_policies --App 2 added to Local PT during PT Exchange process left after merge in LocalPT (not being lost on merge) ------------------------------------------------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/087_ATF_New_PTU_Sequence_AppRegistered_PTU_Progress_HTTP.lua b/test_scripts/Policies/build_options/087_ATF_New_PTU_Sequence_AppRegistered_PTU_Progress_HTTP.lua index 6b884f9a0d..2706ddfdc6 100644 --- a/test_scripts/Policies/build_options/087_ATF_New_PTU_Sequence_AppRegistered_PTU_Progress_HTTP.lua +++ b/test_scripts/Policies/build_options/087_ATF_New_PTU_Sequence_AppRegistered_PTU_Progress_HTTP.lua @@ -22,15 +22,11 @@ -- 4. app_2 added to Local PT during PT Exchange process left after merge in LocalPT (not being lost on merge) -- 5. SDL creates the new snapshot and initiates the new PTU for the app_2 Policies obtaining: SDL-> HMI: SDL.PolicyUpdate()//new PTU sequence started ------------------------------------------------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local mobile_session = require('mobile_session') - --[[ Local Functions ]] local registerAppInterfaceParams = { @@ -89,7 +85,8 @@ function Test:TestStep_PoliciesManager_changes_UP_TO_DATE() EXPECT_RESPONSE(CorIdSystemRequest, { success = true, resultCode = "SUCCESS"}) EXPECT_HMICALL("BasicCommunication.SystemRequest"):Times(0) - EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UP_TO_DATE"}, {status = "UPDATE_NEEDED"}):Times(2) + EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UP_TO_DATE"}, {status = "UPDATE_NEEDED"}, {status = "UPDATING"}) + :Times(3) end --[[ Postconditions ]] @@ -98,4 +95,4 @@ function Test.Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/build_options/088_ATF_Apply_UpdatedPT_after_OnReceivedPolicyUpdate_from_HMI_PROPRIETARY.lua b/test_scripts/Policies/build_options/088_ATF_Apply_UpdatedPT_after_OnReceivedPolicyUpdate_from_HMI_PROPRIETARY.lua index 1418157a65..3f6339d7df 100644 --- a/test_scripts/Policies/build_options/088_ATF_Apply_UpdatedPT_after_OnReceivedPolicyUpdate_from_HMI_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/088_ATF_Apply_UpdatedPT_after_OnReceivedPolicyUpdate_from_HMI_PROPRIETARY.lua @@ -12,9 +12,8 @@ -- Expected result: -- SDL->MOB: BasicCommunication.SystemRequest ( + )) to HMI --------------------------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -41,8 +39,8 @@ function Test:ConnectMobile() { deviceList = { { - id = config.deviceMAC, - name = "127.0.0.1", + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI" } } diff --git a/test_scripts/Policies/build_options/090_ATF_For_PTU_use_consented_device_only.lua b/test_scripts/Policies/build_options/090_ATF_For_PTU_use_consented_device_only.lua index aa7758602a..683bf4d248 100644 --- a/test_scripts/Policies/build_options/090_ATF_For_PTU_use_consented_device_only.lua +++ b/test_scripts/Policies/build_options/090_ATF_For_PTU_use_consented_device_only.lua @@ -24,9 +24,9 @@ local tcp = require('tcp_connection') local file_connection = require('file_connection') local mobile = require('mobile_connection') local events = require('events') +local utils = require ('user_modules/utils') --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" -- Create dummy connection os.execute("ifconfig lo:1 1.0.0.1") @@ -54,8 +54,8 @@ function Test:Precondition_Connect_device1() { deviceList = { { - id = config.deviceMAC, - name = "127.0.0.1", + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI" } } @@ -83,13 +83,13 @@ end function Test:Precondition_Activate_app_1() local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.HMIAppID}) - EXPECT_HMIRESPONSE(RequestId, {result = { code = 0, device = { id = config.deviceMAC, name = "127.0.0.1" }, isSDLAllowed = false, method ="SDL.ActivateApp" }}) + EXPECT_HMIRESPONSE(RequestId, {result = { code = 0, device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() }, isSDLAllowed = false, method ="SDL.ActivateApp" }}) :Do(function(_, _) local RequestIdGetMes = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -112,8 +112,8 @@ function Test:Precondition_Connect_device_2() { deviceList = { { - id = config.deviceMAC, - name = "127.0.0.1", + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI" }, { diff --git a/test_scripts/Policies/build_options/091_ATF_Check_STATUS_UPDATE_NEEDED_PROPRIETARY.lua b/test_scripts/Policies/build_options/091_ATF_Check_STATUS_UPDATE_NEEDED_PROPRIETARY.lua index fd17ec24f9..e99efade7c 100644 --- a/test_scripts/Policies/build_options/091_ATF_Check_STATUS_UPDATE_NEEDED_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/091_ATF_Check_STATUS_UPDATE_NEEDED_PROPRIETARY.lua @@ -18,12 +18,12 @@ --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local mobile_session = require('mobile_session') +local utils = require ('user_modules/utils') --[[ Local Variables ]] --NewTestSuiteNumber = 0 @@ -109,7 +109,7 @@ function Test:Precondition_ActivateApplication() RequestId = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,_) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) @@ -120,7 +120,7 @@ function Test:Precondition_ActivateApplication() end) EXPECT_NOTIFICATION("OnHMIStatus", {hmiLevel = "FULL", audioStreamingState = "AUDIBLE", systemContext = "MAIN"}) end - + function Test:Precondition_MoveSystem_UP_TO_DATE() policyUpdate(self) end @@ -144,4 +144,4 @@ end commonFunctions:newTestCasesGroup("Postconditions") function Test.Postcondition_SDLStop() StopSDL() -end \ No newline at end of file +end diff --git a/test_scripts/Policies/build_options/092_ATF_Check_STATUS_vai_USER_Request_PROPRIETARY.lua b/test_scripts/Policies/build_options/092_ATF_Check_STATUS_vai_USER_Request_PROPRIETARY.lua index 742d716a3f..e0210a8ef6 100644 --- a/test_scripts/Policies/build_options/092_ATF_Check_STATUS_vai_USER_Request_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/092_ATF_Check_STATUS_vai_USER_Request_PROPRIETARY.lua @@ -17,14 +17,13 @@ -- SDL->HMI: SDL.OnStatusUpdate(UPDATING) -- SDL->HMI: BasicCommunication.PolicyUpdate ------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -83,7 +82,7 @@ function Test:Preconditions_ActivateApplication() RequestId = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestId) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,_) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/build_options/093_ATF_OnStatusUpdate_Trigger_PROPRIETARY.lua b/test_scripts/Policies/build_options/093_ATF_OnStatusUpdate_Trigger_PROPRIETARY.lua index fcbccd09ed..950ef5e2d3 100644 --- a/test_scripts/Policies/build_options/093_ATF_OnStatusUpdate_Trigger_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/093_ATF_OnStatusUpdate_Trigger_PROPRIETARY.lua @@ -19,7 +19,7 @@ -- "UPDATE_NEEDED" -> "UPDATING" -> "UP_TO_DATE" -> "UPDATE_NEEDED" -> "UPDATING" --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") diff --git a/test_scripts/Policies/build_options/094_ATF_PTS_creation_rule_PROPRIETARY.lua b/test_scripts/Policies/build_options/094_ATF_PTS_creation_rule_PROPRIETARY.lua index ba0d4350ba..8dd8654a5c 100644 --- a/test_scripts/Policies/build_options/094_ATF_PTS_creation_rule_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/094_ATF_PTS_creation_rule_PROPRIETARY.lua @@ -14,15 +14,12 @@ -- Expected result: -- PTU is requested. PTS is created. --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -41,7 +38,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_PTS_Creation_rule() local result = testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {""}, "print", "PROPRIETARY") diff --git a/test_scripts/Policies/build_options/095_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua b/test_scripts/Policies/build_options/095_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua index 2dd8bc9e79..ac28d6dfcf 100644 --- a/test_scripts/Policies/build_options/095_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/095_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua @@ -21,7 +21,6 @@ ------------------------------------------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/096_ATF_SDL_Send_PolicyUpdat_To_HMI_In_Case_PTU_Is_Triggered_PROPRIETARY.lua b/test_scripts/Policies/build_options/096_ATF_SDL_Send_PolicyUpdat_To_HMI_In_Case_PTU_Is_Triggered_PROPRIETARY.lua index af26b7a06c..85ebcb9f8f 100644 --- a/test_scripts/Policies/build_options/096_ATF_SDL_Send_PolicyUpdat_To_HMI_In_Case_PTU_Is_Triggered_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/096_ATF_SDL_Send_PolicyUpdat_To_HMI_In_Case_PTU_Is_Triggered_PROPRIETARY.lua @@ -15,9 +15,7 @@ -- Expected result: -- a) SDL send BasicCommunication.PolicyUpdate ( , , ) to HMI. --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 diff --git a/test_scripts/Policies/build_options/097_ATF_PTU_Cycleing_Through_The_URLs_During_Retry_Sequence_HTTP.lua b/test_scripts/Policies/build_options/097_ATF_PTU_Cycleing_Through_The_URLs_During_Retry_Sequence_HTTP.lua index 6ef8b892ec..d3aaa80412 100644 --- a/test_scripts/Policies/build_options/097_ATF_PTU_Cycleing_Through_The_URLs_During_Retry_Sequence_HTTP.lua +++ b/test_scripts/Policies/build_options/097_ATF_PTU_Cycleing_Through_The_URLs_During_Retry_Sequence_HTTP.lua @@ -18,9 +18,6 @@ -- Expected result: -- Url parameter is taken cyclically from list of available URLs --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") local commonFunctions = require("user_modules/shared_testcases/commonFunctions") diff --git a/test_scripts/Policies/build_options/098_ATF_PTU_Unsuccessful_Even_After_Retry_Strategy_HTTP.lua b/test_scripts/Policies/build_options/098_ATF_PTU_Unsuccessful_Even_After_Retry_Strategy_HTTP.lua index 7c9a93224e..98ff18b689 100644 --- a/test_scripts/Policies/build_options/098_ATF_PTU_Unsuccessful_Even_After_Retry_Strategy_HTTP.lua +++ b/test_scripts/Policies/build_options/098_ATF_PTU_Unsuccessful_Even_After_Retry_Strategy_HTTP.lua @@ -23,9 +23,7 @@ -- Expected result: -- Status is UPDATE_NEEDED and PTS is sent as binary data of OnSystemRequest to Mobile --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/099_ATF_SDL_Send_BC_PolicyUpdate_To_HMI_In_Case_PTU_Is_Triggered_PROPRIETARY.lua b/test_scripts/Policies/build_options/099_ATF_SDL_Send_BC_PolicyUpdate_To_HMI_In_Case_PTU_Is_Triggered_PROPRIETARY.lua index 0cd35b1e44..2a449a5b4f 100644 --- a/test_scripts/Policies/build_options/099_ATF_SDL_Send_BC_PolicyUpdate_To_HMI_In_Case_PTU_Is_Triggered_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/099_ATF_SDL_Send_BC_PolicyUpdate_To_HMI_In_Case_PTU_Is_Triggered_PROPRIETARY.lua @@ -20,9 +20,6 @@ -- 2. Parameters (retry, timeout, file) are defined -- 3. Status changed to 'UPDATING' --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") diff --git a/test_scripts/Policies/build_options/100_ATF_PTU_Transfer_Several_Apps_Different_HMI_Levels_PROPRIETARY.lua b/test_scripts/Policies/build_options/100_ATF_PTU_Transfer_Several_Apps_Different_HMI_Levels_PROPRIETARY.lua index 80eb5236f6..4f314bfd18 100644 --- a/test_scripts/Policies/build_options/100_ATF_PTU_Transfer_Several_Apps_Different_HMI_Levels_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/100_ATF_PTU_Transfer_Several_Apps_Different_HMI_Levels_PROPRIETARY.lua @@ -20,7 +20,7 @@ -- app_1 doesn't take part in PTU (except of the case when app_1 is the only application being run on SDL) --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local mobileSession = require("mobile_session") diff --git a/test_scripts/Policies/build_options/101_ATF_SDL_Build_EXTENDED_POLICY_HTTP.lua b/test_scripts/Policies/build_options/101_ATF_SDL_Build_EXTENDED_POLICY_HTTP.lua index b532baccbc..f0216aff8d 100644 --- a/test_scripts/Policies/build_options/101_ATF_SDL_Build_EXTENDED_POLICY_HTTP.lua +++ b/test_scripts/Policies/build_options/101_ATF_SDL_Build_EXTENDED_POLICY_HTTP.lua @@ -13,9 +13,7 @@ -- The flag EXTENDED_POLICY is set to HTTP -- PTU passes successfully --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/102_ATF_Timeout_countdown_start_PROPRIETARY.lua b/test_scripts/Policies/build_options/102_ATF_Timeout_countdown_start_PROPRIETARY.lua index 6ad36ef943..c30017aa63 100644 --- a/test_scripts/Policies/build_options/102_ATF_Timeout_countdown_start_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/102_ATF_Timeout_countdown_start_PROPRIETARY.lua @@ -21,10 +21,6 @@ -- SDL waits for SystemRequest response from within 'timeout' value, if no obtained, -- it starts retry sequence --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/103_ATF_Timeout_wait_response_PTU_PROPRIETARY.lua b/test_scripts/Policies/build_options/103_ATF_Timeout_wait_response_PTU_PROPRIETARY.lua index 638ce7accf..6344af893a 100644 --- a/test_scripts/Policies/build_options/103_ATF_Timeout_wait_response_PTU_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/103_ATF_Timeout_wait_response_PTU_PROPRIETARY.lua @@ -14,10 +14,6 @@ -- To define the timeout to wait a response on PTU, Policies manager must refer PTS -- "module_config" section, key . --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/build_options/104_ATF_Transfer_OnSystemRequest_toApp_PROPRIETARY.lua b/test_scripts/Policies/build_options/104_ATF_Transfer_OnSystemRequest_toApp_PROPRIETARY.lua index 10059a5ce9..478a8a5769 100644 --- a/test_scripts/Policies/build_options/104_ATF_Transfer_OnSystemRequest_toApp_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/104_ATF_Transfer_OnSystemRequest_toApp_PROPRIETARY.lua @@ -13,10 +13,6 @@ -- Expected result: -- Payload (Snapshot and Binary Header) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/build_options/105_ATF_PM_change_status_UPDATE_NEEDED_after_timeout_expired_PROPRIETARY.lua b/test_scripts/Policies/build_options/105_ATF_PM_change_status_UPDATE_NEEDED_after_timeout_expired_PROPRIETARY.lua index 5bf8a246d2..67c36c856e 100644 --- a/test_scripts/Policies/build_options/105_ATF_PM_change_status_UPDATE_NEEDED_after_timeout_expired_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/105_ATF_PM_change_status_UPDATE_NEEDED_after_timeout_expired_PROPRIETARY.lua @@ -15,9 +15,7 @@ -- Expected result: --SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/106_ATF_PolicyManager_changes_status_to_UPDATING_PROPRIETARY.lua b/test_scripts/Policies/build_options/106_ATF_PolicyManager_changes_status_to_UPDATING_PROPRIETARY.lua index 295e73ac03..a6cf7217ff 100644 --- a/test_scripts/Policies/build_options/106_ATF_PolicyManager_changes_status_to_UPDATING_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/106_ATF_PolicyManager_changes_status_to_UPDATING_PROPRIETARY.lua @@ -17,7 +17,7 @@ -- SDL.OnStatusUpdate(UPDATING) notification is send right after SDL->MOB: OnSystemRequest --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" +config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local mobile_session = require("mobile_session") diff --git a/test_scripts/Policies/build_options/107_ATF_PTU_in_case_of_failed_retry_strategy_during_previous_IGN_ON_PROPRIETARY.lua b/test_scripts/Policies/build_options/107_ATF_PTU_in_case_of_failed_retry_strategy_during_previous_IGN_ON_PROPRIETARY.lua index 07ddeb47bd..4c380166d7 100644 --- a/test_scripts/Policies/build_options/107_ATF_PTU_in_case_of_failed_retry_strategy_during_previous_IGN_ON_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/107_ATF_PTU_in_case_of_failed_retry_strategy_during_previous_IGN_ON_PROPRIETARY.lua @@ -17,9 +17,7 @@ -- 3. PTU sequence started: *SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED)* -- 4. PTS is created by SDL.....//PTU started --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appHMIType = {"DEFAULT"} --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/108_ATF_PTU_Trigger_days_PROPRIETARY.lua b/test_scripts/Policies/build_options/108_ATF_PTU_Trigger_days_PROPRIETARY.lua index d4aac9e32a..1781432267 100644 --- a/test_scripts/Policies/build_options/108_ATF_PTU_Trigger_days_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/108_ATF_PTU_Trigger_days_PROPRIETARY.lua @@ -17,9 +17,7 @@ -- Expected result: -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) //start PTU flow --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] @@ -138,4 +136,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/build_options/109_ATF_PTU_Trigger_IGN_cycles_PROPRIETARY.lua b/test_scripts/Policies/build_options/109_ATF_PTU_Trigger_IGN_cycles_PROPRIETARY.lua index f07709c155..638ae9e5c8 100644 --- a/test_scripts/Policies/build_options/109_ATF_PTU_Trigger_IGN_cycles_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/109_ATF_PTU_Trigger_IGN_cycles_PROPRIETARY.lua @@ -13,9 +13,7 @@ -- When amount of ignition cycles notified by HMI via BasicCommunication.OnIgnitionCycleOver gets equal to the value of "exchange_after_x_ignition_cycles" -- field ("module_config" section) of policies database, SDL must trigger a PolicyTableUpdate sequence --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appID = "123456" config.application1.registerAppInterfaceParams.appHMIType = { "DEFAULT" } diff --git a/test_scripts/Policies/build_options/110_ATF_PTU_Trigger_kilometers_PROPRIETARY.lua b/test_scripts/Policies/build_options/110_ATF_PTU_Trigger_kilometers_PROPRIETARY.lua index f1a4ed8e1c..95f14011fa 100644 --- a/test_scripts/Policies/build_options/110_ATF_PTU_Trigger_kilometers_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/110_ATF_PTU_Trigger_kilometers_PROPRIETARY.lua @@ -19,9 +19,7 @@ -- Expected result: -- PTU flow started --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -29,6 +27,7 @@ config.defaultProtocolVersion = 2 local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -85,7 +84,7 @@ function Test:Precondition_Activate_App_Start_PTU() EXPECT_HMIRESPONSE(RequestId) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/build_options/111_ATF_Start_PTU_retry_sequence_PROPRIETARY.lua b/test_scripts/Policies/build_options/111_ATF_Start_PTU_retry_sequence_PROPRIETARY.lua index 6788c64ca0..24108cb111 100644 --- a/test_scripts/Policies/build_options/111_ATF_Start_PTU_retry_sequence_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/111_ATF_Start_PTU_retry_sequence_PROPRIETARY.lua @@ -21,7 +21,6 @@ -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appHMIType = { "MEDIA" } config.defaultProtocolVersion = 2 diff --git a/test_scripts/Policies/build_options/112_ATF_transfer_SystemRequest_from_app_to_HMI_PROPRIETARY.lua b/test_scripts/Policies/build_options/112_ATF_transfer_SystemRequest_from_app_to_HMI_PROPRIETARY.lua index 00fb2750f8..6c47e00eff 100644 --- a/test_scripts/Policies/build_options/112_ATF_transfer_SystemRequest_from_app_to_HMI_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/112_ATF_transfer_SystemRequest_from_app_to_HMI_PROPRIETARY.lua @@ -11,10 +11,6 @@ -- Expected result: -- SDL must send BasicCommunication.SystemRequest (, PROPRIETARY, params) to HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/build_options/113_ATF_transfer_SystemRequest_from_HMI_to_app_PROPRIETARY.lua b/test_scripts/Policies/build_options/113_ATF_transfer_SystemRequest_from_HMI_to_app_PROPRIETARY.lua index 60f82ff77c..4f2aea556e 100644 --- a/test_scripts/Policies/build_options/113_ATF_transfer_SystemRequest_from_HMI_to_app_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/113_ATF_transfer_SystemRequest_from_HMI_to_app_PROPRIETARY.lua @@ -11,10 +11,6 @@ -- Expected result: -- SDL->MOB: SystemRequest (result code from HMI response) --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/build_options/114_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua b/test_scripts/Policies/build_options/114_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua index c2492cce7a..b70ebe4724 100644 --- a/test_scripts/Policies/build_options/114_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/114_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua @@ -22,7 +22,6 @@ ------------------------------------------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] Test = require('connecttest') @@ -45,7 +44,7 @@ local registerAppInterfaceParams = languageDesired = 'EN-US', hmiDisplayLanguageDesired = 'EN-US', appHMIType = {"NAVIGATION"}, - appID = "MyTestApp", + appID = "mytestapp", deviceInfo = { os = "Android", diff --git a/test_scripts/Policies/build_options/115_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp_PROPRIETARY.lua b/test_scripts/Policies/build_options/115_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp_PROPRIETARY.lua index d7897c74c3..3faf128056 100644 --- a/test_scripts/Policies/build_options/115_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/115_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp_PROPRIETARY.lua @@ -21,7 +21,6 @@ ------------------------------------------------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] config.defaultProtocolVersion = 2 -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appHMIType = { "MEDIA" } --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/build_options/116_ATF_DEXTENDED_POLICY_OFF_HTTP.lua b/test_scripts/Policies/build_options/116_ATF_DEXTENDED_POLICY_OFF_HTTP.lua index 45fa5f037b..ad32737e04 100644 --- a/test_scripts/Policies/build_options/116_ATF_DEXTENDED_POLICY_OFF_HTTP.lua +++ b/test_scripts/Policies/build_options/116_ATF_DEXTENDED_POLICY_OFF_HTTP.lua @@ -12,10 +12,6 @@ -- The flag EXTENDED_POLICY is set to HTTP -- PTU passes successfully --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/build_options/117_ATF_DEXTENDED_POLICY_No_Flag_HTTP.lua b/test_scripts/Policies/build_options/117_ATF_DEXTENDED_POLICY_No_Flag_HTTP.lua index cd0ff7a7e7..5a64b03d19 100644 --- a/test_scripts/Policies/build_options/117_ATF_DEXTENDED_POLICY_No_Flag_HTTP.lua +++ b/test_scripts/Policies/build_options/117_ATF_DEXTENDED_POLICY_No_Flag_HTTP.lua @@ -14,10 +14,6 @@ -- The flag -DEXTENDED_POLICY: is set to HTTP -- PTU passes successfully --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/build_options/118_ATF_Request_PTU_Trigger_App_Excluded_PT_HTTP.lua b/test_scripts/Policies/build_options/118_ATF_Request_PTU_Trigger_App_Excluded_PT_HTTP.lua index 1653fe7395..8ecfa98777 100644 --- a/test_scripts/Policies/build_options/118_ATF_Request_PTU_Trigger_App_Excluded_PT_HTTP.lua +++ b/test_scripts/Policies/build_options/118_ATF_Request_PTU_Trigger_App_Excluded_PT_HTTP.lua @@ -19,10 +19,6 @@ -- SDL->HMI: SDL.OnStatusUpdate(UPDATE_NEEDED) -- SDL->HMI: BasicCommunication.PolicyUpdate --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') diff --git a/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua b/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua index 7637d1dcd4..d79d83554e 100644 --- a/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua +++ b/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua @@ -44,6 +44,7 @@ require('cardinalities') --[[ Required Shared libraries ]] local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') +local utils = require ('user_modules/utils') require('user_modules/AppTypes') --[[ General Precondition before ATF start ]] @@ -93,7 +94,7 @@ function Test:Precondition_Get_List_Of_Connected_Devices() deviceList = { { - name = "127.0.0.1", + name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false } @@ -112,7 +113,7 @@ function Test:Precondition_Activate_App_Consent_Device_Make_PTU_Consent_Group() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = MACHash, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = MACHash, name = utils.getDeviceName()}}) GetCurrentTimeStampDeviceConsent() EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) diff --git a/test_scripts/Policies/user_consent_of_Policies/189_ATF_isAppPermissionsRevoked_true.lua b/test_scripts/Policies/user_consent_of_Policies/189_ATF_isAppPermissionsRevoked_true.lua index 6a2744d3e3..ac5a10f5e5 100644 --- a/test_scripts/Policies/user_consent_of_Policies/189_ATF_isAppPermissionsRevoked_true.lua +++ b/test_scripts/Policies/user_consent_of_Policies/189_ATF_isAppPermissionsRevoked_true.lua @@ -22,13 +22,11 @@ -- Expected result: -- PoliciesManager must respond with "isAppPermissionRevoked:true" and "AppRevokedPermissions" param containing the list of revoked permissions to HMI --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Variables ]] local HMIAppID @@ -52,7 +50,7 @@ function Test:SetHMIAppID() end function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:TestStep_PTU_appPermissionsConsentNeeded_true() diff --git a/test_scripts/Policies/user_consent_of_Policies/190_ATF_Device_treated_as_consented.lua b/test_scripts/Policies/user_consent_of_Policies/190_ATF_Device_treated_as_consented.lua index 100f915eff..85e0df4eb3 100644 --- a/test_scripts/Policies/user_consent_of_Policies/190_ATF_Device_treated_as_consented.lua +++ b/test_scripts/Policies/user_consent_of_Policies/190_ATF_Device_treated_as_consented.lua @@ -15,9 +15,6 @@ -- Expected result: -- Policies Manager must treat the device as consented If "device" sub-section of "app_policies" has its group listed in "preconsented_groups". --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/user_consent_of_Policies/191_ATF_UpdateDeviceList_on_device_connect.lua b/test_scripts/Policies/user_consent_of_Policies/191_ATF_UpdateDeviceList_on_device_connect.lua index c0590c5035..b35825d2b5 100644 --- a/test_scripts/Policies/user_consent_of_Policies/191_ATF_UpdateDeviceList_on_device_connect.lua +++ b/test_scripts/Policies/user_consent_of_Policies/191_ATF_UpdateDeviceList_on_device_connect.lua @@ -14,14 +14,12 @@ -- Expected result: -- SDL sends UpdateDeviceList to HMI right after new device connects over WiFi --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonTestCases = require ('user_modules/shared_testcases/commonTestCases') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -37,16 +35,14 @@ require('mobile_session') commonFunctions:newTestCasesGroup("Test") function Test:UpdateDeviceList_on_device_connect() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") - self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", { deviceList = { { - id = config.deviceMAC, + id = utils.getDeviceMAC(), isSDLAllowed = false, - name = ServerAddress, + name = utils.getDeviceName(), transportType = "WIFI" } } @@ -63,4 +59,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/user_consent_of_Policies/192_ATF_isPermissionsConsentNeeded_false.lua b/test_scripts/Policies/user_consent_of_Policies/192_ATF_isPermissionsConsentNeeded_false.lua index 3ab75c177e..dcae207fb3 100644 --- a/test_scripts/Policies/user_consent_of_Policies/192_ATF_isPermissionsConsentNeeded_false.lua +++ b/test_scripts/Policies/user_consent_of_Policies/192_ATF_isPermissionsConsentNeeded_false.lua @@ -15,10 +15,6 @@ -- On receiving SDL.ActivateApp PoliciesManager must respond with "isPermissionsConsentNeeded:false" -- to HMI, consent for custom permissions is not appeared --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') diff --git a/test_scripts/Policies/user_consent_of_Policies/193_ATF_isPermissionsConsentNeeded_true.lua b/test_scripts/Policies/user_consent_of_Policies/193_ATF_isPermissionsConsentNeeded_true.lua index dad19b7f24..962d729244 100644 --- a/test_scripts/Policies/user_consent_of_Policies/193_ATF_isPermissionsConsentNeeded_true.lua +++ b/test_scripts/Policies/user_consent_of_Policies/193_ATF_isPermissionsConsentNeeded_true.lua @@ -19,10 +19,6 @@ -- On receiving SDL.ActivateApp PoliciesManager must respond with "isPermissionsConsentNeeded:true" to HMI, -- consent for custom permissions should appeared --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') @@ -69,4 +65,4 @@ function Test.Postcondition_Stop() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/user_consent_of_Policies/194_ATF_ActivateApp_isSDLAllowed_true.lua b/test_scripts/Policies/user_consent_of_Policies/194_ATF_ActivateApp_isSDLAllowed_true.lua index 1b13d968c6..eed9b4c07b 100644 --- a/test_scripts/Policies/user_consent_of_Policies/194_ATF_ActivateApp_isSDLAllowed_true.lua +++ b/test_scripts/Policies/user_consent_of_Policies/194_ATF_ActivateApp_isSDLAllowed_true.lua @@ -18,14 +18,13 @@ -- Expected result: -- PoliciesManager must respond with "isSDLAllowed: true" in the response to HMI without consent request --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -53,7 +52,7 @@ function Test:TestStep_ActivateApp1_isSDLAllowed_false() EXPECT_HMIRESPONSE(RequestId1) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,_data1) self.hmiConnection:SendResponse(_data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/user_consent_of_Policies/195_ATF_ActivateApp_isSDLAllowed_false.lua b/test_scripts/Policies/user_consent_of_Policies/195_ATF_ActivateApp_isSDLAllowed_false.lua index c93aa89c95..7ec27549b1 100644 --- a/test_scripts/Policies/user_consent_of_Policies/195_ATF_ActivateApp_isSDLAllowed_false.lua +++ b/test_scripts/Policies/user_consent_of_Policies/195_ATF_ActivateApp_isSDLAllowed_false.lua @@ -17,14 +17,12 @@ -- PoliciesManager must respond with 1)"isSDLAllowed:false", 2) "device" param containing the device`s name and ID previously sent by SDL via UpdateDeviceList -- in the response to HMI without consent request --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonTestCases = require ('user_modules/shared_testcases/commonTestCases') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -38,8 +36,8 @@ require('mobile_session') --[[ Local variables ]] local mobile_session = require('mobile_session') -local device_id = config.deviceMAC -local server_address = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") +local device_id = utils.getDeviceMAC() +local server_address = utils.getDeviceName() --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") @@ -50,7 +48,7 @@ function Test:Precondition_UpdateDeviceList_on_device_connect() { deviceList = { { - id = config.deviceMAC, + id = utils.getDeviceMAC(), isSDLAllowed = false, name = server_address, transportType = "WIFI" @@ -97,7 +95,7 @@ function Test:ActivateApp_isSDLAllowed_false() EXPECT_HMIRESPONSE(RequestId1) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = server_address}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = server_address}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,_data1) self.hmiConnection:SendResponse(_data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/user_consent_of_Policies/196_ATF_UpdateDeviceList_isSDLAllowed_false.lua b/test_scripts/Policies/user_consent_of_Policies/196_ATF_UpdateDeviceList_isSDLAllowed_false.lua index 05a59f00f9..620dedb900 100644 --- a/test_scripts/Policies/user_consent_of_Policies/196_ATF_UpdateDeviceList_isSDLAllowed_false.lua +++ b/test_scripts/Policies/user_consent_of_Policies/196_ATF_UpdateDeviceList_isSDLAllowed_false.lua @@ -14,14 +14,12 @@ -- Expected result: -- PoliciesManager must provide "isSDLAllowed:false" param of "DeviceInfo" struct ONLY when sending "UpdateDeviceList" RPC to HMI --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require ('user_modules/shared_testcases/commonSteps') local commonTestCases = require ('user_modules/shared_testcases/commonTestCases') local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -37,15 +35,14 @@ require('mobile_session') commonFunctions:newTestCasesGroup("Test") function Test:UpdateDeviceList_on_device_connect() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") commonTestCases:DelayedExp(2000) self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", { deviceList = { { - id = config.deviceMAC, + id = utils.getDeviceMAC(), isSDLAllowed = false, - name = ServerAddress, + name = utils.getDeviceName(), transportType = "WIFI" }}}) :Do(function(_,data) @@ -63,4 +60,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/user_consent_of_Policies/197_ATF_ActivateApp_isSDLAllowed_true.lua b/test_scripts/Policies/user_consent_of_Policies/197_ATF_ActivateApp_isSDLAllowed_true.lua index 33c408e9db..9b4266621b 100644 --- a/test_scripts/Policies/user_consent_of_Policies/197_ATF_ActivateApp_isSDLAllowed_true.lua +++ b/test_scripts/Policies/user_consent_of_Policies/197_ATF_ActivateApp_isSDLAllowed_true.lua @@ -21,14 +21,13 @@ -- Expected result: -- PoliciesManager must respond with "isSDLAllowed: true" in the response to HMI without consent request --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') -- local commonTestCases = require('user_modules/shared_testcases/commonTestCases') -- local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') @@ -59,7 +58,7 @@ function Test:ActivateApp1() EXPECT_HMIRESPONSE(RequestId1) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,_data1) self.hmiConnection:SendResponse(_data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/test_scripts/Policies/user_consent_of_Policies/198_ATF_GetUserFriendlyMessage_language_missed.lua b/test_scripts/Policies/user_consent_of_Policies/198_ATF_GetUserFriendlyMessage_language_missed.lua index ba9f2b3595..953c951d93 100644 --- a/test_scripts/Policies/user_consent_of_Policies/198_ATF_GetUserFriendlyMessage_language_missed.lua +++ b/test_scripts/Policies/user_consent_of_Policies/198_ATF_GetUserFriendlyMessage_language_missed.lua @@ -16,18 +16,14 @@ -- Expected result: -- English ("en-us") prompt must be returned to HMI --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local language = testCasesForPolicyTableSnapshot:get_data_from_Preloaded_PT("consumer_friendly_messages.messages.DataConsent.languages.en-us.tts") local line1 = testCasesForPolicyTableSnapshot:get_data_from_Preloaded_PT("consumer_friendly_messages.messages.DataConsent.languages.en-us.line1") local line2 = testCasesForPolicyTableSnapshot:get_data_from_Preloaded_PT("consumer_friendly_messages.messages.DataConsent.languages.en-us.line2") @@ -65,7 +61,7 @@ function Test:Precondition_Activate_app_EN_US() :Do(function(_,_) -- Do not allow SDL to have again message GetUserFriendlyMessage self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = false, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = false}}) + {allowed = false, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = false}}) end) end diff --git a/test_scripts/Policies/user_consent_of_Policies/199_ATF_appPermissionsConsentNeeded_true.lua b/test_scripts/Policies/user_consent_of_Policies/199_ATF_appPermissionsConsentNeeded_true.lua index 4c4b1965c2..89f9a28dad 100644 --- a/test_scripts/Policies/user_consent_of_Policies/199_ATF_appPermissionsConsentNeeded_true.lua +++ b/test_scripts/Policies/user_consent_of_Policies/199_ATF_appPermissionsConsentNeeded_true.lua @@ -20,14 +20,11 @@ -- PoliciesManager must respond with the list of s that have the field "user_consent_prompt" in corresponding and -- are assigned to the specified application (section "" -> "groups") --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -43,7 +40,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_Activate_app() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] diff --git a/test_scripts/Policies/user_consent_of_Policies/200_ATF_Data_consent_prompt.lua b/test_scripts/Policies/user_consent_of_Policies/200_ATF_Data_consent_prompt.lua index 5a2c7c0e7e..4b62026c22 100644 --- a/test_scripts/Policies/user_consent_of_Policies/200_ATF_Data_consent_prompt.lua +++ b/test_scripts/Policies/user_consent_of_Policies/200_ATF_Data_consent_prompt.lua @@ -16,17 +16,11 @@ -- sub-sections of section which name corresponds to the value of messageCodes param of -- SDL.GetUserFriendlyMessage request --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') - ---[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -50,7 +44,7 @@ function Test:GetUserFriendlyMessage_data_consent_prompt() { messages = { {messageCode = "DataConsent"}}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) end end) diff --git a/test_scripts/Policies/user_consent_of_Policies/201_ATF_User_consents_permissions.lua b/test_scripts/Policies/user_consent_of_Policies/201_ATF_User_consents_permissions.lua index 11f965d5e9..16a9046925 100644 --- a/test_scripts/Policies/user_consent_of_Policies/201_ATF_User_consents_permissions.lua +++ b/test_scripts/Policies/user_consent_of_Policies/201_ATF_User_consents_permissions.lua @@ -20,16 +20,13 @@ -- Expected result: -- SDL must notify an application about the current permissions active on HMI via onPermissionsChange() notification --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -120,7 +117,6 @@ commonFunctions:newTestCasesGroup("Test") function Test:IsPermissionsConsentNeeded_false_on_app_activation() local is_test_passed = true - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) --Allow SDL functionality @@ -131,7 +127,7 @@ function Test:IsPermissionsConsentNeeded_false_on_app_activation() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) end @@ -218,7 +214,7 @@ function Test:TestStep_trigger_user_request_update_from_HMI() end function Test:TestStep_verify_PermissionConsent() - local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.DrivingCharacteristics-3") + local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.DrivingCharacteristics-3") if(app_permission ~= true) then self:FailTestCase("DrivingCharacteristics-3 is not assigned to application, real: " ..app_permission) end diff --git a/test_scripts/Policies/user_consent_of_Policies/202_ATF_No_OnSDLConsentNeeded.lua b/test_scripts/Policies/user_consent_of_Policies/202_ATF_No_OnSDLConsentNeeded.lua index 68d675a988..d6a608ce90 100644 --- a/test_scripts/Policies/user_consent_of_Policies/202_ATF_No_OnSDLConsentNeeded.lua +++ b/test_scripts/Policies/user_consent_of_Policies/202_ATF_No_OnSDLConsentNeeded.lua @@ -23,7 +23,6 @@ -- SDL must NOT send the OnSDLConsentNeeded to HMI --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.application1.registerAppInterfaceParams.appHMIType = { "MEDIA" } --[[ Required Shared libraries ]] diff --git a/test_scripts/Policies/user_consent_of_Policies/203_ATF_Master_reset.lua b/test_scripts/Policies/user_consent_of_Policies/203_ATF_Master_reset.lua index b396d26930..bfbe53e7fe 100644 --- a/test_scripts/Policies/user_consent_of_Policies/203_ATF_Master_reset.lua +++ b/test_scripts/Policies/user_consent_of_Policies/203_ATF_Master_reset.lua @@ -15,14 +15,12 @@ -- Expected result: -- Policy Manager must revert Local Policy Table to the Preload Policy Table --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTableSnapshot = require ('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Preconditions ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -38,8 +36,6 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_CheckLocalPT() local hmi_app1_id = self.applications[config.application1.registerAppInterfaceParams.appName] - local ServerAddress = "127.0.0.1"--commonSteps:get_data_from_SDL_ini("ServerAddress") - local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) EXPECT_HMIRESPONSE(RequestId) @@ -49,13 +45,13 @@ function Test:TestStep_CheckLocalPT() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) if ( commonSteps:file_exists('/tmp/fs/mp/images/ivsu_cache/sdl_snapshot.json')) then self:FailTestCase(" \27[31m /tmp/fs/mp/images/ivsu_cache/sdl_snapshot.json is created \27[0m") else - testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, {config.deviceMAC},{hmi_app1_id}, "print") + testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID}, {utils.getDeviceMAC()},{hmi_app1_id}, "print") end end) end diff --git a/test_scripts/Policies/user_consent_of_Policies/204_ATF_App_group_order_preconsented.lua b/test_scripts/Policies/user_consent_of_Policies/204_ATF_App_group_order_preconsented.lua index 78a30f1294..2748097ff8 100644 --- a/test_scripts/Policies/user_consent_of_Policies/204_ATF_App_group_order_preconsented.lua +++ b/test_scripts/Policies/user_consent_of_Policies/204_ATF_App_group_order_preconsented.lua @@ -15,16 +15,13 @@ -- Expected result: -- App should have only "pre_DataConsent" groups allowed --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -258,11 +255,10 @@ local arrayRegisterNewApp = { commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_ConnectDevice() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") commonTestCases:DelayedExp(2000) self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", - { deviceList = { { id = config.deviceMAC, isSDLAllowed = false, name = ServerAddress, transportType = "WIFI" }}}) + { deviceList = { { id = utils.getDeviceMAC(), isSDLAllowed = false, name = utils.getDeviceName(), transportType = "WIFI" }}}) :Do(function(_,data) self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) end) diff --git a/test_scripts/Policies/user_consent_of_Policies/205_ATF_Consent_timestamp.lua b/test_scripts/Policies/user_consent_of_Policies/205_ATF_Consent_timestamp.lua index 642720c30f..1739b7bb51 100644 --- a/test_scripts/Policies/user_consent_of_Policies/205_ATF_Consent_timestamp.lua +++ b/test_scripts/Policies/user_consent_of_Policies/205_ATF_Consent_timestamp.lua @@ -17,15 +17,12 @@ -- Expected result: -- PoliciesManager must add a timestamp of user consent for the current mobile device into “time_stamp” field in the format of "TZ". --------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local Variables ]] local TimeToCheckSeconds = nil @@ -56,7 +53,7 @@ require('user_modules/AppTypes') --[[ Preconditions ]] commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_trigger_getting_device_consent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) local CurrentTimeSeconds = assert( io.popen( "date +%H:%M:%S" , 'r')) TimeToCheckSeconds = CurrentTimeSeconds:read( '*l' ) end @@ -71,7 +68,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TimeStamp_in_userConsentRecords_table() local errorFlag = false local ErrorMessage = "" - local TimeStamp_InUserConsentRecordsTable = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records.device.time_stamp") + local TimeStamp_InUserConsentRecordsTable = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records.device.time_stamp") if type(TimeStamp_InUserConsentRecordsTable) ~= 'string' then self:FailTestCase("TimeStamp in user_consent_records came wrong") end diff --git a/test_scripts/Policies/user_consent_of_Policies/206_ATF_Permissions_before_device_consented.lua b/test_scripts/Policies/user_consent_of_Policies/206_ATF_Permissions_before_device_consented.lua index 3fd0e2ccd1..69bc95a8b0 100644 --- a/test_scripts/Policies/user_consent_of_Policies/206_ATF_Permissions_before_device_consented.lua +++ b/test_scripts/Policies/user_consent_of_Policies/206_ATF_Permissions_before_device_consented.lua @@ -29,18 +29,13 @@ -- HMI->SDL: SDL.ActivateApp{appID} -- SDL->HMI: SDL.ActivateApp_response{isSDLAllowed: false, params} ------------------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') - +local utils = require ('user_modules/utils') --[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local pre_dataconsent = "129372391" --[[ General Precondition before ATF start ]] @@ -60,7 +55,7 @@ function Test:TestStep1_ActivateApp_on_unconsented_device() EXPECT_HMIRESPONSE(RequestId, {result = { code = 0, - device = { id = config.deviceMAC, name = ServerAddress }, + device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() }, isAppPermissionsRevoked = false, isAppRevoked = false, isSDLAllowed = false, method ="SDL.ActivateApp"}}) :Do(function(_,data) if data.result.isSDLAllowed ~= false then @@ -106,7 +101,7 @@ function Test:TestStep4_ActivateApp_again_on_unconsented_device() --Device is still not consented, isSDLAllowed should be "false" EXPECT_HMIRESPONSE(RequestId, {result = { code = 0, - device = { id = config.deviceMAC, name = ServerAddress }, + device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() }, isAppPermissionsRevoked = false, isAppRevoked = false, isSDLAllowed = false, method ="SDL.ActivateApp"}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Times(0) @@ -140,4 +135,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/user_consent_of_Policies/207_ATF_HMILevel_before_data_consented.lua b/test_scripts/Policies/user_consent_of_Policies/207_ATF_HMILevel_before_data_consented.lua index 17dcf32412..9231e81b30 100644 --- a/test_scripts/Policies/user_consent_of_Policies/207_ATF_HMILevel_before_data_consented.lua +++ b/test_scripts/Policies/user_consent_of_Policies/207_ATF_HMILevel_before_data_consented.lua @@ -27,17 +27,11 @@ -- HMI->SDL: OnAllowSDLFunctionality {allowed: false, params} -- SDL->app: OnPermissionChanged{params}// "pre_DataConsent" sub-section of "app_policies" section of PT, app`s HMI level corresponds to one from "default_hmi" field ------------------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') - ---[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -55,7 +49,7 @@ function Test:ActivateApp_on_unconsented_device() local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) EXPECT_HMIRESPONSE(RequestId, {result = { code = 0, - device = { id = config.deviceMAC, name = ServerAddress }, + device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() }, isAppPermissionsRevoked = false, isAppRevoked = false, isSDLAllowed = false, isPermissionsConsentNeeded = false, method ="SDL.ActivateApp"}}) :Do(function(_,data) --Consent for device is needed @@ -68,7 +62,7 @@ function Test:ActivateApp_on_unconsented_device() :Do(function() --Press "NO"on data consent self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = false, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress}}) + {allowed = false, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_NOTIFICATION("OnPermissionsChange", {}):Times(0) end) diff --git a/test_scripts/Policies/user_consent_of_Policies/208_ATF_No_consent_for_default_policies.lua b/test_scripts/Policies/user_consent_of_Policies/208_ATF_No_consent_for_default_policies.lua index ab252b6a57..f4590ff092 100644 --- a/test_scripts/Policies/user_consent_of_Policies/208_ATF_No_consent_for_default_policies.lua +++ b/test_scripts/Policies/user_consent_of_Policies/208_ATF_No_consent_for_default_policies.lua @@ -17,13 +17,11 @@ -- Expected result: -- PoliciesManager must not ask the User for consent for "default" permissions --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -35,7 +33,7 @@ local mobile_session = require('mobile_session') --[[ Precondition ]] function Test:Precondition_ActivateRegisteredApp() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_AddSession2() diff --git a/test_scripts/Policies/user_consent_of_Policies/209_ATF_Device_user_disallowed_after_consent.lua b/test_scripts/Policies/user_consent_of_Policies/209_ATF_Device_user_disallowed_after_consent.lua index 7bc6d63a8e..b98a5dc198 100644 --- a/test_scripts/Policies/user_consent_of_Policies/209_ATF_Device_user_disallowed_after_consent.lua +++ b/test_scripts/Policies/user_consent_of_Policies/209_ATF_Device_user_disallowed_after_consent.lua @@ -19,13 +19,11 @@ -- App must be rolled back to default group -- RPC from defult should be allowed --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require("user_modules/shared_testcases/commonFunctions") local commonSteps = require("user_modules/shared_testcases/commonSteps") local testCasesForPolicyTable = require("user_modules/shared_testcases/testCasesForPolicyTable") +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -40,7 +38,7 @@ require("user_modules/AppTypes") --[[ Precondition ]] function Test:Precondition_ActivateRegisteredApp() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_Check_App_assigned_BASE4() @@ -57,7 +55,7 @@ end function Test:Precondition_Disallow_device() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = false, source = "GUI", device = {id = config.deviceMAC , name = "127.0.0.1"}}) + {allowed = false, source = "GUI", device = {id = utils.getDeviceMAC() , name = utils.getDeviceName()}}) end --[[ Test ]] @@ -93,7 +91,7 @@ function Test:ActivateApp() local requestId2 = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", { language = "EN-US", messageCodes = { "DataConsent" } }) EXPECT_HMIRESPONSE(requestId2) :Do(function(_, _) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, data2) self.hmiConnection:SendResponse(data2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) diff --git a/test_scripts/Policies/user_consent_of_Policies/210_ATF_User_consent_initing_after_PTU_FULL.lua b/test_scripts/Policies/user_consent_of_Policies/210_ATF_User_consent_initing_after_PTU_FULL.lua index f4d89d28f4..0b10479d1a 100644 --- a/test_scripts/Policies/user_consent_of_Policies/210_ATF_User_consent_initing_after_PTU_FULL.lua +++ b/test_scripts/Policies/user_consent_of_Policies/210_ATF_User_consent_initing_after_PTU_FULL.lua @@ -13,13 +13,11 @@ -- Policies Manager must notify HMI about 'user-consent-required' via SDL.OnAppPermissionChanged{appID, appPermissionsConsentNeeded: true} per application in FULL, -- that lacks the User`s permissions right after Policies Manager detects the user-unconsented permissions in Local PT --------------------------------------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Preconditions ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -30,7 +28,7 @@ require('cardinalities') require('user_modules/AppTypes') function Test:Precondition_Activate_app() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -78,4 +76,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/user_consent_of_Policies/211_ATF_User_consent_initing_after_PTU_LIMITED.lua b/test_scripts/Policies/user_consent_of_Policies/211_ATF_User_consent_initing_after_PTU_LIMITED.lua index fe9688dd80..014d9165dc 100644 --- a/test_scripts/Policies/user_consent_of_Policies/211_ATF_User_consent_initing_after_PTU_LIMITED.lua +++ b/test_scripts/Policies/user_consent_of_Policies/211_ATF_User_consent_initing_after_PTU_LIMITED.lua @@ -15,13 +15,11 @@ -- Policies Manager must notify HMI about 'user-consent-required' via SDL.OnAppPermissionChanged{appID, appPermissionsConsentNeeded: true} per application in FULL, -- that lacks the User`s permissions right after Policies Manager detects the user-unconsented permissions in Local PT --------------------------------------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Preconditions ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -33,7 +31,7 @@ require('user_modules/AppTypes') function Test:Precondition_Activate_app() config.application1.registerAppInterfaceParams.isMediaApplication = true - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end function Test:Precondition_Switch_app_to_LIMITED() @@ -86,4 +84,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/user_consent_of_Policies/212_ATF_Data_consent_device_not_in_LPT.lua b/test_scripts/Policies/user_consent_of_Policies/212_ATF_Data_consent_device_not_in_LPT.lua index da6fd7bbc6..074b4629a4 100644 --- a/test_scripts/Policies/user_consent_of_Policies/212_ATF_Data_consent_device_not_in_LPT.lua +++ b/test_scripts/Policies/user_consent_of_Policies/212_ATF_Data_consent_device_not_in_LPT.lua @@ -14,14 +14,11 @@ -- Expected result: -- PoliciesManager must initiate getting User`s data consent (that is, User`s permission for using the mobile device`s connection for Policy Table exchange) ---------------------------------------------------------------------------------------------------- - ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Preconditions ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -36,9 +33,8 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Test") function Test:Check_user_data_consent_is_requested() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) - EXPECT_HMIRESPONSE(RequestId, {result = { code = 0, device = { id = config.deviceMAC, name = ServerAddress }, isSDLAllowed = false, isPermissionsConsentNeeded = false, method ="SDL.ActivateApp"}}) + EXPECT_HMIRESPONSE(RequestId, {result = { code = 0, device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() }, isSDLAllowed = false, isPermissionsConsentNeeded = false, method ="SDL.ActivateApp"}}) :Do(function(_,data) if data.result.isSDLAllowed ~= false then commonFunctions:userPrint(31, "Error: wrong behavior of SDL - device not from LPT, should be consented on HMI") @@ -47,7 +43,7 @@ function Test:Check_user_data_consent_is_requested() EXPECT_HMIRESPONSE(RequestIdGetMes) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) end) end end) diff --git a/test_scripts/Policies/user_consent_of_Policies/213_ATF_No_user_consent_prompt_in_group.lua b/test_scripts/Policies/user_consent_of_Policies/213_ATF_No_user_consent_prompt_in_group.lua index 93b010162e..2334e60bee 100644 --- a/test_scripts/Policies/user_consent_of_Policies/213_ATF_No_user_consent_prompt_in_group.lua +++ b/test_scripts/Policies/user_consent_of_Policies/213_ATF_No_user_consent_prompt_in_group.lua @@ -19,9 +19,7 @@ -- Expected result: -- PoliciesManager must apply such without asking User`s consent for it --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] @@ -29,6 +27,7 @@ local commonFunctions = require ('user_modules/shared_testcases/commonFunctions' local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -42,7 +41,6 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Test") function Test:TestStep1_PTU_lack_of_user_consent_prompt() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) --Allow SDL functionality @@ -53,7 +51,7 @@ function Test:TestStep1_PTU_lack_of_user_consent_prompt() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) end @@ -65,7 +63,7 @@ function Test:TestStep1_PTU_lack_of_user_consent_prompt() end function Test:TestStep_app_no_consent() - local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID) + local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID) if(app_permission ~= nil) then self:FailTestCase("Consented gropus are assigned to application") end diff --git a/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua b/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua index 0e03ec8d9e..36e6191109 100644 --- a/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua +++ b/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua @@ -20,7 +20,6 @@ -- PoliciesManager must apply only after the User has consented it -> RPC should be allowed --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] @@ -29,6 +28,7 @@ local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[ Local variables ]] local allowed_rps = {} @@ -148,7 +148,6 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Preconditions") function Test:Precondition_IsPermissionsConsentNeeded_false_on_app_activation() Get_RPCs() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) --Allow SDL functionality @@ -159,7 +158,7 @@ function Test:Precondition_IsPermissionsConsentNeeded_false_on_app_activation() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) end @@ -176,7 +175,7 @@ function Test:Precondition_IsPermissionsConsentNeeded_false_on_app_activation() EXPECT_HMICALL("BasicCommunication.PolicyUpdate", {file = "/tmp/fs/mp/images/ivsu_cache/sdl_snapshot.json"}) :Do(function() - local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID) + local app_permission = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID) if(app_permission ~= nil) then self:FailTestCase("Consented gropus are assigned to application") end @@ -297,8 +296,8 @@ function Test:Precondition_PTU_user_consent_prompt_present() function Test.TestStep_verify_PermissionConsent() local is_test_passed = true - local app_permission_Location = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Location-1") - local app_permission_Notifications = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Notifications") + local app_permission_Location = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Location-1") + local app_permission_Notifications = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Notifications") if(app_permission_Location ~= nil) then commonFunctions:printError("Location-1 is assigned user_consent_records") is_test_passed = false diff --git a/test_scripts/Policies/user_consent_of_Policies/215_ATF_User_clears_all_applications.lua b/test_scripts/Policies/user_consent_of_Policies/215_ATF_User_clears_all_applications.lua index 473dcd4981..b8ccfac9a5 100644 --- a/test_scripts/Policies/user_consent_of_Policies/215_ATF_User_clears_all_applications.lua +++ b/test_scripts/Policies/user_consent_of_Policies/215_ATF_User_clears_all_applications.lua @@ -20,14 +20,12 @@ -- SDL->HMI: BC.UpdateDeviceList(device1, device2) -- HMI->SDL: BC.UpdateDeviceList(SUCCESS) -------------------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -47,7 +45,6 @@ local mobile = require('mobile_connection') local events = require('events') --[[ Local variables ]] -local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local deviceMAC2 = "54286cb92365be544aa7008b92854b9648072cf8d8b17b372fd0786bef69d7a2" local mobileHost = "1.0.0.1" @@ -61,8 +58,8 @@ function Test:Precondition_Connect_device1() { deviceList = { { - id = config.deviceMAC, - name = ServerAddress, + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false } @@ -131,8 +128,8 @@ function Test:TestStep_Check_two_devices_visible_on_device2_connect() { deviceList = { { - id = config.deviceMAC, - name = ServerAddress, + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false }, diff --git a/test_scripts/Policies/user_consent_of_Policies/216_ATF_User_consent_storage_in_LPT.lua b/test_scripts/Policies/user_consent_of_Policies/216_ATF_User_consent_storage_in_LPT.lua index a6a43b7391..aeca9ac0a4 100644 --- a/test_scripts/Policies/user_consent_of_Policies/216_ATF_User_consent_storage_in_LPT.lua +++ b/test_scripts/Policies/user_consent_of_Policies/216_ATF_User_consent_storage_in_LPT.lua @@ -27,13 +27,11 @@ -- PoliciesManager records the consent-related information in "device" subsection of "user_consent_records" subsection -- of "" section of "device_data" section in Local PT. --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -47,15 +45,14 @@ require('user_modules/AppTypes') commonFunctions:newTestCasesGroup("Test") function Test:TestStep1_Device_consent_on_activate_app() - local ServerAddress = commonFunctions:read_parameter_from_smart_device_link_ini("ServerAddress") local RequestIdActivate = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[config.application1.registerAppInterfaceParams.appName]}) - EXPECT_HMIRESPONSE(RequestIdActivate, {result = { code = 0, device = { id = config.deviceMAC, name = ServerAddress }, isSDLAllowed = false, method ="SDL.ActivateApp"}}) + EXPECT_HMIRESPONSE(RequestIdActivate, {result = { code = 0, device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() }, isSDLAllowed = false, method ="SDL.ActivateApp"}}) :Do(function() local RequestIdGetMes = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetMes, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = ServerAddress, isSDLAllowed = true }}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true }}) end) end) EXPECT_HMICALL("BasicCommunication.ActivateApp") @@ -66,7 +63,7 @@ end function Test:TestStep2_check_LocalPT_for_consent_storage() local test_fail = false - local data_consent = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records.device.consent_groups.DataConsent-2") + local data_consent = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records.device.consent_groups.DataConsent-2") print("data_consent = " ..tostring(data_consent)) if(data_consent ~= true) then @@ -84,4 +81,4 @@ function Test.Postcondition_StopSDL() StopSDL() end -return Test \ No newline at end of file +return Test diff --git a/test_scripts/Policies/user_consent_of_Policies/217_ATF_Consent_status_allowed_on_device_connect.lua b/test_scripts/Policies/user_consent_of_Policies/217_ATF_Consent_status_allowed_on_device_connect.lua index 6a53c385fe..721b04f2d7 100644 --- a/test_scripts/Policies/user_consent_of_Policies/217_ATF_Consent_status_allowed_on_device_connect.lua +++ b/test_scripts/Policies/user_consent_of_Policies/217_ATF_Consent_status_allowed_on_device_connect.lua @@ -14,14 +14,12 @@ -- SDL/PoliciesManager must provide the device`s DataConsent status (allowed) to HMI upon device`s connection-> -- SDL must request DataConsent status of the corresponding device from the PoliciesManager ------------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonFunctions:SDLForceStop() @@ -69,9 +67,9 @@ function Test:Check_device_connects_as_consented() { deviceList = { { - id = config.deviceMAC, + id = utils.getDeviceMAC(), isSDLAllowed = true, - name = "127.0.0.1", + name = utils.getDeviceName(), transportType = "WIFI" } } diff --git a/test_scripts/Policies/user_consent_of_Policies/218_ATF_Consent_status_not_allowed_on_device_connect.lua b/test_scripts/Policies/user_consent_of_Policies/218_ATF_Consent_status_not_allowed_on_device_connect.lua index 2702768086..4e52cc5183 100644 --- a/test_scripts/Policies/user_consent_of_Policies/218_ATF_Consent_status_not_allowed_on_device_connect.lua +++ b/test_scripts/Policies/user_consent_of_Policies/218_ATF_Consent_status_not_allowed_on_device_connect.lua @@ -7,28 +7,26 @@ -- 1. Used preconditions: -- Delete files and policy table from previous ignition cycle if any -- 2. Performed steps: --- Connect device +-- Connect device -- -- Expected result: -- SDL/PoliciesManager must provide the device`s DataConsent status (not allowed) to HMI upon device`s connection-> --- SDL must request DataConsent status of the corresponding device from the PoliciesManager +-- SDL must request DataConsent status of the corresponding device from the PoliciesManager ------------------------------------------------------------------------------------------------- --[[ General Settings for configuration ]] Test = require('user_modules/connecttest_resumption') require('cardinalities') ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') require('user_modules/AppTypes') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() -commonSteps:DeletePolicyTable() +commonSteps:DeletePolicyTable() --[[ Test ]] commonFunctions:newTestCasesGroup("Test") @@ -39,9 +37,9 @@ function Test:Check_device_connects_as_not_consented() { deviceList = { { - id = config.deviceMAC, + id = utils.getDeviceMAC(), isSDLAllowed = false, - name = "127.0.0.1", + name = utils.getDeviceName(), transportType = "WIFI" } } diff --git a/test_scripts/Policies/user_consent_of_Policies/219_ATF_Device_identifier_creation_upon_connect_no_apps.lua b/test_scripts/Policies/user_consent_of_Policies/219_ATF_Device_identifier_creation_upon_connect_no_apps.lua index 5dae8a13e4..7f548314f9 100644 --- a/test_scripts/Policies/user_consent_of_Policies/219_ATF_Device_identifier_creation_upon_connect_no_apps.lua +++ b/test_scripts/Policies/user_consent_of_Policies/219_ATF_Device_identifier_creation_upon_connect_no_apps.lua @@ -13,13 +13,11 @@ -- Expected result: -- SDL must add new device in deviceList of BasicCommunication.UpdateDeviceList --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() @@ -41,8 +39,8 @@ function Test:Test_Connect_device() { deviceList = { { - id = config.deviceMAC, - name = "127.0.0.1", + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false } diff --git a/test_scripts/Policies/user_consent_of_Policies/220_ATF_Device_identifier_creation_upon_connect_with_apps.lua b/test_scripts/Policies/user_consent_of_Policies/220_ATF_Device_identifier_creation_upon_connect_with_apps.lua index d93529a973..be39413a58 100644 --- a/test_scripts/Policies/user_consent_of_Policies/220_ATF_Device_identifier_creation_upon_connect_with_apps.lua +++ b/test_scripts/Policies/user_consent_of_Policies/220_ATF_Device_identifier_creation_upon_connect_with_apps.lua @@ -15,15 +15,13 @@ -- Expected result: -- SDL must add new section in "device_data" section --------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" - --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local mobile_session = require('mobile_session') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') +local utils = require ('user_modules/utils') --[[ Local variables ]] local pts_json = '/tmp/fs/mp/images/ivsu_cache/sdl_snapshot.json' @@ -47,8 +45,8 @@ function Test:Precondition_Connect_device() { deviceList = { { - id = config.deviceMAC, - name = "127.0.0.1", + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false } @@ -72,8 +70,8 @@ function Test:Precondition_Register_app() { deviceInfo = { - name = "127.0.0.1", - id = config.deviceMAC, + name = utils.getDeviceName(), + id = utils.getDeviceMAC(), transportType = "WIFI" } } @@ -87,7 +85,7 @@ function Test:Precondition_Register_app() end function Test:Precondition_TriggerGettingDeviceConsent() - testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, config.deviceMAC) + testCasesForPolicyTable:trigger_getting_device_consent(self, config.application1.registerAppInterfaceParams.appName, utils.getDeviceMAC()) end --[[ Test ]] @@ -103,7 +101,7 @@ function Test:Check_device_identifier_added_to_lpt() local data = json.decode(json_data) local deviceIdentificatorInPTS = next(data.policy_table.device_data, nil) - if (deviceIdentificatorInPTS == config.deviceMAC) then + if (deviceIdentificatorInPTS == utils.getDeviceMAC()) then commonFunctions:userPrint(33, "device_identifier ".. deviceIdentificatorInPTS.. " section is created") else self:FailTestCase("Test is FAILED. device_identifier section is not created.") diff --git a/test_scripts/Policies/user_consent_of_Policies/221_ATF_Factory_reset.lua b/test_scripts/Policies/user_consent_of_Policies/221_ATF_Factory_reset.lua index b3d914a8c4..d15a18a7c2 100644 --- a/test_scripts/Policies/user_consent_of_Policies/221_ATF_Factory_reset.lua +++ b/test_scripts/Policies/user_consent_of_Policies/221_ATF_Factory_reset.lua @@ -14,10 +14,7 @@ -- Expected result: -- Policy Manager must clear all user consent records in "user_consent_records" section of the LocalPT, other content of the LocalPT must be unchanged --------------------------------------------------------------------------------------------------------------------------------------------------------- ---[[ General Settings for configuration ]] - --[[ General configuration parameters ]] -config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" config.defaultProtocolVersion = 2 config.ExitOnCrash = false @@ -28,6 +25,7 @@ local testCasesForPolicyTableSnapshot = require ('user_modules/shared_testcases/ local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable') local mobile_session = require('mobile_session') local sdl = require('SDL') +local utils = require ('user_modules/utils') --[[ Local Functions ]] @@ -94,7 +92,7 @@ function Test:Precondition_Activate_app_To_Trigger_PTU() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1", isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) local request_id_list_of_permissions = self.hmiConnection:SendRequest("SDL.GetListOfPermissions", { appID = self.applications[config.application1.registerAppInterfaceParams.appName] }) EXPECT_HMIRESPONSE(request_id_list_of_permissions) @@ -194,7 +192,7 @@ function Test:Precondition_Activate_app_To_Trigger_PTU_after_reset() EXPECT_HMIRESPONSE( RequestId1, {result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1", isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName(), isSDLAllowed = true}}) end) end) @@ -219,8 +217,8 @@ function Test:Check_no_user_consent_records_in_PT() self:FailTestCase(config.pathToSDL .."sdl_preloaded_pt.json ".."is not created") else testCasesForPolicyTableSnapshot:extract_pts({self.applications[config.application1.registerAppInterfaceParams.appName]}) - local app_consent_location = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Location-1") - local app_consent_notifications = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..config.deviceMAC..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Notifications") + local app_consent_location = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Location-1") + local app_consent_notifications = testCasesForPolicyTableSnapshot:get_data_from_PTS("device_data."..utils.getDeviceMAC()..".user_consent_records."..config.application1.registerAppInterfaceParams.appID..".consent_groups.Notifications") if(app_consent_location == true) then commonFunctions:printError("Error: user_consent_records.consent_groups.Location was not reset in LPT") diff --git a/test_scripts/Policies/user_consent_of_Policies/222_ATF_Device_HashID_In_LPT.lua b/test_scripts/Policies/user_consent_of_Policies/222_ATF_Device_HashID_In_LPT.lua index 0b84dbe053..108facba61 100644 --- a/test_scripts/Policies/user_consent_of_Policies/222_ATF_Device_HashID_In_LPT.lua +++ b/test_scripts/Policies/user_consent_of_Policies/222_ATF_Device_HashID_In_LPT.lua @@ -6,14 +6,13 @@ -- Before storing the number in the policy table, Policy manager must hash the number using SHA-256. SDL must store the hashed device identifier -- (BTMAC for Bluetoth connection or Serial number of USB connected device) in section of Local Policy Table -- 1. Used preconditions: --- a) Start SDL, HMI and register app via Wifi (MAC address - 127.0.0.1) +-- a) Start SDL, HMI and register app via Wifi -- 2. Performed steps -- a) Initiate PTU to verify device hash in policy shapshot -- -- Expected result: -- a) Hash of device is present in snapshot --------------------------------------------------------------------------------------------- - --[[ General configuration parameters ]] --ToDo: shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 @@ -21,6 +20,7 @@ config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require ('user_modules/shared_testcases/commonSteps') +local utils = require ('user_modules/utils') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFiles() @@ -52,8 +52,8 @@ function Test:Precondition_Get_List_Of_Connected_Devices() { deviceList = { { - - name = "127.0.0.1", + id = utils.getDeviceMAC(), + name = utils.getDeviceName(), transportType = "WIFI", isSDLAllowed = false } @@ -74,7 +74,7 @@ function Test:Initiate_PTU_And_Check_DeviceHashId_In_PTS() local RequestIdGetUserFriendlyMessage = self.hmiConnection:SendRequest("SDL.GetUserFriendlyMessage", {language = "EN-US", messageCodes = {"DataConsent"}}) EXPECT_HMIRESPONSE(RequestIdGetUserFriendlyMessage,{result = {code = 0, method = "SDL.GetUserFriendlyMessage"}}) :Do(function(_,_) - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = MACHash, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = MACHash, name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data1) self.hmiConnection:SendResponse(data1.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/user_modules/common_steps.lua b/user_modules/common_steps.lua index 7de684aba9..461aaa0d79 100644 --- a/user_modules/common_steps.lua +++ b/user_modules/common_steps.lua @@ -1,3 +1,4 @@ +local utils = require ('user_modules/utils') -------------------------------------------------------------------------------- -- This scripts contains common steps(Tests) that are used often in many scripts --[[ Note: functions in this script are designed based on bellow data structure of mobile connection, sessions, applications, application's parameter and HMI app ID @@ -197,7 +198,7 @@ function CommonSteps:ActivateApplication(test_case_name, app_name, expected_leve -- if application is disallowed, HMI has to send SDL.OnAllowSDLFunctionality notification to allow before activation -- If isSDLAllowed is false, consent for sending policy table through specified device is required. if data.result.isSDLAllowed ~= true then - self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data) self.hmiConnection:SendResponse(data.id,"BasicCommunication.ActivateApp", "SUCCESS", {}) diff --git a/user_modules/shared_testcases/commonSteps.lua b/user_modules/shared_testcases/commonSteps.lua index f1373b21fe..78294caaff 100644 --- a/user_modules/shared_testcases/commonSteps.lua +++ b/user_modules/shared_testcases/commonSteps.lua @@ -24,6 +24,7 @@ local commonSteps = {} local mobile_session = require('mobile_session') local config = require('config') local SDLConfig = require('user_modules/shared_testcases/SmartDeviceLinkConfigurations') +local utils = require ('user_modules/utils') --------------------------------------------------------------------------------------------- @@ -548,7 +549,7 @@ function commonSteps:ActivateAppInSpecificLevel(test, HMIAppID) :Do(function(_,_) --hmi side: send request SDL.OnAllowSDLFunctionality test.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = config.deviceMAC, name = "127.0.0.1"}}) + {allowed = true, source = "GUI", device = {id = utils.getDeviceMAC(), name = utils.getDeviceName()}}) --hmi side: expect BasicCommunication.ActivateApp request EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_,data2) @@ -560,4 +561,4 @@ function commonSteps:ActivateAppInSpecificLevel(test, HMIAppID) end) end -return commonSteps \ No newline at end of file +return commonSteps diff --git a/user_modules/shared_testcases/testCasesForExternalUCS.lua b/user_modules/shared_testcases/testCasesForExternalUCS.lua index 19fc3c1f01..0b79e8e557 100644 --- a/user_modules/shared_testcases/testCasesForExternalUCS.lua +++ b/user_modules/shared_testcases/testCasesForExternalUCS.lua @@ -8,13 +8,14 @@ local commonPreconditions = require('user_modules/shared_testcases/commonPrecond local commonFunctions = require('user_modules/shared_testcases/commonFunctions') local json = require("modules/json") local sdl = require('SDL') +local utils = require ('user_modules/utils') -local utils = { } +local m = { } -- [[ Variables ]] - utils.HMIAppIds = { } - utils.pts = nil + m.HMIAppIds = { } + m.pts = nil -- [[ Functions ]] @@ -22,7 +23,7 @@ local utils = { } --! @parameters: --! file - input file --]] - function utils.createTableFromJsonFile(file) + function m.createTableFromJsonFile(file) local f = io.open(file, "r") local content = f:read("*all") f:close() @@ -34,7 +35,7 @@ local utils = { } --! table - input table --! file - output file --]] - function utils.createJsonFileFromTable(table, file) + function m.createJsonFileFromTable(table, file) local f = io.open(file, "w") f:write(json.encode(table)) f:close() @@ -44,7 +45,7 @@ local utils = { } --! @parameters: --! expStatus - expected status of SDL (0 - STOPPED, 1 - RUNNING) --]] - function utils.checkSDLStatus(test, expStatus) + function m.checkSDLStatus(test, expStatus) local actStatus = sdl:CheckStatusSDL() print("SDL status: " .. tostring(actStatus)) if actStatus ~= expStatus then @@ -56,7 +57,7 @@ local utils = { } --[[@removeLPT: Delete Local Policy Table --! @parameters: NO --]] - function utils.removeLPT() + function m.removeLPT() local data = { "AppStorageFolder", "AppInfoStorage" } for _, v in pairs(data) do os.execute("rm -rf " .. commonPreconditions:GetPathToSDL() @@ -67,7 +68,7 @@ local utils = { } --[[@removePTS: Delete Policy Table Snapshot --! @parameters: NO --]] - function utils.removePTS() + function m.removePTS() local filePath = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" .. commonFunctions:read_parameter_from_smart_device_link_ini("PathToSnapshot") os.execute("rm -rf " .. filePath) @@ -78,19 +79,19 @@ local utils = { } --]] local function updatePTU() local appId = config.application1.registerAppInterfaceParams.appID - utils.pts.policy_table.consumer_friendly_messages.messages = nil - utils.pts.policy_table.device_data = nil - utils.pts.policy_table.module_meta = nil - utils.pts.policy_table.usage_and_error_counts = nil - utils.pts.policy_table.app_policies[appId] = { + m.pts.policy_table.consumer_friendly_messages.messages = nil + m.pts.policy_table.device_data = nil + m.pts.policy_table.module_meta = nil + m.pts.policy_table.usage_and_error_counts = nil + m.pts.policy_table.app_policies[appId] = { keep_context = false, steal_focus = false, priority = "NONE", default_hmi = "NONE" } - utils.pts.policy_table.app_policies[appId]["groups"] = { "Base-4", "Base-6" } - utils.pts.policy_table.functional_groupings["DataConsent-2"].rpcs = json.null - utils.pts.policy_table.module_config.preloaded_pt = nil + m.pts.policy_table.app_policies[appId]["groups"] = { "Base-4", "Base-6" } + m.pts.policy_table.functional_groupings["DataConsent-2"].rpcs = json.null + m.pts.policy_table.module_config.preloaded_pt = nil end --[[@ptu: Perform Policy Table Update process @@ -106,7 +107,7 @@ local utils = { } :Do(function() test.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = policy_file_name }) - utils.createJsonFileFromTable(utils.pts, ptu_file_name) + m.createJsonFileFromTable(m.pts, ptu_file_name) EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", { status = "UPDATING" }, { status = status }):Times(2) test.mobileSession1:ExpectNotification("OnSystemRequest", { requestType = "PROPRIETARY" }) :Do(function() @@ -128,7 +129,7 @@ local utils = { } --! @parameters: --! id - session number (1, 2 etc.) (mandatory) --]] - function utils.startSession(test, id) + function m.startSession(test, id) test["mobileSession"..id] = mobile_session.MobileSession(test, test.mobileConnection) test["mobileSession"..id]:StartService(7) end @@ -137,13 +138,13 @@ local utils = { } --! @parameters: --! id - application number (1, 2 etc.), equals to session number (mandatory) --]] - function utils.registerApp(test, id) + function m.registerApp(test, id) local RAIParams = config["application"..id].registerAppInterfaceParams local corId = test["mobileSession"..id]:SendRPC("RegisterAppInterface", RAIParams) EXPECT_HMINOTIFICATION("BasicCommunication.OnAppRegistered", { application = { appName = RAIParams.appName } }) :Do(function(_, d) - utils.HMIAppIds[RAIParams.appID] = d.params.application.appID + m.HMIAppIds[RAIParams.appID] = d.params.application.appID end) test["mobileSession"..id]:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) :Do(function() @@ -163,9 +164,9 @@ local utils = { } --! updateFunc - function to update specific sections in PTU file --! that has to be passed as an input parameter --]] - function utils.activateApp(test, id, status, updateFunc) + function m.activateApp(test, id, status, updateFunc) local appId = config["application"..id].registerAppInterfaceParams.appID - local reqId = test.hmiConnection:SendRequest("SDL.ActivateApp", { appID = utils.HMIAppIds[appId] }) + local reqId = test.hmiConnection:SendRequest("SDL.ActivateApp", { appID = m.HMIAppIds[appId] }) EXPECT_HMIRESPONSE(reqId) :Do(function(_, d1) if d1.result.isSDLAllowed ~= true then @@ -174,7 +175,7 @@ local utils = { } EXPECT_HMIRESPONSE(reqId2) :Do(function() test.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - { allowed = true, source = "GUI", device = { id = config.deviceMAC, name = "127.0.0.1" } }) + { allowed = true, source = "GUI", device = { id = utils.getDeviceMAC(), name = utils.getDeviceName() } }) EXPECT_HMICALL("BasicCommunication.ActivateApp") :Do(function(_, d2) test.hmiConnection:SendResponse(d2.id,"BasicCommunication.ActivateApp", "SUCCESS", { }) @@ -187,12 +188,12 @@ local utils = { } EXPECT_HMICALL("BasicCommunication.PolicyUpdate") :Do(function(exp, d) if(exp.occurences == 1) then - utils.pts = utils.createTableFromJsonFile(d.params.file) + m.pts = m.createTableFromJsonFile(d.params.file) if status then test.hmiConnection:SendResponse(d.id, d.method, "SUCCESS", { }) updatePTU() if updateFunc then - updateFunc(utils.pts) + updateFunc(m.pts) end ptu(test, status) end @@ -207,20 +208,20 @@ local utils = { } --! updateFunc - function to update specific sections in PreloadedPT file --! that has to be passed as an input parameter --]] - function utils.updatePreloadedPT(updateFunc) + function m.updatePreloadedPT(updateFunc) local preloadedFile = commonPreconditions:GetPathToSDL() .. "sdl_preloaded_pt.json" - local preloadedTable = utils.createTableFromJsonFile(preloadedFile) + local preloadedTable = m.createTableFromJsonFile(preloadedFile) preloadedTable.policy_table.functional_groupings["DataConsent-2"].rpcs = json.null if updateFunc then updateFunc(preloadedTable) end - utils.createJsonFileFromTable(preloadedTable, preloadedFile) + m.createJsonFileFromTable(preloadedTable, preloadedFile) end --[[@ignitionOff: Perform Igninition Off --! @parameters: NO --]] - function utils.ignitionOff(test) + function m.ignitionOff(test) if sdl:CheckStatusSDL() == sdl.RUNNING then test.hmiConnection:SendNotification("BasicCommunication.OnExitAllApplications", { reason = "SUSPEND" }) EXPECT_HMINOTIFICATION("BasicCommunication.OnSDLPersistenceComplete") @@ -231,4 +232,4 @@ local utils = { } end end -return utils +return m diff --git a/user_modules/shared_testcases/testCasesForPolicyTable.lua b/user_modules/shared_testcases/testCasesForPolicyTable.lua index d963347be5..1d5c48822f 100644 --- a/user_modules/shared_testcases/testCasesForPolicyTable.lua +++ b/user_modules/shared_testcases/testCasesForPolicyTable.lua @@ -11,6 +11,7 @@ local commonPreconditions = require('user_modules/shared_testcases/commonPrecond local commonSteps = require('user_modules/shared_testcases/commonSteps') local testCasesForPolicyTableSnapshot = require('user_modules/shared_testcases/testCasesForPolicyTableSnapshot') local json = require('json') +local utils = require ('user_modules/utils') --Policy template local PolicyTableTemplate = "user_modules/shared_testcases/PolicyTables/DefaultPolicyTableWith_group1.json" @@ -897,7 +898,7 @@ end -- But this should be checked in appropriate scripts function testCasesForPolicyTable:flow_SUCCEESS_EXTERNAL_PROPRIETARY(self, app_id, device_id, hmi_app_id, ptu_file_path, ptu_file_name, ptu_file) if (app_id == nil) then app_id = config.application1.registerAppInterfaceParams.appID end - if (device_id == nil) then device_id = config.deviceMAC end + if (device_id == nil) then device_id = utils.getDeviceMAC() end if (hmi_app_id == nil) then hmi_app_id = self.applications[config.application1.registerAppInterfaceParams.appName] end if (ptu_file_path == nil) then ptu_file_path = "files/" end if (ptu_file_name == nil) then ptu_file_name = "PolicyTableUpdate" end @@ -966,7 +967,7 @@ function testCasesForPolicyTable:trigger_user_request_update_from_HMI(self) :Do(function(_,data) testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID }, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app1_id}) local timeout_after_x_seconds = testCasesForPolicyTableSnapshot:get_data_from_PTS("module_config.timeout_after_x_seconds") @@ -1001,7 +1002,6 @@ function testCasesForPolicyTable:trigger_getting_device_consent(self, app_name, testCasesForPolicyTable.time_trigger = 0 testCasesForPolicyTable.time_onstatusupdate = 0 testCasesForPolicyTable.time_policyupdate = 0 - local ServerAddress = "127.0.0.1"--commonSteps:get_data_from_SDL_ini("ServerAddress") local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications[app_name]}) @@ -1015,14 +1015,14 @@ function testCasesForPolicyTable:trigger_getting_device_consent(self, app_name, testCasesForPolicyTable.time_trigger = timestamp() self.hmiConnection:SendNotification("SDL.OnAllowSDLFunctionality", - {allowed = true, source = "GUI", device = {id = device_ID, name = ServerAddress, isSDLAllowed = true}}) + {allowed = true, source = "GUI", device = {id = device_ID, name = utils.getDeviceName(), isSDLAllowed = true}}) end) EXPECT_HMICALL("BasicCommunication.PolicyUpdate", {file = "/tmp/fs/mp/images/ivsu_cache/sdl_snapshot.json"}) :Do(function(_,data) testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID }, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app1_id}) local timeout_after_x_seconds = testCasesForPolicyTableSnapshot:get_data_from_PTS("module_config.timeout_after_x_seconds") @@ -1077,7 +1077,7 @@ function testCasesForPolicyTable:trigger_PTU_user_press_button_HMI(self, execute :Do(function(_,data) testCasesForPolicyTableSnapshot:verify_PTS(true, {config.application1.registerAppInterfaceParams.appID }, - {config.deviceMAC}, + {utils.getDeviceMAC()}, {hmi_app1_id}) local timeout_after_x_seconds = testCasesForPolicyTableSnapshot:get_data_from_PTS("module_config.timeout_after_x_seconds") From 3a90459e9061ff6db6c66b1c75287546be8cdfdf Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Mon, 19 Mar 2018 01:47:59 +0200 Subject: [PATCH 16/30] Update Policy scripts regarding URL changes in PreloadedPT --- .../Policies/build_options/ptu_18269.json | 3 +- .../003_ATF_HP_User_Consent_Yes.lua | 2 +- .../004_ATF_HP_User_Consent_NO.lua | 2 +- ...Id_policies_And_RequestType_Validation.lua | 2 +- ...6_ATF_Steal_focus_validation_false_PTU.lua | 2 +- ...007_ATF_StealFocus_validation_true_PTU.lua | 2 +- ...f_Failed_Nickname_Validation_After_PTU.lua | 2 +- .../029_ATF_OnPermissionsChange_After_PTU.lua | 2 +- ...41_ATF_Got_PTU_from_mobile_application.lua | 7 +--- .../144_ATF_PTU_validation_failure.lua | 1 - ...able_Update_Trigger_After_N_Kilometers.lua | 2 +- ...licy_Table_Update_Trigger_After_N_Days.lua | 2 +- ...anager_Changes_Status_To_UPDATE_NEEDED.lua | 3 +- .../156_ATF_PTU_OnStatusUpdate_Trigger.lua | 2 +- ...ies_Manager_Changes_Status_To_UPDATING.lua | 2 +- ...F_Default_Policy_For_The_App_After_PTU.lua | 2 +- ...egister_NewApp_not_exist_inLocalPT_PTU.lua | 4 +- ...r_NewApp_not_exist_inLocalPT_FinishPTU.lua | 6 +-- ...t_exist_inLocalPT_start_PTU_for_NewApp.lua | 8 ++-- ...vi_App_Registration_And_No_Certificate.lua | 2 +- ...TF_PTU_request_after_N_ignition_cycles.lua | 2 +- ...6_ATF_OnPolicyUpdate_initiation_of_PTU.lua | 2 +- ...ATF_Get_Status_Update_Request_from_HMI.lua | 2 +- ...ation_rules_request_type_array_omitted.lua | 2 +- ...quest_type_array_has_one_invalid_value.lua | 2 +- ...pe_array_has_only_one_value_is_invalid.lua | 2 +- ...oaded_pt_parameter_trigger_in_local_pt.lua | 2 +- ...idation_rules_optional_parameters_type.lua | 2 +- ...idation_rules_required_parameters_type.lua | 2 +- ...ATF_pt_update_validation_rules_general.lua | 2 +- ...dation_rules_consumer_friendly_message.lua | 2 +- ..._Validate_default_hmi_default_policies.lua | 2 +- ...e_preconsented_groups_default_policies.lua | 2 +- ...2_ATF_Validate_groups_default_policies.lua | 2 +- ...TF_Validate_default_hmi_appId_policies.lua | 2 +- ...278_ATF_Validate_groups_appID_policies.lua | 2 +- ...PT_Exchanged_X_Days_After_Epoch_In_PTS.lua | 2 +- ...Store_pt_exchanged_at_odometer_x_in_PT.lua | 2 +- ...ATF_Validate_appHMIType_appID_policies.lua | 2 +- ...299_ATF_Memory_Kb_Constraints_Ignoring.lua | 2 +- ...s_update_app_registration_language_vui.lua | 2 +- ...HP_Validation_Count_Of_User_Selections.lua | 2 +- ...nt_of_run_attempts_while_revoked_in_PT.lua | 4 +- ..._Status_Appid_Gets_Null_In_Case_Of_PTU.lua | 2 +- ...MI_Status_Value_Of_AppId_In_PT_Is_Null.lua | 2 +- ...eivedPolicyUpdate_from_HMI_PROPRIETARY.lua | 10 ++++- ...nd_GetURLs_Request_fromHMI_PROPRIETARY.lua | 2 +- ...gh_The_URLs_During_Retry_Sequence_HTTP.lua | 13 ++++-- .../108_ATF_PTU_Trigger_days_PROPRIETARY.lua | 10 ++++- ...ATF_PTU_Trigger_kilometers_PROPRIETARY.lua | 2 +- ...temRequest_from_app_to_HMI_PROPRIETARY.lua | 10 ++++- ..._exist_inLocalPT_FinishPTU_PROPRIETARY.lua | 13 +++++- ...calPT_start_PTU_for_NewApp_PROPRIETARY.lua | 14 +++++-- ..._ATF_HP_Device_Data_Section_Validation.lua | 40 +++++++++++++------ .../189_ATF_isAppPermissionsRevoked_true.lua | 4 +- ...9_ATF_appPermissionsConsentNeeded_true.lua | 2 +- ...TF_User_consent_initing_after_PTU_FULL.lua | 2 +- ...User_consent_initing_after_PTU_LIMITED.lua | 2 +- .../214_ATF_User_consent_prompt_persists.lua | 2 +- .../shared_testcases/commonFunctions.lua | 16 ++++++++ .../testCasesForPolicyAppIdManagament.lua | 12 +----- .../testCasesForPolicyTable.lua | 4 +- ...cies_External_Consent_common_functions.lua | 2 +- 63 files changed, 164 insertions(+), 106 deletions(-) diff --git a/files/jsons/Policies/build_options/ptu_18269.json b/files/jsons/Policies/build_options/ptu_18269.json index 297744e375..5bfb400162 100644 --- a/files/jsons/Policies/build_options/ptu_18269.json +++ b/files/jsons/Policies/build_options/ptu_18269.json @@ -1239,8 +1239,7 @@ "0000001": [ "http://policies.domain1.ford.com/api/policies", "http://policies.domain2.ford.com/api/policies", - "http://policies.domain3.ford.com/api/policies", - "http://policies.domain4.ford.com/api/policies" + "http://policies.domain3.ford.com/api/policies" ] }, "lock_screen_icon_url": { diff --git a/test_scripts/Policies/App_Permissions/003_ATF_HP_User_Consent_Yes.lua b/test_scripts/Policies/App_Permissions/003_ATF_HP_User_Consent_Yes.lua index 5d580e18e5..3fa5923832 100644 --- a/test_scripts/Policies/App_Permissions/003_ATF_HP_User_Consent_Yes.lua +++ b/test_scripts/Policies/App_Permissions/003_ATF_HP_User_Consent_Yes.lua @@ -169,7 +169,7 @@ end function Test:Precondition_UpdatePolicyWithPTU() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/App_Permissions/004_ATF_HP_User_Consent_NO.lua b/test_scripts/Policies/App_Permissions/004_ATF_HP_User_Consent_NO.lua index fa0f3d3e8b..19e34c905c 100644 --- a/test_scripts/Policies/App_Permissions/004_ATF_HP_User_Consent_NO.lua +++ b/test_scripts/Policies/App_Permissions/004_ATF_HP_User_Consent_NO.lua @@ -143,7 +143,7 @@ end function Test:Precondition_UpdatePolicyWithPTU() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/App_Permissions/005_ATF_DISALLOWED_app_Id_policies_And_RequestType_Validation.lua b/test_scripts/Policies/App_Permissions/005_ATF_DISALLOWED_app_Id_policies_And_RequestType_Validation.lua index d2e9ae04a4..9447bd7ed8 100644 --- a/test_scripts/Policies/App_Permissions/005_ATF_DISALLOWED_app_Id_policies_And_RequestType_Validation.lua +++ b/test_scripts/Policies/App_Permissions/005_ATF_DISALLOWED_app_Id_policies_And_RequestType_Validation.lua @@ -128,7 +128,7 @@ end function Test:Preconditions_Update_Policy_With_RequestType_PROPRIETARY_For_Current_App() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/App_Permissions/006_ATF_Steal_focus_validation_false_PTU.lua b/test_scripts/Policies/App_Permissions/006_ATF_Steal_focus_validation_false_PTU.lua index 02c69778dd..ebd40e44e3 100644 --- a/test_scripts/Policies/App_Permissions/006_ATF_Steal_focus_validation_false_PTU.lua +++ b/test_scripts/Policies/App_Permissions/006_ATF_Steal_focus_validation_false_PTU.lua @@ -88,7 +88,7 @@ end function Test:Preconditions_Update_Policy_With_Steal_Focus_FalseValue_for_Current_App() EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", { status = "UPDATING" }, { status = "UP_TO_DATE" }):Times(2) local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua b/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua index dfb9da6d3c..42929dfb84 100644 --- a/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua +++ b/test_scripts/Policies/App_Permissions/007_ATF_StealFocus_validation_true_PTU.lua @@ -95,7 +95,7 @@ function Test:Preconditions_Update_Policy_With_Steal_Focus_FalseValue_for_Curren .. commonFunctions:read_parameter_from_smart_device_link_ini("PathToSnapshot") EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", { status = "UPDATING" }, { status = "UP_TO_DATE" }):Times(2) local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", diff --git a/test_scripts/Policies/App_Permissions/024_ATF_APP_UNAUTHORIZED_If_Failed_Nickname_Validation_After_PTU.lua b/test_scripts/Policies/App_Permissions/024_ATF_APP_UNAUTHORIZED_If_Failed_Nickname_Validation_After_PTU.lua index 1029fb2743..989c480755 100644 --- a/test_scripts/Policies/App_Permissions/024_ATF_APP_UNAUTHORIZED_If_Failed_Nickname_Validation_After_PTU.lua +++ b/test_scripts/Policies/App_Permissions/024_ATF_APP_UNAUTHORIZED_If_Failed_Nickname_Validation_After_PTU.lua @@ -172,7 +172,7 @@ function Test:TestStep_Update_PT_With_Another_NickName_For_Current_App_And_Check EXPECT_HMICALL("BasicCommunication.PolicyUpdate") :Do(function(_,_) local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{requestType = "PROPRIETARY", fileName = "filename"}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) diff --git a/test_scripts/Policies/App_Permissions/029_ATF_OnPermissionsChange_After_PTU.lua b/test_scripts/Policies/App_Permissions/029_ATF_OnPermissionsChange_After_PTU.lua index 63620cb798..87131ee106 100644 --- a/test_scripts/Policies/App_Permissions/029_ATF_OnPermissionsChange_After_PTU.lua +++ b/test_scripts/Policies/App_Permissions/029_ATF_OnPermissionsChange_After_PTU.lua @@ -66,7 +66,7 @@ end function Test:TestStep_Update_Policy_With_New_Permissions_And_Check_Them_In_OnPermissionsChange() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Policy_Table_Update/141_ATF_Got_PTU_from_mobile_application.lua b/test_scripts/Policies/Policy_Table_Update/141_ATF_Got_PTU_from_mobile_application.lua index 1ff4926e20..55064a78d9 100644 --- a/test_scripts/Policies/Policy_Table_Update/141_ATF_Got_PTU_from_mobile_application.lua +++ b/test_scripts/Policies/Policy_Table_Update/141_ATF_Got_PTU_from_mobile_application.lua @@ -70,13 +70,8 @@ function Test:TestStep_Sending_PTS_to_mobile_application() local RequestId_GetUrls = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) EXPECT_HMIRESPONSE(RequestId_GetUrls,{result = {code = 0, method = "SDL.GetURLS", urls = endpoints} } ) :Do(function(_,_) - if(#endpoints == 0) then - endpoints[1]={} - endpoints[1].url = "http://policies.telematics.ford.com/api/policies" - end - self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{ fileName = "PolicyTableUpdate", requestType = "PROPRIETARY", url = endpoints[1].url}) - EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY", fileType = "JSON", url = endpoints[1].url }) + EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY", fileType = "JSON" }) :Do(function(_,_) local CorIdSystemRequest = self.mobileSession:SendRPC("SystemRequest", {requestType = "PROPRIETARY", fileName = "PolicyTableUpdate"}, "files/ptu.json") diff --git a/test_scripts/Policies/Policy_Table_Update/144_ATF_PTU_validation_failure.lua b/test_scripts/Policies/Policy_Table_Update/144_ATF_PTU_validation_failure.lua index 17b46d6f28..74272af529 100644 --- a/test_scripts/Policies/Policy_Table_Update/144_ATF_PTU_validation_failure.lua +++ b/test_scripts/Policies/Policy_Table_Update/144_ATF_PTU_validation_failure.lua @@ -76,7 +76,6 @@ function Test:TestStep_PTU_validation_failure() local RequestId_GetUrls = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) EXPECT_HMIRESPONSE(RequestId_GetUrls,{result = {code = 0, method = "SDL.GetURLS", urls = endpoints} } ) :Do(function(_,_) - if(#endpoints == 0) then endpoints[1].url = "http://policies.telematics.ford.com/api/policies" end self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{ fileName = "PolicyTableUpdate", requestType = "PROPRIETARY", url = endpoints[1].url}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY", fileType = "JSON", url = endpoints[1].url }) :Do(function(_,_) diff --git a/test_scripts/Policies/Policy_Table_Update/147_ATF_Policy_Table_Update_Trigger_After_N_Kilometers.lua b/test_scripts/Policies/Policy_Table_Update/147_ATF_Policy_Table_Update_Trigger_After_N_Kilometers.lua index 47f99c7d56..631734072e 100644 --- a/test_scripts/Policies/Policy_Table_Update/147_ATF_Policy_Table_Update_Trigger_After_N_Kilometers.lua +++ b/test_scripts/Policies/Policy_Table_Update/147_ATF_Policy_Table_Update_Trigger_After_N_Kilometers.lua @@ -107,7 +107,7 @@ end function Test:Precondition_Update_Policy_With_New_Exchange_After_X_Kilometers_Value() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Policy_Table_Update/149_ATF_Policy_Table_Update_Trigger_After_N_Days.lua b/test_scripts/Policies/Policy_Table_Update/149_ATF_Policy_Table_Update_Trigger_After_N_Days.lua index 972e661235..23665228ce 100644 --- a/test_scripts/Policies/Policy_Table_Update/149_ATF_Policy_Table_Update_Trigger_After_N_Days.lua +++ b/test_scripts/Policies/Policy_Table_Update/149_ATF_Policy_Table_Update_Trigger_After_N_Days.lua @@ -90,7 +90,7 @@ end function Test:Precondition_Update_Policy_With_Exchange_After_X_Days_Value() currentSystemDaysAfterEpoch = getSystemDaysAfterEpoch() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{requestType = "PROPRIETARY", fileName = "filename"}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) diff --git a/test_scripts/Policies/Policy_Table_Update/155_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATE_NEEDED.lua b/test_scripts/Policies/Policy_Table_Update/155_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATE_NEEDED.lua index 76543f6dd7..e66d844af7 100644 --- a/test_scripts/Policies/Policy_Table_Update/155_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATE_NEEDED.lua +++ b/test_scripts/Policies/Policy_Table_Update/155_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATE_NEEDED.lua @@ -53,7 +53,6 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_ChangeStatus_Update_Needed() local time_update_needed = {} local time_system_request = {} - local endpoints = { { url = "http://policies.telematics.ford.com/api/policies" } } local is_test_fail = false local timeout_pts = testCasesForPolicyTableSnapshot:get_data_from_PTS("module_config.timeout_after_x_seconds") local seconds_between_retries = {} @@ -79,7 +78,7 @@ function Test:TestStep_ChangeStatus_Update_Needed() end local RequestId_GetUrls = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestId_GetUrls,{result = {code = 0, method = "SDL.GetURLS", urls = endpoints} } ) + EXPECT_HMIRESPONSE(RequestId_GetUrls) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{ requestType = "PROPRIETARY", fileName = "PolicyTableUpdate" }) diff --git a/test_scripts/Policies/Policy_Table_Update/156_ATF_PTU_OnStatusUpdate_Trigger.lua b/test_scripts/Policies/Policy_Table_Update/156_ATF_PTU_OnStatusUpdate_Trigger.lua index 7a5d774b04..6cce6f8c79 100644 --- a/test_scripts/Policies/Policy_Table_Update/156_ATF_PTU_OnStatusUpdate_Trigger.lua +++ b/test_scripts/Policies/Policy_Table_Update/156_ATF_PTU_OnStatusUpdate_Trigger.lua @@ -78,7 +78,7 @@ end function Test:TestStep_PTU_Success() local RequestId_GetUrls = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestId_GetUrls,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}} }} ) + EXPECT_HMIRESPONSE(RequestId_GetUrls) :Do(function(_,_) EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATING"}, {status = "UP_TO_DATE"}):Times(2) diff --git a/test_scripts/Policies/Policy_Table_Update/157_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATING.lua b/test_scripts/Policies/Policy_Table_Update/157_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATING.lua index f41cfdfd21..c05b90920c 100644 --- a/test_scripts/Policies/Policy_Table_Update/157_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATING.lua +++ b/test_scripts/Policies/Policy_Table_Update/157_ATF_PTU_Policies_Manager_Changes_Status_To_UPDATING.lua @@ -43,7 +43,7 @@ function Test:TestStep_CheckMessagesSequence() local is_test_fail = false local message_number = 1 local RequestId_GetUrls = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestId_GetUrls,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}} }} ) + EXPECT_HMIRESPONSE(RequestId_GetUrls) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "PolicyTableUpdate"}) diff --git a/test_scripts/Policies/Policy_Table_Update/160_ATF_Default_Policy_For_The_App_After_PTU.lua b/test_scripts/Policies/Policy_Table_Update/160_ATF_Default_Policy_For_The_App_After_PTU.lua index 64ae56ecee..fed15386cc 100644 --- a/test_scripts/Policies/Policy_Table_Update/160_ATF_Default_Policy_For_The_App_After_PTU.lua +++ b/test_scripts/Policies/Policy_Table_Update/160_ATF_Default_Policy_For_The_App_After_PTU.lua @@ -113,7 +113,7 @@ end function Test:TestStep_Update_Policy_With_New_Permission_In_Default_Section() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "filename"}) diff --git a/test_scripts/Policies/Policy_Table_Update/163_P_ATF_Register_NewApp_not_exist_inLocalPT_PTU.lua b/test_scripts/Policies/Policy_Table_Update/163_P_ATF_Register_NewApp_not_exist_inLocalPT_PTU.lua index 7cc8c0e4fb..0eb61055f4 100644 --- a/test_scripts/Policies/Policy_Table_Update/163_P_ATF_Register_NewApp_not_exist_inLocalPT_PTU.lua +++ b/test_scripts/Policies/Policy_Table_Update/163_P_ATF_Register_NewApp_not_exist_inLocalPT_PTU.lua @@ -67,10 +67,10 @@ function Test:Precondition_PolicyUpdateStarted() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) EXPECT_HMIRESPONSE(RequestIdGetURLS) - :Do(function(_,_) + :Do(function(_, data) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{ requestType = "PROPRIETARY", - url = "http://policies.telematics.ford.com/api/policies", + url = data.result.urls[1].url, appID = self.applications [config.application1.registerAppInterfaceParams.appName], fileName = "sdl_snapshot.json" }) diff --git a/test_scripts/Policies/Policy_Table_Update/164_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU.lua b/test_scripts/Policies/Policy_Table_Update/164_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU.lua index c5ae25db58..c9b7510c82 100644 --- a/test_scripts/Policies/Policy_Table_Update/164_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU.lua +++ b/test_scripts/Policies/Policy_Table_Update/164_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU.lua @@ -70,12 +70,12 @@ end function Test:Precondition_PolicyUpdateStarted() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) - :Do(function(_,_) + EXPECT_HMIRESPONSE(RequestIdGetURLS) + :Do(function(_, data) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", - url = "http://policies.telematics.ford.com/api/policies", + url = data.result.urls[1].url, appID = self.applications [config.application1.registerAppInterfaceParams.appName], fileName = "sdl_snapshot.json" }) diff --git a/test_scripts/Policies/Policy_Table_Update/165_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp.lua b/test_scripts/Policies/Policy_Table_Update/165_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp.lua index d923e9b6e0..467e554e99 100644 --- a/test_scripts/Policies/Policy_Table_Update/165_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp.lua +++ b/test_scripts/Policies/Policy_Table_Update/165_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp.lua @@ -72,12 +72,12 @@ end function Test:Precondition_PolicyUpdateStarted() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) - :Do(function(_,_) + EXPECT_HMIRESPONSE(RequestIdGetURLS) + :Do(function(_, data) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", - url = "http://policies.telematics.ford.com/api/policies", + url = data.result.urls[1].url, appID = self.applications [config.application1.registerAppInterfaceParams.appName], fileName = "sdl_snapshot.json" }) @@ -167,7 +167,7 @@ end function Test:TestStep_Start_New_PolicyUpdate_For_SecondApplication() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATING"}, {status = "UP_TO_DATE"}):Times(2) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Policy_Table_Update/170_ATF_PTU_Trigger_On_Navi_App_Registration_And_No_Certificate.lua b/test_scripts/Policies/Policy_Table_Update/170_ATF_PTU_Trigger_On_Navi_App_Registration_And_No_Certificate.lua index 21ac723089..214008a9dc 100644 --- a/test_scripts/Policies/Policy_Table_Update/170_ATF_PTU_Trigger_On_Navi_App_Registration_And_No_Certificate.lua +++ b/test_scripts/Policies/Policy_Table_Update/170_ATF_PTU_Trigger_On_Navi_App_Registration_And_No_Certificate.lua @@ -56,7 +56,7 @@ end function Test:Precondition_UpdatePolicyWithPTU() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{requestType = "PROPRIETARY", fileName = "filename"}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) diff --git a/test_scripts/Policies/Policy_Table_Update/172_ATF_PTU_request_after_N_ignition_cycles.lua b/test_scripts/Policies/Policy_Table_Update/172_ATF_PTU_request_after_N_ignition_cycles.lua index bbdb9fd533..0feb36d21a 100644 --- a/test_scripts/Policies/Policy_Table_Update/172_ATF_PTU_request_after_N_ignition_cycles.lua +++ b/test_scripts/Policies/Policy_Table_Update/172_ATF_PTU_request_after_N_ignition_cycles.lua @@ -61,7 +61,7 @@ function Test:Precondition_Activate_App_Consent_Device_And_Update_Policy() EXPECT_HMICALL("BasicCommunication.PolicyUpdate") :Do(function(_,_) local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{requestType = "PROPRIETARY", fileName = "filename"}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) diff --git a/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua b/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua index a51a373ae1..d6a96bc371 100644 --- a/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua +++ b/test_scripts/Policies/Related_HMI_API/186_ATF_OnPolicyUpdate_initiation_of_PTU.lua @@ -94,7 +94,7 @@ function Test:Precondtion_Activate_App_Consent_Update() EXPECT_HMICALL("BasicCommunication.PolicyUpdate") :Do(function(_,_) local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{requestType = "PROPRIETARY", fileName = "filename"}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) diff --git a/test_scripts/Policies/Related_HMI_API/187_ATF_Get_Status_Update_Request_from_HMI.lua b/test_scripts/Policies/Related_HMI_API/187_ATF_Get_Status_Update_Request_from_HMI.lua index 7b25d3ee18..5e68eb40df 100644 --- a/test_scripts/Policies/Related_HMI_API/187_ATF_Get_Status_Update_Request_from_HMI.lua +++ b/test_scripts/Policies/Related_HMI_API/187_ATF_Get_Status_Update_Request_from_HMI.lua @@ -68,7 +68,7 @@ function Test:Test_2_UPDATING() local policy_file_name = "PolicyTableUpdate" local ptu_file = "files/ptu_general.json" local requestId = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(requestId, { result = { code = 0, method = "SDL.GetURLS", urls = {{ url = "http://policies.telematics.ford.com/api/policies" }}}}) + EXPECT_HMIRESPONSE(requestId) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", {requestType = "PROPRIETARY", fileName = policy_file_name}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) :Do(function() diff --git a/test_scripts/Policies/Validation_of_PolicyTables/224_ATF_pt_update_validation_rules_request_type_array_omitted.lua b/test_scripts/Policies/Validation_of_PolicyTables/224_ATF_pt_update_validation_rules_request_type_array_omitted.lua index f4032796ce..bbfaf550d1 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/224_ATF_pt_update_validation_rules_request_type_array_omitted.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/224_ATF_pt_update_validation_rules_request_type_array_omitted.lua @@ -193,7 +193,7 @@ function Test:updatePolicyInDifferentSessions(PTName, appName, mobileSession) local iappID = self.applications[appName] local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Validation_of_PolicyTables/225_ATF_pt_update_validation_rules_request_type_array_has_one_invalid_value.lua b/test_scripts/Policies/Validation_of_PolicyTables/225_ATF_pt_update_validation_rules_request_type_array_has_one_invalid_value.lua index 55aec7e3e3..e43a3265cc 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/225_ATF_pt_update_validation_rules_request_type_array_has_one_invalid_value.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/225_ATF_pt_update_validation_rules_request_type_array_has_one_invalid_value.lua @@ -132,7 +132,7 @@ function Test:updatePolicyInDifferentSessions(PTName, appName, mobileSession) local iappID = self.applications[appName] local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Validation_of_PolicyTables/226_ATF_pt_update_validation_rules_request_type_array_has_only_one_value_is_invalid.lua b/test_scripts/Policies/Validation_of_PolicyTables/226_ATF_pt_update_validation_rules_request_type_array_has_only_one_value_is_invalid.lua index ec867a8950..079c92b9b9 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/226_ATF_pt_update_validation_rules_request_type_array_has_only_one_value_is_invalid.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/226_ATF_pt_update_validation_rules_request_type_array_has_only_one_value_is_invalid.lua @@ -175,7 +175,7 @@ function Test:updatePolicyInDifferentSessions(PTName, appName, mobileSession) local iappID = self.applications[appName] local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Validation_of_PolicyTables/245_ATF_preloaded_pt_parameter_trigger_in_local_pt.lua b/test_scripts/Policies/Validation_of_PolicyTables/245_ATF_preloaded_pt_parameter_trigger_in_local_pt.lua index 753b873508..25ad67fee9 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/245_ATF_preloaded_pt_parameter_trigger_in_local_pt.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/245_ATF_preloaded_pt_parameter_trigger_in_local_pt.lua @@ -139,7 +139,7 @@ function Test:updatePolicyTable(pathToPolicyFile) local requestId = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(requestId, {result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(requestId) :Do(function(_, _) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Validation_of_PolicyTables/266_ATF_pt_update_validation_rules_optional_parameters_type.lua b/test_scripts/Policies/Validation_of_PolicyTables/266_ATF_pt_update_validation_rules_optional_parameters_type.lua index 4782e5de8e..076412dc57 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/266_ATF_pt_update_validation_rules_optional_parameters_type.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/266_ATF_pt_update_validation_rules_optional_parameters_type.lua @@ -68,7 +68,7 @@ function Test:updatePolicyInDifferentSessions(_, appName, mobileSession) local iappID = self.applications[appName] local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "PolicyTableUpdate"} ) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/267_ATF_pt_update_validation_rules_required_parameters_type.lua b/test_scripts/Policies/Validation_of_PolicyTables/267_ATF_pt_update_validation_rules_required_parameters_type.lua index d20c39fe7b..6d6309e15d 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/267_ATF_pt_update_validation_rules_required_parameters_type.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/267_ATF_pt_update_validation_rules_required_parameters_type.lua @@ -155,7 +155,7 @@ function Test:updatePolicyInDifferentSessions(_, appName, mobileSession) local iappID = self.applications[appName] local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "PolicyTableUpdate"} ) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/268_ATF_pt_update_validation_rules_general.lua b/test_scripts/Policies/Validation_of_PolicyTables/268_ATF_pt_update_validation_rules_general.lua index dee8cc4cbb..23859e4e0c 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/268_ATF_pt_update_validation_rules_general.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/268_ATF_pt_update_validation_rules_general.lua @@ -43,7 +43,7 @@ local ptuAppRegistered = "files/ptu_app.json" function Test:updatePolicyInDifferentSessions(_, appName, mobileSession) local iappID = self.applications[appName] local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "PolicyTableUpdate"} ) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/269_ATF_pt_update_validation_rules_consumer_friendly_message.lua b/test_scripts/Policies/Validation_of_PolicyTables/269_ATF_pt_update_validation_rules_consumer_friendly_message.lua index d4455aa92a..bd6a6f0464 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/269_ATF_pt_update_validation_rules_consumer_friendly_message.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/269_ATF_pt_update_validation_rules_consumer_friendly_message.lua @@ -172,7 +172,7 @@ function Test:updatePolicyInDifferentSessions(PTName, appName, mobileSession) local iappID = self.applications[appName] local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "PolicyTableUpdate"} ) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/270_ATF_Validate_default_hmi_default_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/270_ATF_Validate_default_hmi_default_policies.lua index ca54c264df..c2974e33ab 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/270_ATF_Validate_default_hmi_default_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/270_ATF_Validate_default_hmi_default_policies.lua @@ -58,7 +58,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_Validate_default_hmi_in_default_upon_PTU() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,data) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "filename" } ) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/271_ATF_Validate_preconsented_groups_default_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/271_ATF_Validate_preconsented_groups_default_policies.lua index 068fba1d5f..41f98150b0 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/271_ATF_Validate_preconsented_groups_default_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/271_ATF_Validate_preconsented_groups_default_policies.lua @@ -57,7 +57,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_Validate_preconsented_groups_in_default_upon_PTU() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,data) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Validation_of_PolicyTables/272_ATF_Validate_groups_default_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/272_ATF_Validate_groups_default_policies.lua index c4aa108680..7e815fd160 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/272_ATF_Validate_groups_default_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/272_ATF_Validate_groups_default_policies.lua @@ -56,7 +56,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_Validate_groups_in_default_upon_PTU() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,data) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Validation_of_PolicyTables/273_ATF_Validate_default_hmi_appId_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/273_ATF_Validate_default_hmi_appId_policies.lua index 0e98440c84..031863a33b 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/273_ATF_Validate_default_hmi_appId_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/273_ATF_Validate_default_hmi_appId_policies.lua @@ -79,7 +79,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_Validate_default_hmi_upon_PTU() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,data) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Validation_of_PolicyTables/278_ATF_Validate_groups_appID_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/278_ATF_Validate_groups_appID_policies.lua index 552358c07b..feaf9c59f0 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/278_ATF_Validate_groups_appID_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/278_ATF_Validate_groups_appID_policies.lua @@ -77,7 +77,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_Validate_groups_from_appId_upon_PTU() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,data) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Validation_of_PolicyTables/282_ATF_PT_Exchanged_X_Days_After_Epoch_In_PTS.lua b/test_scripts/Policies/Validation_of_PolicyTables/282_ATF_PT_Exchanged_X_Days_After_Epoch_In_PTS.lua index 5e41cabfea..edb27420f7 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/282_ATF_PT_Exchanged_X_Days_After_Epoch_In_PTS.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/282_ATF_PT_Exchanged_X_Days_After_Epoch_In_PTS.lua @@ -79,7 +79,7 @@ function Test:Precondition_Activate_App_Consent_Device_And_Update_Policy() days_after_epoch_prev = getDaysAfterEpochFromPTS(pathToSnapshot) local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{requestType = "PROPRIETARY", fileName = "filename"}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/283_ATF_Store_pt_exchanged_at_odometer_x_in_PT.lua b/test_scripts/Policies/Validation_of_PolicyTables/283_ATF_Store_pt_exchanged_at_odometer_x_in_PT.lua index f676583ff2..5f22a64e6a 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/283_ATF_Store_pt_exchanged_at_odometer_x_in_PT.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/283_ATF_Store_pt_exchanged_at_odometer_x_in_PT.lua @@ -60,7 +60,7 @@ end function Test:Precondition_PolicyUpdateRAI() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "filename"}) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/287_ATF_Validate_appHMIType_appID_policies.lua b/test_scripts/Policies/Validation_of_PolicyTables/287_ATF_Validate_appHMIType_appID_policies.lua index 8aa5099f10..e2092b6634 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/287_ATF_Validate_appHMIType_appID_policies.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/287_ATF_Validate_appHMIType_appID_policies.lua @@ -78,7 +78,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_Validate_appHMIType_from_appId_upon_PTU() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,data) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/Validation_of_PolicyTables/299_ATF_Memory_Kb_Constraints_Ignoring.lua b/test_scripts/Policies/Validation_of_PolicyTables/299_ATF_Memory_Kb_Constraints_Ignoring.lua index 6aa3b91790..908988aca5 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/299_ATF_Memory_Kb_Constraints_Ignoring.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/299_ATF_Memory_Kb_Constraints_Ignoring.lua @@ -74,7 +74,7 @@ end function Test:Precondition_Update_Policy_With_memory_kb_Param() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{requestType = "PROPRIETARY", fileName = "filename"}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/301_ATF_usage_and_error_counts_update_app_registration_language_vui.lua b/test_scripts/Policies/Validation_of_PolicyTables/301_ATF_usage_and_error_counts_update_app_registration_language_vui.lua index 45e06d4023..08efda3fd1 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/301_ATF_usage_and_error_counts_update_app_registration_language_vui.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/301_ATF_usage_and_error_counts_update_app_registration_language_vui.lua @@ -280,7 +280,7 @@ function Test:updatePolicyInDifferentSessions(PTName, appName, mobileSession) local iappID = self.applications[appName] local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "PolicyTableUpdate"} ) diff --git a/test_scripts/Policies/Validation_of_PolicyTables/304_ATF_HP_Validation_Count_Of_User_Selections.lua b/test_scripts/Policies/Validation_of_PolicyTables/304_ATF_HP_Validation_Count_Of_User_Selections.lua index 1b73cd8b72..760f98686d 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/304_ATF_HP_Validation_Count_Of_User_Selections.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/304_ATF_HP_Validation_Count_Of_User_Selections.lua @@ -38,7 +38,7 @@ commonSteps:DeletePolicyTable() --[[ Local Variables ]] local appID = config.application1.registerAppInterfaceParams["appID"] -local countAppActivation +local countAppActivation = 0 --[[ Preconditions ]] function Test:Precondition_Activate_App_Consent_Device() diff --git a/test_scripts/Policies/Validation_of_PolicyTables/306_ATF_Update_count_of_run_attempts_while_revoked_in_PT.lua b/test_scripts/Policies/Validation_of_PolicyTables/306_ATF_Update_count_of_run_attempts_while_revoked_in_PT.lua index 16208cb518..d875138de4 100644 --- a/test_scripts/Policies/Validation_of_PolicyTables/306_ATF_Update_count_of_run_attempts_while_revoked_in_PT.lua +++ b/test_scripts/Policies/Validation_of_PolicyTables/306_ATF_Update_count_of_run_attempts_while_revoked_in_PT.lua @@ -80,7 +80,7 @@ function Test:TestStep_PTU_appPermissionsConsentNeeded_true() end end) local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "filename"}) @@ -126,7 +126,7 @@ function Test:Precondition_PTU_revoke_app() end) HMIAppID = self.applications[config.application1.registerAppInterfaceParams.appName] local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "filename"}) diff --git a/test_scripts/Policies/appID_Management/043_ATF_HMI_Status_Appid_Gets_Null_In_Case_Of_PTU.lua b/test_scripts/Policies/appID_Management/043_ATF_HMI_Status_Appid_Gets_Null_In_Case_Of_PTU.lua index 94ab4bf7f9..b84f69bdeb 100644 --- a/test_scripts/Policies/appID_Management/043_ATF_HMI_Status_Appid_Gets_Null_In_Case_Of_PTU.lua +++ b/test_scripts/Policies/appID_Management/043_ATF_HMI_Status_Appid_Gets_Null_In_Case_Of_PTU.lua @@ -86,7 +86,7 @@ function Test:TestStep_UpdatePolicy() EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", { status = "UPDATING" }, { status = "UP_TO_DATE" }):Times(2) local requestId = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(requestId, {result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(requestId) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = policy_file_name }) diff --git a/test_scripts/Policies/appID_Management/044_ATF_HMI_Status_Value_Of_AppId_In_PT_Is_Null.lua b/test_scripts/Policies/appID_Management/044_ATF_HMI_Status_Value_Of_AppId_In_PT_Is_Null.lua index 97b681e125..b0b32d4658 100644 --- a/test_scripts/Policies/appID_Management/044_ATF_HMI_Status_Value_Of_AppId_In_PT_Is_Null.lua +++ b/test_scripts/Policies/appID_Management/044_ATF_HMI_Status_Value_Of_AppId_In_PT_Is_Null.lua @@ -84,7 +84,7 @@ function Test:Precondition_UpdatePolicy() EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", { status = "UPDATING" }, { status = "UP_TO_DATE" }):Times(2) local requestId = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(requestId, {result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(requestId) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = policy_file_name }) diff --git a/test_scripts/Policies/build_options/088_ATF_Apply_UpdatedPT_after_OnReceivedPolicyUpdate_from_HMI_PROPRIETARY.lua b/test_scripts/Policies/build_options/088_ATF_Apply_UpdatedPT_after_OnReceivedPolicyUpdate_from_HMI_PROPRIETARY.lua index 3f6339d7df..b22f3d6260 100644 --- a/test_scripts/Policies/build_options/088_ATF_Apply_UpdatedPT_after_OnReceivedPolicyUpdate_from_HMI_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/088_ATF_Apply_UpdatedPT_after_OnReceivedPolicyUpdate_from_HMI_PROPRIETARY.lua @@ -65,7 +65,15 @@ function Test:TestStep_Update_Policy() local policy_file_path = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS, { + result = { + code = 0, + method = "SDL.GetURLS", + urls = { + { url = commonFunctions.getURLs("0x07")[1] } + } + } + }) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", {requestType = "PROPRIETARY", fileName = policy_file_path .. "sdl_snapshot.json"}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) diff --git a/test_scripts/Policies/build_options/089_ATF_Check_SDL_respond_GetURLs_Request_fromHMI_PROPRIETARY.lua b/test_scripts/Policies/build_options/089_ATF_Check_SDL_respond_GetURLs_Request_fromHMI_PROPRIETARY.lua index 862a1c55c8..5149ec6136 100644 --- a/test_scripts/Policies/build_options/089_ATF_Check_SDL_respond_GetURLs_Request_fromHMI_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/089_ATF_Check_SDL_respond_GetURLs_Request_fromHMI_PROPRIETARY.lua @@ -71,7 +71,7 @@ function Test:RegisterApp() local requestId = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) EXPECT_HMIRESPONSE(requestId) :ValidIf(function(_, d) - local r_expected = "http://policies.telematics.ford.com/api/policies" + local r_expected = commonFunctions.getURLs("0x07")[1] local r_actual = d.result.urls[1].url if r_expected ~= r_actual then local msg = table.concat({"\nExpected: ", r_expected, "\nActual: ", tostring(r_actual)}) diff --git a/test_scripts/Policies/build_options/097_ATF_PTU_Cycleing_Through_The_URLs_During_Retry_Sequence_HTTP.lua b/test_scripts/Policies/build_options/097_ATF_PTU_Cycleing_Through_The_URLs_During_Retry_Sequence_HTTP.lua index d3aaa80412..0ac042164e 100644 --- a/test_scripts/Policies/build_options/097_ATF_PTU_Cycleing_Through_The_URLs_During_Retry_Sequence_HTTP.lua +++ b/test_scripts/Policies/build_options/097_ATF_PTU_Cycleing_Through_The_URLs_During_Retry_Sequence_HTTP.lua @@ -28,11 +28,11 @@ local ptu_file = "files/jsons/Policies/build_options/ptu_18269.json" local sequence = { } local attempts = 16 local r_expected = { - "http://policies.telematics.ford.com/api/policies", + commonFunctions.getURLs("0x07")[1], "http://policies.domain1.ford.com/api/policies", "http://policies.domain2.ford.com/api/policies", - "http://policies.domain3.ford.com/api/policies", -"http://policies.domain4.ford.com/api/policies"} + "http://policies.domain3.ford.com/api/policies" +} local r_actual = { } --[[ Local Functions ]] @@ -123,7 +123,12 @@ function Test.ShowSequence() print("--------------------------------------------------") end -for i = 1, 3 do +-- function Test.print() +-- print_table(r_expected) +-- print_table(r_actual) +-- end + +for i = 1, 4 do Test["ValidateResult" .. i] = function(self) if(r_actual[i] ~= nil) then if r_expected[i] ~= r_actual[i] then diff --git a/test_scripts/Policies/build_options/108_ATF_PTU_Trigger_days_PROPRIETARY.lua b/test_scripts/Policies/build_options/108_ATF_PTU_Trigger_days_PROPRIETARY.lua index 1781432267..342d554fbf 100644 --- a/test_scripts/Policies/build_options/108_ATF_PTU_Trigger_days_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/108_ATF_PTU_Trigger_days_PROPRIETARY.lua @@ -68,7 +68,15 @@ end function Test:Precondition_Update_Policy_With_Exchange_After_X_Days_Value() currentSystemDaysAfterEpoch = getSystemDaysAfterEpoch() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS, { + result = { + code = 0, + method = "SDL.GetURLS", + urls = { + { url = commonFunctions.getURLs("0x07")[1] } + } + } + }) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{requestType = "PROPRIETARY", fileName = "filename"}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) diff --git a/test_scripts/Policies/build_options/110_ATF_PTU_Trigger_kilometers_PROPRIETARY.lua b/test_scripts/Policies/build_options/110_ATF_PTU_Trigger_kilometers_PROPRIETARY.lua index 95f14011fa..be6a534501 100644 --- a/test_scripts/Policies/build_options/110_ATF_PTU_Trigger_kilometers_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/110_ATF_PTU_Trigger_kilometers_PROPRIETARY.lua @@ -107,7 +107,7 @@ end function Test:Precondition_Update_Policy_With_New_Exchange_After_X_Kilometers_Value() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { diff --git a/test_scripts/Policies/build_options/112_ATF_transfer_SystemRequest_from_app_to_HMI_PROPRIETARY.lua b/test_scripts/Policies/build_options/112_ATF_transfer_SystemRequest_from_app_to_HMI_PROPRIETARY.lua index 6c47e00eff..f01e3d4efc 100644 --- a/test_scripts/Policies/build_options/112_ATF_transfer_SystemRequest_from_app_to_HMI_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/112_ATF_transfer_SystemRequest_from_app_to_HMI_PROPRIETARY.lua @@ -38,7 +38,15 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_Update_Policy() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS, { + result = { + code = 0, + method = "SDL.GetURLS", + urls = { + { url = commonFunctions.getURLs("0x07")[1] } + } + } + }) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", {requestType = "PROPRIETARY", fileName = testData.fileName}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) diff --git a/test_scripts/Policies/build_options/114_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua b/test_scripts/Policies/build_options/114_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua index b70ebe4724..e2b4ea7925 100644 --- a/test_scripts/Policies/build_options/114_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/114_ATF_Register_NewApp_not_exist_inLocalPT_FinishPTU_PROPRIETARY.lua @@ -62,11 +62,20 @@ commonSteps:DeleteLogsFileAndPolicyTable() commonFunctions:newTestCasesGroup ("Preconditions") function Test:Precondition_PolicyUpdateStarted() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) :Do(function(_,_) + EXPECT_HMIRESPONSE(RequestIdGetURLS, { + result = { + code = 0, + method = "SDL.GetURLS", + urls = { + { url = commonFunctions.getURLs("0x07")[1] } + } + } + }) + :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", - url = "http://policies.telematics.ford.com/api/policies", + url = commonFunctions.getURLs("0x07")[1], appID = self.applications ["Test Application"], fileName = "sdl_snapshot.json" }) diff --git a/test_scripts/Policies/build_options/115_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp_PROPRIETARY.lua b/test_scripts/Policies/build_options/115_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp_PROPRIETARY.lua index 3faf128056..911fbe3454 100644 --- a/test_scripts/Policies/build_options/115_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp_PROPRIETARY.lua +++ b/test_scripts/Policies/build_options/115_ATF_Register_NewApp_not_exist_inLocalPT_start_PTU_for_NewApp_PROPRIETARY.lua @@ -95,15 +95,23 @@ function Test:Precondition_RegisterApp_trigger() end function Test:Precondition_PolicyUpdateStarted() - local policy_file_path = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" + local policy_file_path = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS, { + result = { + code = 0, + method = "SDL.GetURLS", + urls = { + { url = commonFunctions.getURLs("0x07")[1] } + } + } + }) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", - url = "http://policies.telematics.ford.com/api/policies", + url = commonFunctions.getURLs("0x07")[1], appID = self.applications ["Test Application"], fileName = policy_file_path .. "sdl_snapshot.json" } diff --git a/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua b/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua index d79d83554e..e165a2fc49 100644 --- a/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua +++ b/test_scripts/Policies/user_consent_of_Policies/188_ATF_HP_Device_Data_Section_Validation.lua @@ -70,18 +70,32 @@ local function GetCurrentTimeStampGroupConsent() end local function GetDataFromSnapshot(pathToFile) + local function getData(pTable, pKey) + if pTable then + return pTable[pKey] + end + return nil + end + local function getTableData(pTable, pKey) + if pTable and pTable[pKey] then + return next(pTable[pKey], nil) + end + return nil + end local file = io.open(pathToFile, "r") local json_data = file:read("*all") -- may be abbreviated to "*a"; file:close() local json = require("modules/json") local data = json.decode(json_data) + local ucr = data.policy_table.device_data[MACHash].user_consent_records local res = { - deviceConsentTimeStamp = data.policy_table.device_data[MACHash].user_consent_records.device.time_stamp, - deviceInput = data.policy_table.device_data[MACHash].user_consent_records.device.input, - deviceGroups = next(data.policy_table.device_data[MACHash].user_consent_records.device.consent_groups, nil), - inputOfAppIdConsent = data.policy_table.device_data[MACHash].user_consent_records[appID].input, - groupUserconsentTimeStamp = data.policy_table.device_data[MACHash].user_consent_records[appID].time_stamp, - userConsentGroup = next(data.policy_table.device_data[MACHash].user_consent_records[appID].consent_groups, nil)} + deviceConsentTimeStamp = getData(ucr.device, "time_stamp"), + deviceInput = getData(ucr.device, "input"), + deviceGroups = getTableData(ucr.device, "consent_groups"), + inputOfAppIdConsent = getData(ucr[appID], "input"), + groupUserconsentTimeStamp = getData(ucr[appID], "time_stamp"), + userConsentGroup = getTableData(ucr[appID], "consent_groups") + } return res end @@ -126,7 +140,7 @@ function Test:Precondition_Activate_App_Consent_Device_Make_PTU_Consent_Group() EXPECT_HMICALL("BasicCommunication.PolicyUpdate") :Do(function(_,_) local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{requestType = "PROPRIETARY", fileName = "filename"}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) @@ -191,16 +205,16 @@ function Test:Validate_Snapshot_Values() groupUserconsentTimeStamp = consentGroupSystemTimeStamp, userConsentGroup = "Location-1" } - + local msg = "" local result = true - for k,v in pairs(valuesFromPTS) do - if v ~= verificationValues[k] then - -- local stringLog = "Wrong value from snapshot " .. k .. "! Expected: " .. verificationValues[k] .. " Actual: " .. v - print("Wrong value from snapshot " .. k .. "! Expected: " .. verificationValues[k] .. " Actual: " .. v) + for k, v in pairs(verificationValues) do + if v ~= valuesFromPTS[k] then + if string.len(msg) > 0 then msg = msg .. "\n" end + msg = msg .. "Wrong value from snapshot " .. k .. "! Expected: " .. v .. " Actual: " .. tostring(valuesFromPTS[k]) result = false end end - return result + return result, msg end) end diff --git a/test_scripts/Policies/user_consent_of_Policies/189_ATF_isAppPermissionsRevoked_true.lua b/test_scripts/Policies/user_consent_of_Policies/189_ATF_isAppPermissionsRevoked_true.lua index ac5a10f5e5..997d638144 100644 --- a/test_scripts/Policies/user_consent_of_Policies/189_ATF_isAppPermissionsRevoked_true.lua +++ b/test_scripts/Policies/user_consent_of_Policies/189_ATF_isAppPermissionsRevoked_true.lua @@ -55,7 +55,7 @@ end function Test:TestStep_PTU_appPermissionsConsentNeeded_true() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "filename"}) @@ -126,7 +126,7 @@ end function Test:Precondition_PTU_revoke_app_group() HMIAppID = self.applications[config.application1.registerAppInterfaceParams.appName] local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { requestType = "PROPRIETARY", fileName = "filename"}) diff --git a/test_scripts/Policies/user_consent_of_Policies/199_ATF_appPermissionsConsentNeeded_true.lua b/test_scripts/Policies/user_consent_of_Policies/199_ATF_appPermissionsConsentNeeded_true.lua index 89f9a28dad..9b318a192a 100644 --- a/test_scripts/Policies/user_consent_of_Policies/199_ATF_appPermissionsConsentNeeded_true.lua +++ b/test_scripts/Policies/user_consent_of_Policies/199_ATF_appPermissionsConsentNeeded_true.lua @@ -48,7 +48,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:TestStep_PTU_appPermissionsConsentNeeded_true() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", {status = "UPDATING"}, {status = "UP_TO_DATE"}):Times(2) :Do(function(_,data) diff --git a/test_scripts/Policies/user_consent_of_Policies/210_ATF_User_consent_initing_after_PTU_FULL.lua b/test_scripts/Policies/user_consent_of_Policies/210_ATF_User_consent_initing_after_PTU_FULL.lua index 0b10479d1a..1a1baa13ed 100644 --- a/test_scripts/Policies/user_consent_of_Policies/210_ATF_User_consent_initing_after_PTU_FULL.lua +++ b/test_scripts/Policies/user_consent_of_Policies/210_ATF_User_consent_initing_after_PTU_FULL.lua @@ -36,7 +36,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:OnAppPermissionChanged_to_FULL_upon_PTU() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{ requestType = "PROPRIETARY", fileName = "filename"} ) diff --git a/test_scripts/Policies/user_consent_of_Policies/211_ATF_User_consent_initing_after_PTU_LIMITED.lua b/test_scripts/Policies/user_consent_of_Policies/211_ATF_User_consent_initing_after_PTU_LIMITED.lua index 014d9165dc..3c304cf906 100644 --- a/test_scripts/Policies/user_consent_of_Policies/211_ATF_User_consent_initing_after_PTU_LIMITED.lua +++ b/test_scripts/Policies/user_consent_of_Policies/211_ATF_User_consent_initing_after_PTU_LIMITED.lua @@ -44,7 +44,7 @@ commonFunctions:newTestCasesGroup("Test") function Test:OnAppPermissionChanged_to_LIMITED_upon_PTU() local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{ requestType = "PROPRIETARY", fileName = "filename"} ) diff --git a/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua b/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua index 36e6191109..112dd386b7 100644 --- a/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua +++ b/test_scripts/Policies/user_consent_of_Policies/214_ATF_User_consent_prompt_persists.lua @@ -197,7 +197,7 @@ end function Test:Precondition_PTU_user_consent_prompt_present() local is_test_passed = true local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function() self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest",{ requestType = "PROPRIETARY", fileName = "filename"}) EXPECT_NOTIFICATION("OnSystemRequest", { requestType = "PROPRIETARY" }) diff --git a/user_modules/shared_testcases/commonFunctions.lua b/user_modules/shared_testcases/commonFunctions.lua index c5262caff8..87a103df81 100644 --- a/user_modules/shared_testcases/commonFunctions.lua +++ b/user_modules/shared_testcases/commonFunctions.lua @@ -1332,4 +1332,20 @@ function commonFunctions:pathJoin(...) return table.concat(args, "/") end +function commonFunctions.getURLs(pService) + local utils = require ('user_modules/utils') + local function getPathToSDL() + local pathToSDL = config.pathToSDL + if pathToSDL:sub(-1) ~= '/' then + pathToSDL = pathToSDL .. "/" + end + return pathToSDL + end + local fileName = getPathToSDL() .. commonFunctions:read_parameter_from_smart_device_link_ini("PreloadedPT") + local tbl = utils.jsonFileToTable(fileName) + local url = tbl.policy_table.module_config.endpoints[pService].default + return url +end + + return commonFunctions diff --git a/user_modules/shared_testcases/testCasesForPolicyAppIdManagament.lua b/user_modules/shared_testcases/testCasesForPolicyAppIdManagament.lua index 5e7e37353c..c3be96d6a6 100644 --- a/user_modules/shared_testcases/testCasesForPolicyAppIdManagament.lua +++ b/user_modules/shared_testcases/testCasesForPolicyAppIdManagament.lua @@ -20,17 +20,7 @@ local commonFunctions = require("user_modules/shared_testcases/commonFunctions") function common:updatePolicyTable(test, file) EXPECT_HMINOTIFICATION("SDL.OnStatusUpdate", { status = "UPDATING" }, { status = "UP_TO_DATE" }):Times(2) local requestId = test.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) - EXPECT_HMIRESPONSE(requestId, { - result = { - code = 0, - method = "SDL.GetURLS", - urls = { - { - url = "http://policies.telematics.ford.com/api/policies" - } - } - } - }) + EXPECT_HMIRESPONSE(requestId) :Do(function() local pts_file_name = commonFunctions:read_parameter_from_smart_device_link_ini("SystemFilesPath") .. "/" .. commonFunctions:read_parameter_from_smart_device_link_ini("PathToSnapshot") diff --git a/user_modules/shared_testcases/testCasesForPolicyTable.lua b/user_modules/shared_testcases/testCasesForPolicyTable.lua index 1d5c48822f..1ff3c9d587 100644 --- a/user_modules/shared_testcases/testCasesForPolicyTable.lua +++ b/user_modules/shared_testcases/testCasesForPolicyTable.lua @@ -308,7 +308,7 @@ function testCasesForPolicyTable:updatePolicy(PTName, iappID) local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) --hmi side: expect SDL.GetURLS response from HMI - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) --print("SDL.GetURLS response is received") --hmi side: sending BasicCommunication.OnSystemRequest request to SDL @@ -408,7 +408,7 @@ function testCasesForPolicyTable:updatePolicyInDifferentSessions(self, PTName, a local RequestIdGetURLS = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) --hmi side: expect SDL.GetURLS response from HMI - EXPECT_HMIRESPONSE(RequestIdGetURLS,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(RequestIdGetURLS) :Do(function(_,_) --hmi side: sending BasicCommunication.OnSystemRequest request to SDL self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", diff --git a/user_modules/shared_testcases_custom/ATF_Policies_External_Consent_common_functions.lua b/user_modules/shared_testcases_custom/ATF_Policies_External_Consent_common_functions.lua index 344dc8ee63..a0b7d78b49 100644 --- a/user_modules/shared_testcases_custom/ATF_Policies_External_Consent_common_functions.lua +++ b/user_modules/shared_testcases_custom/ATF_Policies_External_Consent_common_functions.lua @@ -102,7 +102,7 @@ function external_consent_common_functions:UpdatePolicy(self, json_file_path, in --hmi side: sending SDL.GetURLS request local request_id_get_urls = self.hmiConnection:SendRequest("SDL.GetURLS", { service = 7 }) --hmi side: expect SDL.GetURLS response from HMI - EXPECT_HMIRESPONSE(request_id_get_urls,{result = {code = 0, method = "SDL.GetURLS", urls = {{url = "http://policies.telematics.ford.com/api/policies"}}}}) + EXPECT_HMIRESPONSE(request_id_get_urls) :Do(function(_,data) --hmi side: sending BasicCommunication.OnSystemRequest request to SDL self.hmiConnection:SendNotification("BasicCommunication.OnSystemRequest", { From 8961ca7c8f6483039a824df7929b0c7e5f4d8a87 Mon Sep 17 00:00:00 2001 From: Dmitriy Boltovskiy Date: Wed, 28 Mar 2018 10:33:01 +0300 Subject: [PATCH 17/30] Add new functions to Utils module --- user_modules/utils.lua | 86 ++++++++++++++++++++++++++++++++---------- 1 file changed, 67 insertions(+), 19 deletions(-) diff --git a/user_modules/utils.lua b/user_modules/utils.lua index e15afb8931..d1adde254f 100644 --- a/user_modules/utils.lua +++ b/user_modules/utils.lua @@ -122,35 +122,83 @@ function m.protect(pTbl) return setmetatable({}, mt) end ---[[ @inheritObjects: copy objects from source module to target --- 'objects' means: tables, functions, fields --- Function is useful for 'inheriting' data of one module to another +--[[ @cprint: print color message to console --! @parameters: ---! pTargetObject - target module ---! pSourceObject - source module ---! @return: none +--! pColor - color code +--! pMsg - message +--]] +function m.cprint(pColor, ...) + print("\27[" .. tostring(pColor) .. "m" .. table.concat(table.pack(...), "\t") .. "\27[0m") +end + +--[[ @spairs: sorted iterator, allows to get items from table sorted by key +-- Usually used as a replacement of standard 'pairs' function +--! @parameters: +--! pTbl - table to iterate +--! @return: iterator --]] -function m.inheritObjects(pTargetObject, pSourceObject) - for k, v in pairs(pSourceObject) do - if type(v) == "table" then - pTargetObject[k] = m.cloneTable(v) - elseif type(v) == "function" then - pTargetObject[k] = function(...) - return v(...) +function m.spairs(pTbl) + local keys = {} + for k in pairs(pTbl) do + keys[#keys+1] = k + end + table.sort(keys, function(a, b) return tostring(a) < tostring(b) end) + local i = 0 + return function() + i = i + 1 + if keys[i] then + return keys[i], pTbl[keys[i]] + end + end +end + +--[[ @tableToString: convert table to string +--! @parameters: +--! pTbl - table to convert +--! @return: string +--]] +function m.tableToString(pTbl) + local s = "" + local function tPrint(tbl, level) + if not level then level = 0 end + for k, v in m.spairs(tbl) do + local indent = string.rep(" ", level * 4) + s = s .. indent .. "[" .. k .. "]: " + if type(v) == "table" then + s = s .. "{\n" + tPrint(v, level + 1) + s = s .. indent .. "}" + elseif type(v) == "string" then + s = s .. "'" .. tostring(v) .. "'" + else + s = s .. tostring(v) end - else - pTargetObject[k] = v + s = s .. "\n" end end + tPrint(pTbl) + return string.sub(s, 1, string.len(s) - 1) end ---[[ @cprint: print color message to console +--[[ @printTable: print table --! @parameters: --! pColor - color code ---! pMsg - message +--! pTbl - table to print +--! @return: none +--]] +function m.cprintTable(pColor, pTbl) + m.cprint(pColor, string.rep("-", 50)) + m.cprint(pColor, m.tableToString(pTbl)) + m.cprint(pColor, string.rep("-", 50)) +end + +--[[ @printTable: print table +--! @parameters: +--! pTbl - table to print +--! @return: none --]] -function m.cprint(pColor, pMsg) - print("\27[" .. tostring(pColor) .. "m" .. tostring(pMsg) .. "\27[0m") +function m.printTable(pTbl) + m.cprintTable(39, pTbl) end return m From f714f5a758a9e48d4504c97349280e1d618f9fa0 Mon Sep 17 00:00:00 2001 From: Halyna Savynetska Date: Mon, 12 Mar 2018 15:09:38 +0200 Subject: [PATCH 18/30] Created common SetAppIcon --- test_scripts/API/commonSetAppIcon.lua | 242 ++++++++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 test_scripts/API/commonSetAppIcon.lua diff --git a/test_scripts/API/commonSetAppIcon.lua b/test_scripts/API/commonSetAppIcon.lua new file mode 100644 index 0000000000..6aab1be2cf --- /dev/null +++ b/test_scripts/API/commonSetAppIcon.lua @@ -0,0 +1,242 @@ +--------------------------------------------------------------------------------------------------- +-- Common module +--------------------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------------------- +--[[ General configuration parameters ]] +config.defaultProtocolVersion = 2 + +--[[ Required Shared libraries ]] +local actions = require("user_modules/sequences/actions") +local utils = require("user_modules/utils") +local Test = require('user_modules/connecttest_PutFile') +local commonSmoke = require('test_scripts/Smoke/commonSmoke') + + +--[[ Module ]] +local m = actions +local f = Test +local u = commonSmoke + +--[[ Variables ]] +local ptuTable = {} +local hmiAppIds = {} + +--[[ @registerApp: register mobile application +--! @parameters: +--! pAppId - application number (1, 2, etc.) +--! @return: none +--]] +function m.registerApp(pAppId, pIconResumed) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + mobSession:StartService(7) + :Do(function() + local corId = mobSession:SendRPC("RegisterAppInterface", m.getConfigAppParams(pAppId)) + test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", + { application = { appName = m.getConfigAppParams(pAppId).appName } }) + :Do(function(_, d1) + hmiAppIds[m.getConfigAppParams(pAppId).appID] = d1.params.application.appID + test.hmiConnection:ExpectNotification("SDL.OnStatusUpdate", { status = "UPDATE_NEEDED" }, { status = "UPDATING" }) + :Times(2) + test.hmiConnection:ExpectRequest("BasicCommunication.PolicyUpdate") + :Do(function(_, d2) + test.hmiConnection:SendResponse(d2.id, d2.method, "SUCCESS", { }) + ptuTable = utils.jsonFileToTable(d2.params.file) + end) + end) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) + :Do(function() + mobSession:ExpectNotification("OnHMIStatus", + { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) + mobSession:ExpectNotification("OnPermissionsChange") + end) + end) +end + +function u.unregisterAppInterface(pAppId, pIconResumed) + local corId = mobileSession:SendRPC("UnregisterAppInterface", { }) + EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", + { appID = commonSmoke.getHMIAppId(), unexpectedDisconnect = false }) + mobileSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) +end + +--Description: Set all parameter for PutFile +function f.putFileAllParams() + local temp = { + syncFileName ="icon.png", + fileType ="GRAPHIC_PNG", + persistentFile =false, + systemFile = false, + offset =0, + length =11600 + } + return temp +end + +--Description: Set all parameter for Show + --syncFileNameValue: image file name will be use to Show +function f.showAllParams(syncFileNameValue) + local temp = { + mediaClock = "12:34", + mainField1 = "Show Line 1", + mainField2 = "Show Line 2", + mainField3 = "Show Line 3", + mainField4 = "Show Line 4", + graphic = + { + value = syncFileNameValue, + imageType = "DYNAMIC" + }, + softButtons = + { + { + text = "Close", + systemAction = "KEEP_CONTEXT", + type = "BOTH", + isHighlighted = true, + image = + { + imageType = "DYNAMIC", + value = syncFileNameValue + }, + softButtonID = 1 + } + }, + secondaryGraphic = + { + value = syncFileNameValue, + imageType = "DYNAMIC" + }, + statusBar = "status bar", + mediaTrack = "Media Track", + alignment = "CENTERED", + customPresets = + { + "Preset1", + "Preset2", + "Preset3" + } + } + + return temp +end + +--Description: Set expected parameter for Show request + --syncFileNameValue: image file name will be use to Show + --pathToStorage: path to storage where will be used to store image +function f.exShowAllParams(syncFileNameValue, pathToStorage) + local temp = { + alignment = "CENTERED", + customPresets = + { + "Preset1", + "Preset2", + "Preset3" + }, + graphic = + { + imageType = "DYNAMIC", + value = pathToStorage..syncFileNameValue + }, + secondaryGraphic = + { + imageType = "DYNAMIC", + value = pathToStorage..syncFileNameValue + }, + showStrings = + { + { + fieldName = "mainField1", + fieldText = "Show Line 1" + }, + { + fieldName = "mainField2", + fieldText = "Show Line 2" + }, + { + fieldName = "mainField3", + fieldText = "Show Line 3" + }, + { + fieldName = "mainField4", + fieldText = "Show Line 4" + }, + { + fieldName = "mediaClock", + fieldText = "12:34" + }, + { + fieldName = "mediaTrack", + fieldText = "Media Track" + }, + { + fieldName = "statusBar", + fieldText = "status bar" + } + }, + softButtons = + { + { + text = "Close", + systemAction = "KEEP_CONTEXT", + type = "BOTH", + isHighlighted = true, + image = + { + imageType = "DYNAMIC", + value = pathToStorage..syncFileNameValue + }, + softButtonID = 1 + } + } + } + + return temp +end + +--Description: PutFile successfully + --paramsSend: Parameters will be sent to SDL + --file: path to file will be used to send to SDL +function Test:putFile(paramsSend, file) + local cid + if file ~= nil then + cid = mobileSession:SendRPC("PutFile",paramsSend, file) + else + cid = mobileSession:SendRPC("PutFile",paramsSend, "files/icon.png") + end + + EXPECT_RESPONSE(cid, { success = true, resultCode = SUCCESS }) +end + +--Description: Check file will be put to appropriate SDL application folder. + --fileName: File reference name. + --file: path to file will be used to send to SDL +function Test:putFileToStorage(fileName, file) + local paramsSend = putFileAllParams() + paramsSend.syncFileName = fileName + + --mobile side: sending PutFile request + local cid = mobileSession:SendRPC("PutFile",paramsSend, "files/"..file) + + --mobile side: expected PutFile response + mobileSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) + :ValidIf (function(_,data) + --SDL store FileName_1 into sub-directory of AppStorageFolder related to app + if file_check(storagePath..fileName) ~= true then + print(" \27[36m Can not found file: "..fileName.." \27[0m ") + return false + else + return true + end + end) +end + +local function setAppIcon(params, self) + local cid = self.mobileSession:SendRPC("SetAppIcon", params.requestParams) + params.requestUiParams.appID = commonSmoke.getHMIAppId() + EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) + :Do(function(_, data) + self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) + end) + self.mobileSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) +end From a4732abf3b19ce1cc91b47736b86f3091fb9ece9 Mon Sep 17 00:00:00 2001 From: Halyna Savynetska Date: Mon, 12 Mar 2018 17:18:39 +0200 Subject: [PATCH 19/30] Changed commonSetAppIcon --- test_scripts/API/commonSetAppIcon.lua | 160 +------------------------- 1 file changed, 6 insertions(+), 154 deletions(-) diff --git a/test_scripts/API/commonSetAppIcon.lua b/test_scripts/API/commonSetAppIcon.lua index 6aab1be2cf..f64e8186a3 100644 --- a/test_scripts/API/commonSetAppIcon.lua +++ b/test_scripts/API/commonSetAppIcon.lua @@ -8,14 +8,10 @@ config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local actions = require("user_modules/sequences/actions") local utils = require("user_modules/utils") -local Test = require('user_modules/connecttest_PutFile') -local commonSmoke = require('test_scripts/Smoke/commonSmoke') - +local test = require('user_modules/connecttest_PutFile') --[[ Module ]] local m = actions -local f = Test -local u = commonSmoke --[[ Variables ]] local ptuTable = {} @@ -53,15 +49,15 @@ function m.registerApp(pAppId, pIconResumed) end) end -function u.unregisterAppInterface(pAppId, pIconResumed) +function m.unregisterAppInterface(pAppId, pIconResumed) local corId = mobileSession:SendRPC("UnregisterAppInterface", { }) EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", - { appID = commonSmoke.getHMIAppId(), unexpectedDisconnect = false }) + { appID = getHMIAppId(), unexpectedDisconnect = false }) mobileSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) end --Description: Set all parameter for PutFile -function f.putFileAllParams() +function m.putFileAllParams() local temp = { syncFileName ="icon.png", fileType ="GRAPHIC_PNG", @@ -73,131 +69,10 @@ function f.putFileAllParams() return temp end ---Description: Set all parameter for Show - --syncFileNameValue: image file name will be use to Show -function f.showAllParams(syncFileNameValue) - local temp = { - mediaClock = "12:34", - mainField1 = "Show Line 1", - mainField2 = "Show Line 2", - mainField3 = "Show Line 3", - mainField4 = "Show Line 4", - graphic = - { - value = syncFileNameValue, - imageType = "DYNAMIC" - }, - softButtons = - { - { - text = "Close", - systemAction = "KEEP_CONTEXT", - type = "BOTH", - isHighlighted = true, - image = - { - imageType = "DYNAMIC", - value = syncFileNameValue - }, - softButtonID = 1 - } - }, - secondaryGraphic = - { - value = syncFileNameValue, - imageType = "DYNAMIC" - }, - statusBar = "status bar", - mediaTrack = "Media Track", - alignment = "CENTERED", - customPresets = - { - "Preset1", - "Preset2", - "Preset3" - } - } - - return temp -end - ---Description: Set expected parameter for Show request - --syncFileNameValue: image file name will be use to Show - --pathToStorage: path to storage where will be used to store image -function f.exShowAllParams(syncFileNameValue, pathToStorage) - local temp = { - alignment = "CENTERED", - customPresets = - { - "Preset1", - "Preset2", - "Preset3" - }, - graphic = - { - imageType = "DYNAMIC", - value = pathToStorage..syncFileNameValue - }, - secondaryGraphic = - { - imageType = "DYNAMIC", - value = pathToStorage..syncFileNameValue - }, - showStrings = - { - { - fieldName = "mainField1", - fieldText = "Show Line 1" - }, - { - fieldName = "mainField2", - fieldText = "Show Line 2" - }, - { - fieldName = "mainField3", - fieldText = "Show Line 3" - }, - { - fieldName = "mainField4", - fieldText = "Show Line 4" - }, - { - fieldName = "mediaClock", - fieldText = "12:34" - }, - { - fieldName = "mediaTrack", - fieldText = "Media Track" - }, - { - fieldName = "statusBar", - fieldText = "status bar" - } - }, - softButtons = - { - { - text = "Close", - systemAction = "KEEP_CONTEXT", - type = "BOTH", - isHighlighted = true, - image = - { - imageType = "DYNAMIC", - value = pathToStorage..syncFileNameValue - }, - softButtonID = 1 - } - } - } - - return temp -end - --Description: PutFile successfully --paramsSend: Parameters will be sent to SDL --file: path to file will be used to send to SDL -function Test:putFile(paramsSend, file) +function test:putFile(paramsSend, file) local cid if file ~= nil then cid = mobileSession:SendRPC("PutFile",paramsSend, file) @@ -208,32 +83,9 @@ function Test:putFile(paramsSend, file) EXPECT_RESPONSE(cid, { success = true, resultCode = SUCCESS }) end ---Description: Check file will be put to appropriate SDL application folder. - --fileName: File reference name. - --file: path to file will be used to send to SDL -function Test:putFileToStorage(fileName, file) - local paramsSend = putFileAllParams() - paramsSend.syncFileName = fileName - - --mobile side: sending PutFile request - local cid = mobileSession:SendRPC("PutFile",paramsSend, "files/"..file) - - --mobile side: expected PutFile response - mobileSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) - :ValidIf (function(_,data) - --SDL store FileName_1 into sub-directory of AppStorageFolder related to app - if file_check(storagePath..fileName) ~= true then - print(" \27[36m Can not found file: "..fileName.." \27[0m ") - return false - else - return true - end - end) -end - local function setAppIcon(params, self) local cid = self.mobileSession:SendRPC("SetAppIcon", params.requestParams) - params.requestUiParams.appID = commonSmoke.getHMIAppId() + params.requestUiParams.appID = getHMIAppId() EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) :Do(function(_, data) self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) From cabca8be1d10a126dda1111f76fd94d6b562f25b Mon Sep 17 00:00:00 2001 From: Halyna Savynetska Date: Tue, 13 Mar 2018 18:43:17 +0200 Subject: [PATCH 20/30] Update common --- test_scripts/API/commonSetAppIcon.lua | 46 ++++++++++++++++++--------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/test_scripts/API/commonSetAppIcon.lua b/test_scripts/API/commonSetAppIcon.lua index f64e8186a3..688a2bad4d 100644 --- a/test_scripts/API/commonSetAppIcon.lua +++ b/test_scripts/API/commonSetAppIcon.lua @@ -8,7 +8,7 @@ config.defaultProtocolVersion = 2 --[[ Required Shared libraries ]] local actions = require("user_modules/sequences/actions") local utils = require("user_modules/utils") -local test = require('user_modules/connecttest_PutFile') +local test = require("user_modules/dummy_connecttest") --[[ Module ]] local m = actions @@ -49,15 +49,19 @@ function m.registerApp(pAppId, pIconResumed) end) end -function m.unregisterAppInterface(pAppId, pIconResumed) - local corId = mobileSession:SendRPC("UnregisterAppInterface", { }) +--Description: unregisterAppInterface successfully + --pAppId - application number (1, 2, etc.) +function m.unregisterAppInterface(pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local corId = mobSession:SendRPC("UnregisterAppInterface", { }) EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", - { appID = getHMIAppId(), unexpectedDisconnect = false }) - mobileSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) + { appID = m.getHMIAppId(), unexpectedDisconnect = false }) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) end --Description: Set all parameter for PutFile -function m.putFileAllParams() +local function putFileAllParams() local temp = { syncFileName ="icon.png", fileType ="GRAPHIC_PNG", @@ -72,23 +76,35 @@ end --Description: PutFile successfully --paramsSend: Parameters will be sent to SDL --file: path to file will be used to send to SDL -function test:putFile(paramsSend, file) + --pAppId - application number (1, 2, etc.) +function m.putFile(paramsSend, file, pAppId) + if paramsSend then + paramsSend = paramsSend + else paramsSend = putFileAllParams() + end + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) local cid if file ~= nil then - cid = mobileSession:SendRPC("PutFile",paramsSend, file) + cid = mobSession:SendRPC("PutFile",paramsSend, file) else - cid = mobileSession:SendRPC("PutFile",paramsSend, "files/icon.png") + cid = mobSession:SendRPC("PutFile",paramsSend, "files/icon.png") end - EXPECT_RESPONSE(cid, { success = true, resultCode = SUCCESS }) + EXPECT_RESPONSE(cid, { success = true, resultCode = "SUCCESS" }) end -local function setAppIcon(params, self) - local cid = self.mobileSession:SendRPC("SetAppIcon", params.requestParams) - params.requestUiParams.appID = getHMIAppId() +--Description: setAppIcon successfully + --paramsSend: Parameters will be sent to SDL + --pAppId - application number (1, 2, etc.) +function m.setAppIcon(params, pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) + params.requestUiParams.appID = m.getHMIAppId() EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) :Do(function(_, data) - self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) end) - self.mobileSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) + mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) end From f9eb4da1f53e654a742e935c89e25f79efa09ad9 Mon Sep 17 00:00:00 2001 From: Halyna Savynetska Date: Wed, 14 Mar 2018 12:45:48 +0200 Subject: [PATCH 21/30] Test script for the first checklist item --- .../001_Mobile_app_First_Registration.lua | 99 ++++++++++++++++ .../API/SetAppIcon/commonSetAppIcon.lua | 111 ++++++++++++++++++ 2 files changed, 210 insertions(+) create mode 100644 test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua create mode 100644 test_scripts/API/SetAppIcon/commonSetAppIcon.lua diff --git a/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua new file mode 100644 index 0000000000..c4057bd7f5 --- /dev/null +++ b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua @@ -0,0 +1,99 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story: +-- Use case: +-- Item: +-- +-- Description: TRS: GetInteriorVehicleData, #3 +-- In case: +--1) SDL, HMI are started. +--2) Mobile app registers first time. +--SDL does: Successfully registers application and responds with result code "SUCCESS" and "iconResumed" = false" to mobile application. +-- Default icon is set for application" +--------------------------------------------------------------------------------------------------- +--[[ General Precondition before ATF start ]] +config.defaultProtocolVersion = 2 + +-- [[ Required Shared Libraries ]] +local commonFunctions = require('user_modules/shared_testcases/commonFunctions') +local commonSteps = require('user_modules/shared_testcases/commonSteps') +local mobile_session = require('mobile_session') +local test = require('user_modules/dummy_connecttest') + + +--[[ General Settings for configuration ]] +require('cardinalities') +require('user_modules/AppTypes') + +-- [[Local variables]] +local default_app_params = config.application1.registerAppInterfaceParams + +--[[ Preconditions ]] +commonFunctions:newTestCasesGroup("Preconditions") +commonSteps:DeletePolicyTable() +commonSteps:DeleteLogsFiles() + +--[[ Test ]] +commonFunctions:newTestCasesGroup("Test") + +function test:Start_SDL() + self:runSDL() + commonFunctions:waitForSDLStart(self):Do(function() + self:initHMI():Do(function() + commonFunctions:userPrint(35, "HMI initialized") + self:initHMI_onReady():Do(function () + commonFunctions:userPrint(35, "HMI is ready") + self:connectMobile():Do(function () + commonFunctions:userPrint(35, "Mobile Connected") + end) + end) + end) + end) +end + +local function FirstRegistration() + local corId = mobileSession:SendRPC("RegisterAppInterface", + { + syncMsgVersion = + { + majorVersion = 3, + minorVersion = 0, + }, + appName ="SyncProxyTester", + isMediaApplication = true, + languageDesired = "EN-US", + hmiDisplayLanguageDesired ="EN-US", + appID ="123456", + iconResumed = false, + }) + EXPECT_HMINOTIFICATION("BasicCommunication.OnAppRegistered", + { + application = + { + appName = "SyncProxyTester", + policyAppID = "123456", + hmiDisplayLanguageDesired ="EN-US", + isMediaApplication = true, + iconResumed = false + } + }) + :Do (function (_,data) + application["SyncProxyTester"] = data.params.application.appID + end) + --mobile side: RegisterAppInterface response + EXPECT_RESPONSE(corId, { success = true, resultCode = "SUCCESS", iconResumed = false, + { + majorVersion = 3, + minorVersion = 0, + }, + }) + + end + +-- [[ Postconditions ]] +commonFunctions:newTestCasesGroup("Postcondition") +function test.Stop_SDL() + StopSDL() +end + +return Test \ No newline at end of file diff --git a/test_scripts/API/SetAppIcon/commonSetAppIcon.lua b/test_scripts/API/SetAppIcon/commonSetAppIcon.lua new file mode 100644 index 0000000000..6f12372bc5 --- /dev/null +++ b/test_scripts/API/SetAppIcon/commonSetAppIcon.lua @@ -0,0 +1,111 @@ +--------------------------------------------------------------------------------------------------- +-- Common module +--------------------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------------------- +--[[ General configuration parameters ]] +config.defaultProtocolVersion = 2 + +--[[ Required Shared libraries ]] +local actions = require("user_modules/sequences/actions") +local utils = require("user_modules/utils") +local test = require("user_modules/dummy_connecttest") + +--[[ Module ]] +local m = actions + +--[[ Variables ]] +local ptuTable = {} +local hmiAppIds = {} + +--[[ @registerApp: register mobile application +--! @parameters: +--! pAppId - application number (1, 2, etc.) +--! pIconResumed - Existence of apps icon at system +--! @return: none +--]] +function m.registerApp(pAppId, pIconResumed) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + mobSession:StartService(7) + :Do(function() + local corId = mobSession:SendRPC("RegisterAppInterface", m.getConfigAppParams(pAppId)) + test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", + { application = { appName = m.getConfigAppParams(pAppId).appName } }) + :Do(function(_, d1) + hmiAppIds[m.getConfigAppParams(pAppId).appID] = d1.params.application.appID + test.hmiConnection:ExpectNotification("SDL.OnStatusUpdate", { status = "UPDATE_NEEDED" }, { status = "UPDATING" }) + :Times(2) + test.hmiConnection:ExpectRequest("BasicCommunication.PolicyUpdate") + :Do(function(_, d2) + test.hmiConnection:SendResponse(d2.id, d2.method, "SUCCESS", { }) + ptuTable = utils.jsonFileToTable(d2.params.file) + end) + end) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) + :Do(function() + mobSession:ExpectNotification("OnHMIStatus", + { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) + mobSession:ExpectNotification("OnPermissionsChange") + end) + end) +end + +--Description: unregisterAppInterface successfully + --pAppId - application number (1, 2, etc.) +function m.unregisterAppInterface(pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local corId = mobSession:SendRPC("UnregisterAppInterface", { }) + EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", + { appID = m.getHMIAppId(), unexpectedDisconnect = false }) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) +end + +--Description: Set all parameter for PutFile +local function putFileAllParams() + local temp = { + syncFileName ="icon.png", + fileType ="GRAPHIC_PNG", + persistentFile =false, + systemFile = false, + offset =0, + length =11600 + } + return temp +end + +--Description: PutFile successfully + --paramsSend: Parameters will be sent to SDL + --file: path to file will be used to send to SDL + --pAppId - application number (1, 2, etc.) +function m.putFile(paramsSend, file, pAppId) + if paramsSend then + paramsSend = paramsSend + else paramsSend = putFileAllParams() + end + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local cid + if file ~= nil then + cid = mobSession:SendRPC("PutFile",paramsSend, file) + else + cid = mobSession:SendRPC("PutFile",paramsSend, "files/icon.png") + end + + EXPECT_RESPONSE(cid, { success = true, resultCode = "SUCCESS" }) +end + +--Description: setAppIcon successfully + --paramsSend: Parameters will be sent to SDL + --pAppId - application number (1, 2, etc.) +function m.setAppIcon(params, pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) + params.requestUiParams.appID = m.getHMIAppId() + EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) + :Do(function(_, data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) + end) + mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) +end From 6d57d79790d8a52f2a0a91e2bfed10b74d7085d8 Mon Sep 17 00:00:00 2001 From: Halyna Savynetska Date: Thu, 15 Mar 2018 12:55:17 +0200 Subject: [PATCH 22/30] Test_scripts 15.03.2018 --- .../001_Mobile_app_First_Registration.lua | 111 +++------------- ...gistration_with_param_iconResumed=true.lua | 54 ++++++++ test_scripts/API/SetAppIcon/comSetApp.lua | 125 ++++++++++++++++++ 3 files changed, 200 insertions(+), 90 deletions(-) create mode 100644 test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed=true.lua create mode 100644 test_scripts/API/SetAppIcon/comSetApp.lua diff --git a/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua index c4057bd7f5..6bd1857b6f 100644 --- a/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua +++ b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua @@ -1,99 +1,30 @@ --------------------------------------------------------------------------------------------------- -- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md --- User story: --- Use case: --- Item: +-- User story:TBD +-- Use case:TBD -- --- Description: TRS: GetInteriorVehicleData, #3 +-- Requirement summary: +-- TBD +-- Description: -- In case: ---1) SDL, HMI are started. ---2) Mobile app registers first time. ---SDL does: Successfully registers application and responds with result code "SUCCESS" and "iconResumed" = false" to mobile application. --- Default icon is set for application" +-- 1) SDL, HMI are started. +-- 2) Mobile app registers first time. +-- SDL does: Successfully registers application and responds with result code "SUCCESS" and "iconResumed" = false" to mobile application. --------------------------------------------------------------------------------------------------- ---[[ General Precondition before ATF start ]] -config.defaultProtocolVersion = 2 +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') --- [[ Required Shared Libraries ]] -local commonFunctions = require('user_modules/shared_testcases/commonFunctions') -local commonSteps = require('user_modules/shared_testcases/commonSteps') -local mobile_session = require('mobile_session') -local test = require('user_modules/dummy_connecttest') +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) ---[[ General Settings for configuration ]] -require('cardinalities') -require('user_modules/AppTypes') +runner.Title("Test") +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) --- [[Local variables]] -local default_app_params = config.application1.registerAppInterfaceParams - ---[[ Preconditions ]] -commonFunctions:newTestCasesGroup("Preconditions") -commonSteps:DeletePolicyTable() -commonSteps:DeleteLogsFiles() - ---[[ Test ]] -commonFunctions:newTestCasesGroup("Test") - -function test:Start_SDL() - self:runSDL() - commonFunctions:waitForSDLStart(self):Do(function() - self:initHMI():Do(function() - commonFunctions:userPrint(35, "HMI initialized") - self:initHMI_onReady():Do(function () - commonFunctions:userPrint(35, "HMI is ready") - self:connectMobile():Do(function () - commonFunctions:userPrint(35, "Mobile Connected") - end) - end) - end) - end) -end - -local function FirstRegistration() - local corId = mobileSession:SendRPC("RegisterAppInterface", - { - syncMsgVersion = - { - majorVersion = 3, - minorVersion = 0, - }, - appName ="SyncProxyTester", - isMediaApplication = true, - languageDesired = "EN-US", - hmiDisplayLanguageDesired ="EN-US", - appID ="123456", - iconResumed = false, - }) - EXPECT_HMINOTIFICATION("BasicCommunication.OnAppRegistered", - { - application = - { - appName = "SyncProxyTester", - policyAppID = "123456", - hmiDisplayLanguageDesired ="EN-US", - isMediaApplication = true, - iconResumed = false - } - }) - :Do (function (_,data) - application["SyncProxyTester"] = data.params.application.appID - end) - --mobile side: RegisterAppInterface response - EXPECT_RESPONSE(corId, { success = true, resultCode = "SUCCESS", iconResumed = false, - { - majorVersion = 3, - minorVersion = 0, - }, - }) - - end - --- [[ Postconditions ]] -commonFunctions:newTestCasesGroup("Postcondition") -function test.Stop_SDL() - StopSDL() -end - -return Test \ No newline at end of file +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed=true.lua b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed=true.lua new file mode 100644 index 0000000000..7b2a2d77d4 --- /dev/null +++ b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed=true.lua @@ -0,0 +1,54 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. +-- 3) 3) Mobile app is re-registered. +-- SDL does: +-- 1) Successfully registers application. +-- 2) Successful processes PutFile and SetAppIcon requests. +-- 3) SDL responds with result code "SUCCESS" and "iconResumed" = true for RAI request. +-- 4) SDL sends to HMI OnAppRegistered notification "icon" and notifies that apps icon exists. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.png" +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName) + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/comSetApp.lua b/test_scripts/API/SetAppIcon/comSetApp.lua new file mode 100644 index 0000000000..f753dd1fe4 --- /dev/null +++ b/test_scripts/API/SetAppIcon/comSetApp.lua @@ -0,0 +1,125 @@ +--------------------------------------------------------------------------------------------------- +-- Common module +--------------------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------------------- +--[[ General configuration parameters ]] +config.defaultProtocolVersion = 2 + +--[[ Required Shared libraries ]] +local actions = require("user_modules/sequences/actions") +local utils = require("user_modules/utils") +local test = require("user_modules/dummy_connecttest") +local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') + +--[[ Module ]] +local m = actions + +--[[ Variables ]] +local ptuTable = {} +local hmiAppIds = {} + +--[[ @registerApp: register mobile application +--! @parameters: +--! pAppId - application number (1, 2, etc.) +--! pIconResumed - Existence of apps icon at system +--! @return: none +--]] +function m.registerApp(pAppId, pIconResumed, pReconnection) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local function RegisterApp() + local corId = mobSession:SendRPC("RegisterAppInterface", + config["application" .. pAppId].registerAppInterfaceParams) + test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", + { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) + :Do(function(_, d1) + hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID + end) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) + :Do(function() + mobSession:ExpectNotification("OnHMIStatus", + { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) + mobSession:ExpectNotification("OnPermissionsChange") + end) + end + if pReconnection == true then + RegisterApp() + else + mobSession:StartService(7) + :Do(function() + RegisterApp() + end) + end +end + +--Description: unregisterAppInterface successfully + --pAppId - application number (1, 2, etc.) +function m.unregisterAppInterface(pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local corId = mobSession:SendRPC("UnregisterAppInterface", { }) + EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", + { appID = m.getHMIAppId(), unexpectedDisconnect = false }) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) +end + +--Description: Set all parameter for PutFile +local function putFileAllParams() + local temp = { + syncFileName = "icon.png", + fileType = "GRAPHIC_PNG", + persistentFile = false, + systemFile = false, + offset = 0, + length = 11600 + } + return temp +end + +--Description: PutFile successfully + --paramsSend: Parameters will be sent to SDL + --file: path to file will be used to send to SDL + --pAppId - application number (1, 2, etc.) +function m.putFile(paramsSend, file, pAppId) + if paramsSend then + paramsSend = paramsSend + else paramsSend = putFileAllParams() + end + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local cid + if file ~= nil then + cid = mobSession:SendRPC("PutFile",paramsSend, file) + else + cid = mobSession:SendRPC("PutFile",paramsSend, "files/icon.png") + end + + mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) +end + +function m.getPathToFileInStorage(fileName) + return commonPreconditions:GetPathToSDL() .. "storage/" + .. m.getAppID() .. "_" + .. utils.getDeviceMAC() .. "/" .. fileName +end + +--Description: setAppIcon successfully + --paramsSend: Parameters will be sent to SDL + --pAppId - application number (1, 2, etc.) +function m.setAppIcon(params, pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) + params.requestUiParams.appID = m.getHMIAppId() + EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) + :Do(function(_, data) + m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) + end) + mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) +end + +function m.connectMobile() + test:connectMobile() +end + +return m From ae62474ad37040029d703a1635ba71fc86a9fe75 Mon Sep 17 00:00:00 2001 From: HSavynetska Date: Wed, 28 Mar 2018 13:39:56 +0300 Subject: [PATCH 23/30] Test_scripts_for_iconResumed --- ...gistration_with_param_iconResumed_true.lua | 54 +++++++++++++++ ...obile_application_is_OnAppUnregistered.lua | 53 +++++++++++++++ ...emove_icon_and_reregistered_Mobile_app.lua | 65 ++++++++++++++++++ ...conResumed_true.App2_iconResumed_false.lua | 54 +++++++++++++++ ...iconResumed_true_App2_iconResumed_true.lua | 59 ++++++++++++++++ ...nd_to_SetAppIcon_request_GENERIC_ERROR.lua | 66 ++++++++++++++++++ ...eived_response_SetAppIcon_INVALID_DATA.lua | 68 +++++++++++++++++++ ...eceived_response_SetAppIcon_DISALLOWED.lua | 68 +++++++++++++++++++ ..._received_response_SetAppIcon_REJECTED.lua | 68 +++++++++++++++++++ ...p_re_sets_custom_icon_iconResumed_true.lua | 61 +++++++++++++++++ test_scripts/API/SetAppIcon/comSetApp.lua | 34 +++++++++- 11 files changed, 648 insertions(+), 2 deletions(-) create mode 100644 test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua create mode 100644 test_scripts/API/SetAppIcon/003_Mobile_application_is_OnAppUnregistered.lua create mode 100644 test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua create mode 100644 test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua create mode 100644 test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua create mode 100644 test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua create mode 100644 test_scripts/API/SetAppIcon/008_Mobile_App _received_response_SetAppIcon_INVALID_DATA.lua create mode 100644 test_scripts/API/SetAppIcon/009_Mobile_App _received_response_SetAppIcon_DISALLOWED.lua create mode 100644 test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua create mode 100644 test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true.lua diff --git a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua new file mode 100644 index 0000000000..7b0bc0dd70 --- /dev/null +++ b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua @@ -0,0 +1,54 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. +-- 3) Mobile app is re-registered. +-- SDL does: +-- 1) Successfully registers application. +-- 2) Successful processes PutFile and SetAppIcon requests. +-- 3) SDL responds with result code "SUCCESS" and "iconResumed" = true for RAI request. +-- 4) SDL sends to HMI OnAppRegistered notification "icon" and notifies that apps icon exists. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.png" +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName) + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/003_Mobile_application_is_OnAppUnregistered.lua b/test_scripts/API/SetAppIcon/003_Mobile_application_is_OnAppUnregistered.lua new file mode 100644 index 0000000000..b69cc75d11 --- /dev/null +++ b/test_scripts/API/SetAppIcon/003_Mobile_application_is_OnAppUnregistered.lua @@ -0,0 +1,53 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. +-- 3) Mobile application is OnAppUnregistered +-- 4) Mobile app is re-registered. +-- SDL does: +-- 1) 1) SDL respons with result code "SUCCESS" and "iconResumed" = true for RAI request. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') +Test = require('user_modules/connecttest_OnAppUnregistered') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.png" +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName) + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("App OnAppUnregistered", common.unregisterAppInterface, { 1 }) +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua new file mode 100644 index 0000000000..b794678386 --- /dev/null +++ b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua @@ -0,0 +1,65 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. +-- 3) Remove Icon for mobile app from the file system +-- 4) Mobile app is re-registered, mobile app is registered. +-- SDL does: +-- 1) SDL respons with result code "SUCCESS" and "iconResumed" = false for RAI request. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.png" +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName) + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +--[[ Local Functions ]] +local function deleteFile(params) + local cid = mobileSession1:SendRPC("DeleteFile", params.requestParams) + + params.responseBcParams.appID = commonSetApp.getHMIAppId() + params.responseBcParams.fileName = + commonSetApp.getPathToFileInStorage(params.responseBcParams.fileName) + EXPECT_HMINOTIFICATION("BasicCommunication.OnFileRemoved", params.responseBcParams) + + mobileSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS"}) +end + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("Remove Icon for mobile app from the file system", deleteFile, { "icon.png", 1 }) +runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false, false }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua new file mode 100644 index 0000000000..2494b9f19f --- /dev/null +++ b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua @@ -0,0 +1,54 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) App1 set custom icon via putfile and SetAppIcon requests and is re-registered with resuming custom icon( "iconResumed" = true). +-- 3) Mobile App2 registered. +-- SDL does: +-- 1) Registers App1 successfully registered and sets its app icon, +-- responds to RAI with result code "SUCCESS", "iconResumed" = true +-- 2) Registers an App 2 with default icon, "iconResumed" = false +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.png" +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName) + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("App1 unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App2 registration with iconresumed = false", common.registerApp, { 1, false, true }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua new file mode 100644 index 0000000000..6e773504f3 --- /dev/null +++ b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua @@ -0,0 +1,59 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) Mobile app is registered. Sends PutFile and invalid SetAppIcon requests. +-- 3) Mobile App received response SetAppIcon(INVALID_DATA). Custom Icon is not set. +-- 4) App is re-registered. +-- SDL does: +-- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.png" +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName) + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) + +runner.Step("App2 registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("App1 unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App2 unregistration", common.unregisterAppInterface, { 1 }) + +runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App2 registration with iconresumed = true", common.registerApp, { 1, true, true }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua b/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua new file mode 100644 index 0000000000..c0859fada5 --- /dev/null +++ b/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua @@ -0,0 +1,66 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) Mobile app is registered. Sends PutFile and SetAppIcon requests. +-- 3) HMI is not respond to SetAppIcon request. Mobile App received response SetAppIcon(GENERIC_ERROR). +-- 4) App is re-registered. +-- SDL does: +-- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.png" +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName) + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +local function setAppIcon_GENERIC_ERROR(params, pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) + params.requestUiParams.appID = m.getHMIAppId() + EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) + :Do(function(_, _) + -- HMI does not respond + end) + + mobSession:ExpectResponse(cid, { success = false, resultCode = "GENERIC_ERROR" }) +end + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("HMI does not respond", setAppIcon_GENERIC_ERROR, { 1, false }) +runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false, true }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/008_Mobile_App _received_response_SetAppIcon_INVALID_DATA.lua b/test_scripts/API/SetAppIcon/008_Mobile_App _received_response_SetAppIcon_INVALID_DATA.lua new file mode 100644 index 0000000000..3fdca36143 --- /dev/null +++ b/test_scripts/API/SetAppIcon/008_Mobile_App _received_response_SetAppIcon_INVALID_DATA.lua @@ -0,0 +1,68 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) Mobile app is registered. Sends PutFile and invalid SetAppIcon requests. +-- 3) Mobile App received response SetAppIcon(INVALID_DATA). Custom Icon is not set. +-- 4) App is re-registered. +-- SDL does: +-- 1) Successfully registers application. +-- 2) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') +local commonTestCases = require("user_modules/shared_testcases/commonTestCases") + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.pngd" -- -- invalid type of parameter +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +local function setAppIcon_INVALID_DATA(params, pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) + params.requestUiParams.appID = m.getHMIAppId() + + EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) + :Times(0) + + mobSession:ExpectResponse(cid, { success = false, resultCode = "INVALID_DATA" }) + commonTestCases:DelayedExp(comSetApp.timeout) +end + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("Gets_INVALID_DATA", setAppIcon_INVALID_DATA, { false, 1 } ) +runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false, false }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/009_Mobile_App _received_response_SetAppIcon_DISALLOWED.lua b/test_scripts/API/SetAppIcon/009_Mobile_App _received_response_SetAppIcon_DISALLOWED.lua new file mode 100644 index 0000000000..0c3cd8bbc4 --- /dev/null +++ b/test_scripts/API/SetAppIcon/009_Mobile_App _received_response_SetAppIcon_DISALLOWED.lua @@ -0,0 +1,68 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) SetAppIcon does not exist in app's assigned policies. +-- 3) Mobile app is registered. Sends PutFile and valid SetAppIcon requests. +-- 4) Mobile app received response SetAppIcon(DISALLOWED) +-- 5) Mobile app is re-registered. +-- SDL does: +-- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.png" +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +--[[ Local Functions ]] +local function setAppIcon_DISALLOWED(params, pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) + params.requestUiParams.appID = m.getHMIAppId() + EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) + :Times(0) + mobSession:ExpectResponse(cid, { success = false, resultCode = "DISALLOWED" }) +end + +local function updatePTU(tbl) + tbl.policy_table.app_policies[config.application.registerAppInterfaceParams.appID]. ImageFieldName = { "appIcon" } + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", setAppIcon, { allParams } ) +runner.Step("Mobile App received response SetAppIcon(DISALLOWED)", setAppIcon_DISALLOWED, { false, 1 } ) +runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false, true }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua b/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua new file mode 100644 index 0000000000..9820173768 --- /dev/null +++ b/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua @@ -0,0 +1,68 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) Mobile app is registered. Sends PutFile and valid SetAppIcon requests. +-- 3) HMI responds with REJECTED resultCode to SetAppIcon request. Mobile App received response SetAppIcon(REJECTED). +-- 4) App is re-registered. +-- SDL does: +-- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.png" +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +--[[ Local Functions ]] +local function setAppIcon_resultCode_REJECTED(params, pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) + params.requestUiParams.appID = m.getHMIAppId() + EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) + :Times(0) + :Do(function(_,data) + -- sending UI.SetAppIcon response + m.getHMIConnection():SendResponse(data.id, data.method, "REJECTED", {}) + end) + mobSession:ExpectResponse(cid, { success = false, resultCode = "REJECTED" }) +end + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("Mobile App received response SetAppIcon(REJECTED)", setAppIcon_resultCode_REJECTED, { false, 1 } ) +runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false, true }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) \ No newline at end of file diff --git a/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true.lua b/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true.lua new file mode 100644 index 0000000000..285c86a5c0 --- /dev/null +++ b/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true.lua @@ -0,0 +1,61 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. +-- 3) App re-sets custom icon via sending PutFile and valid SetAppIcon request. +-- 4) App is re-registered. +-- SDL does: +-- 1) Successfully registers application +-- 2) Successful processes PutFile and SetAppIcon requests. +-- 3) SDL respons with result code "SUCCESS" and "iconResumed" = true for RAI request. Corresponding custom icon is resumed. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.png" +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, true, true }) +runner.Step("Upload icon file1", common.putFile) +runner.Step("SetAppIcon1", common.setAppIcon, { allParams } ) + +runner.Step("Upload icon file2", common.putFile) +runner.Step("SetAppIcon2", common.setAppIcon, { allParams } ) + +runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) \ No newline at end of file diff --git a/test_scripts/API/SetAppIcon/comSetApp.lua b/test_scripts/API/SetAppIcon/comSetApp.lua index f753dd1fe4..d9a054f614 100644 --- a/test_scripts/API/SetAppIcon/comSetApp.lua +++ b/test_scripts/API/SetAppIcon/comSetApp.lua @@ -10,6 +10,8 @@ local actions = require("user_modules/sequences/actions") local utils = require("user_modules/utils") local test = require("user_modules/dummy_connecttest") local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') +local commonFunctions = require('user_modules/shared_testcases/commonFunctions') --add +local commonTestCases = require('user_modules/shared_testcases/commonTestCases') --add --[[ Module ]] local m = actions @@ -24,14 +26,21 @@ local hmiAppIds = {} --! pIconResumed - Existence of apps icon at system --! @return: none --]] -function m.registerApp(pAppId, pIconResumed, pReconnection) +function m.registerApp(pAppId, pIconResumed, pReconnection, pIcon) if not pAppId then pAppId = 1 end + if not pIcon then pIcon = "icon.png" end local mobSession = m.getMobileSession(pAppId) local function RegisterApp() local corId = mobSession:SendRPC("RegisterAppInterface", config["application" .. pAppId].registerAppInterfaceParams) + local iconValue + if pIconResumed == true then + iconValue = m.getPathToFileInStorage(pIcon) + elseif pIconResumed == false then + iconValue = "" + end test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", - { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) + { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName, icon = iconValue } }) :Do(function(_, d1) hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID end) @@ -52,6 +61,19 @@ function m.registerApp(pAppId, pIconResumed, pReconnection) end end +--function m.DeleteFile( pIcon, pAppId ) + --local mobSession = m.getMobileSession(pAppId) + --local cid = mobSession:SendRPC("DeleteFile", + --{ syncFileName = pIcon }) + ---EXPECT_HMINOTIFICATION("BasicCommunication.OnFileRemoved", + --{ + --fileName = pIcon, + --fileType = "GRAPHIC_PNG", + --appID = 1 }) + --mobSession:ExpectResponse( cid, { success = true, resultCode = "SUCCESS", info = nil }) +--end + + --Description: unregisterAppInterface successfully --pAppId - application number (1, 2, etc.) function m.unregisterAppInterface(pAppId) @@ -97,6 +119,8 @@ function m.putFile(paramsSend, file, pAppId) mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) end + + function m.getPathToFileInStorage(fileName) return commonPreconditions:GetPathToSDL() .. "storage/" .. m.getAppID() .. "_" @@ -116,6 +140,12 @@ function m.setAppIcon(params, pAppId) m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) end) mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) + :Do(function(_, _) + -- HMI does not respond + end) + mobSession:ExpectResponse(cid, { success = false, resultCode = "GENERIC_ERROR"}) + + commonTestCases:DelayedExp(11000) end function m.connectMobile() From 91ebeb8cd41a6e90d1296d7106f6fac9e447ed2a Mon Sep 17 00:00:00 2001 From: HSavynetska Date: Thu, 29 Mar 2018 14:15:08 +0300 Subject: [PATCH 24/30] Tests_iconResumed --- .../001_Mobile_app_First_Registration.lua | 2 +- ...gistration_with_param_iconResumed_true.lua | 4 +- ...obile_application_is_OnAppUnregistered.lua | 8 +- ...emove_icon_and_reregistered_Mobile_app.lua | 20 +-- ...conResumed_true.App2_iconResumed_false.lua | 8 +- ...iconResumed_true_App2_iconResumed_true.lua | 10 +- ...nd_to_SetAppIcon_request_GENERIC_ERROR.lua | 12 +- ...eived_response_SetAppIcon_INVALID_DATA.lua | 67 ++++++++++ ...eceived_response_SetAppIcon_DISALLOWED.lua | 68 ++++++++++ ..._received_response_SetAppIcon_REJECTED.lua | 14 +-- ...p_re_sets_custom_icon_iconResumed_true.lua | 6 +- test_scripts/API/SetAppIcon/comSetApp.lua | 119 +++++++++++++----- 12 files changed, 259 insertions(+), 79 deletions(-) create mode 100644 test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua create mode 100644 test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua diff --git a/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua index 6bd1857b6f..46ba2eeff1 100644 --- a/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua +++ b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua @@ -1,6 +1,6 @@ --------------------------------------------------------------------------------------------------- -- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md --- User story:TBD +-- User story:TBD -- Use case:TBD -- -- Requirement summary: diff --git a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua index 7b0bc0dd70..cdb169b166 100644 --- a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua +++ b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua @@ -10,7 +10,7 @@ -- 1) SDL, HMI are started. -- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. -- 3) Mobile app is re-registered. --- SDL does: +-- SDL does: -- 1) Successfully registers application. -- 2) Successful processes PutFile and SetAppIcon requests. -- 3) SDL responds with result code "SUCCESS" and "iconResumed" = true for RAI request. @@ -48,7 +48,7 @@ runner.Step("App registration with iconresumed = false", common.registerApp, { 1 runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/003_Mobile_application_is_OnAppUnregistered.lua b/test_scripts/API/SetAppIcon/003_Mobile_application_is_OnAppUnregistered.lua index b69cc75d11..1ed802536e 100644 --- a/test_scripts/API/SetAppIcon/003_Mobile_application_is_OnAppUnregistered.lua +++ b/test_scripts/API/SetAppIcon/003_Mobile_application_is_OnAppUnregistered.lua @@ -6,10 +6,10 @@ -- Requirement summary: -- TBD -- Description: --- In case: +-- In case: -- 1) SDL, HMI are started. -- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. --- 3) Mobile application is OnAppUnregistered +-- 3) Mobile application is OnAppUnregistered. -- 4) Mobile app is re-registered. -- SDL does: -- 1) 1) SDL respons with result code "SUCCESS" and "iconResumed" = true for RAI request. @@ -43,11 +43,11 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App OnAppUnregistered", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua index b794678386..b2c06638ae 100644 --- a/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua +++ b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua @@ -6,7 +6,7 @@ -- Requirement summary: -- TBD -- Description: --- In case: +-- In case: -- 1) SDL, HMI are started. -- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. -- 3) Remove Icon for mobile app from the file system @@ -36,30 +36,18 @@ local allParams = { requestUiParams = requestUiParams } ---[[ Local Functions ]] -local function deleteFile(params) - local cid = mobileSession1:SendRPC("DeleteFile", params.requestParams) - - params.responseBcParams.appID = commonSetApp.getHMIAppId() - params.responseBcParams.fileName = - commonSetApp.getPathToFileInStorage(params.responseBcParams.fileName) - EXPECT_HMINOTIFICATION("BasicCommunication.OnFileRemoved", params.responseBcParams) - - mobileSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS"}) -end - --[[ Scenario ]] runner.Title("Preconditions") runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true}) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("Remove Icon for mobile app from the file system", deleteFile, { "icon.png", 1 }) +runner.Step("Remove Icon for mobile app from the file system", common.deleteFile, { "icon.png", 1 }) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false, false }) +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua index 2494b9f19f..044e6377d5 100644 --- a/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua +++ b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua @@ -6,7 +6,7 @@ -- Requirement summary: -- TBD -- Description: --- In case: +-- In case: -- 1) SDL, HMI are started. -- 2) App1 set custom icon via putfile and SetAppIcon requests and is re-registered with resuming custom icon( "iconResumed" = true). -- 3) Mobile App2 registered. @@ -43,12 +43,12 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App1 unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true, true }) -runner.Step("App2 registration with iconresumed = false", common.registerApp, { 1, false, true }) +runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App2 registration with iconresumed = false", common.registerApp, { 1, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua index 6e773504f3..784d567498 100644 --- a/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua +++ b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua @@ -11,7 +11,7 @@ -- 2) Mobile app is registered. Sends PutFile and invalid SetAppIcon requests. -- 3) Mobile App received response SetAppIcon(INVALID_DATA). Custom Icon is not set. -- 4) App is re-registered. --- SDL does: +-- SDL does: -- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] @@ -42,18 +42,18 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("App2 registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App2 registration with iconresumed = true", common.registerApp, { 1, true }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App1 unregistration", common.unregisterAppInterface, { 1 }) runner.Step("App2 unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true, true }) -runner.Step("App2 registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App2 registration with iconresumed = true", common.registerApp, { 1, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua b/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua index c0859fada5..aa794393db 100644 --- a/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua +++ b/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua @@ -11,7 +11,7 @@ -- 2) Mobile app is registered. Sends PutFile and SetAppIcon requests. -- 3) HMI is not respond to SetAppIcon request. Mobile App received response SetAppIcon(GENERIC_ERROR). -- 4) App is re-registered. --- SDL does: +-- SDL does: -- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] @@ -38,9 +38,9 @@ local allParams = { local function setAppIcon_GENERIC_ERROR(params, pAppId) if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) + local mobSession = common.getMobileSession(pAppId) local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) - params.requestUiParams.appID = m.getHMIAppId() + params.requestUiParams.appID = common.getHMIAppId() EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) :Do(function(_, _) -- HMI does not respond @@ -55,12 +55,12 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("HMI does not respond", setAppIcon_GENERIC_ERROR, { 1, false }) +runner.Step("HMI does not respond", setAppIcon_GENERIC_ERROR, { allParams }) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false, true }) +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua b/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua new file mode 100644 index 0000000000..eb191cd98d --- /dev/null +++ b/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua @@ -0,0 +1,67 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) Mobile app is registered. Sends PutFile and invalid SetAppIcon requests. +-- 3) Mobile App received response SetAppIcon(INVALID_DATA). Custom Icon is not set. +-- 4) App is re-registered. +-- SDL does: +-- 1) Successfully registers application. +-- 2) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') +local commonTestCases = require("user_modules/shared_testcases/commonTestCases") + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.pngd" -- -- invalid type of parameter +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +local function setAppIcon_INVALID_DATA(params, pAppId) + if not pAppId then pAppId = 1 end + local mobSession = common.getMobileSession(pAppId) + local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) + params.requestUiParams.appID = common.getHMIAppId() + + EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) + :Times(0) + + mobSession: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.Title("Test") +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("Gets_INVALID_DATA", setAppIcon_INVALID_DATA, { allParams } ) +runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua b/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua new file mode 100644 index 0000000000..9581f953bc --- /dev/null +++ b/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua @@ -0,0 +1,68 @@ +--------------------------------------------------------------------------------------------------- +-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md +-- User story:TBD +-- Use case:TBD +-- +-- Requirement summary: +-- TBD +-- Description: +-- In case: +-- 1) SDL, HMI are started. +-- 2) SetAppIcon does not exist in app's assigned policies. +-- 3) Mobile app is registered. Sends PutFile and valid SetAppIcon requests. +-- 4) Mobile app received response SetAppIcon(DISALLOWED) +-- 5) Mobile app is re-registered. +-- SDL does: +-- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/API/SetAppIcon/comSetApp') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local requestParams = { + syncFileName = "icon.png" +} +local requestUiParams = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName + } +} +local allParams = { + requestParams = requestParams, + requestUiParams = requestUiParams +} + +--[[ Local Functions ]] +local function setAppIcon_DISALLOWED(params, pAppId) + if not pAppId then pAppId = 1 end + local mobSession = common.getMobileSession(pAppId) + local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) + params.requestUiParams.appID = common.getHMIAppId() + EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) + :Times(0) + mobSession:ExpectResponse(cid, { success = false, resultCode = "DISALLOWED" }) +end + +local function updatePTU(tbl) + tbl.policy_table.app_policies[config.application.registerAppInterfaceParams.appID]. ImageFieldName = { "appIcon" } + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) + +runner.Title("Test") +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("Upload icon file", common.putFile) +runner.Step("SetAppIcon", setAppIcon, { allParams } ) +runner.Step("Mobile App received response SetAppIcon(DISALLOWED)", setAppIcon_DISALLOWED, { allParams } ) +runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua b/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua index 9820173768..dee5e65a42 100644 --- a/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua +++ b/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua @@ -39,14 +39,14 @@ local allParams = { --[[ Local Functions ]] local function setAppIcon_resultCode_REJECTED(params, pAppId) if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) + local mobSession = common.getMobileSession(pAppId) local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) - params.requestUiParams.appID = m.getHMIAppId() + params.requestUiParams.appID = common.getHMIAppId() EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) :Times(0) :Do(function(_,data) -- sending UI.SetAppIcon response - m.getHMIConnection():SendResponse(data.id, data.method, "REJECTED", {}) + common.getHMIConnection():SendResponse(data.id, data.method, "REJECTED", {}) end) mobSession:ExpectResponse(cid, { success = false, resultCode = "REJECTED" }) end @@ -57,12 +57,12 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("Mobile App received response SetAppIcon(REJECTED)", setAppIcon_resultCode_REJECTED, { false, 1 } ) +runner.Step("Mobile App received response SetAppIcon(REJECTED)", setAppIcon_resultCode_REJECTED, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false, true }) +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) runner.Title("Postconditions") -runner.Step("Stop SDL", common.postconditions) \ No newline at end of file +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true.lua b/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true.lua index 285c86a5c0..002b4e8ac6 100644 --- a/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true.lua +++ b/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true.lua @@ -47,7 +47,7 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, true, true }) +runner.Step("App registration with iconresumed = false", common.registerApp, { 1, true }) runner.Step("Upload icon file1", common.putFile) runner.Step("SetAppIcon1", common.setAppIcon, { allParams } ) @@ -55,7 +55,7 @@ runner.Step("Upload icon file2", common.putFile) runner.Step("SetAppIcon2", common.setAppIcon, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) +runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) runner.Title("Postconditions") -runner.Step("Stop SDL", common.postconditions) \ No newline at end of file +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/comSetApp.lua b/test_scripts/API/SetAppIcon/comSetApp.lua index d9a054f614..d6a8f596f3 100644 --- a/test_scripts/API/SetAppIcon/comSetApp.lua +++ b/test_scripts/API/SetAppIcon/comSetApp.lua @@ -10,8 +10,6 @@ local actions = require("user_modules/sequences/actions") local utils = require("user_modules/utils") local test = require("user_modules/dummy_connecttest") local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') -local commonFunctions = require('user_modules/shared_testcases/commonFunctions') --add -local commonTestCases = require('user_modules/shared_testcases/commonTestCases') --add --[[ Module ]] local m = actions @@ -26,21 +24,14 @@ local hmiAppIds = {} --! pIconResumed - Existence of apps icon at system --! @return: none --]] -function m.registerApp(pAppId, pIconResumed, pReconnection, pIcon) +function m.registerApp(pAppId, pIconResumed, pReconnection) if not pAppId then pAppId = 1 end - if not pIcon then pIcon = "icon.png" end local mobSession = m.getMobileSession(pAppId) local function RegisterApp() local corId = mobSession:SendRPC("RegisterAppInterface", config["application" .. pAppId].registerAppInterfaceParams) - local iconValue - if pIconResumed == true then - iconValue = m.getPathToFileInStorage(pIcon) - elseif pIconResumed == false then - iconValue = "" - end test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", - { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName, icon = iconValue } }) + { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) :Do(function(_, d1) hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID end) @@ -61,18 +52,61 @@ function m.registerApp(pAppId, pIconResumed, pReconnection, pIcon) end end ---function m.DeleteFile( pIcon, pAppId ) - --local mobSession = m.getMobileSession(pAppId) - --local cid = mobSession:SendRPC("DeleteFile", - --{ syncFileName = pIcon }) - ---EXPECT_HMINOTIFICATION("BasicCommunication.OnFileRemoved", - --{ - --fileName = pIcon, - --fileType = "GRAPHIC_PNG", - --appID = 1 }) - --mobSession:ExpectResponse( cid, { success = true, resultCode = "SUCCESS", info = nil }) ---end +function m.registerApp1(pAppId, pIconResumed, pReconnection) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local function RegisterApp() + local corId = mobSession:SendRPC("RegisterAppInterface", + config["application" .. pAppId].registerAppInterfaceParams) + test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", + { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) + :Do(function(_, d1) + hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID + end) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) + :Do(function() + mobSession:ExpectNotification("OnHMIStatus", + { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) + mobSession:ExpectNotification("OnPermissionsChange") + end) + end + if pReconnection == true then + RegisterApp() + else + mobSession:StartService(7) + :Do(function() + RegisterApp() + end) + end +end +function m.registerApp2(pAppId, pIconResumed, pReconnection) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local function RegisterApp() + local corId = mobSession:SendRPC("RegisterAppInterface", + config["application" .. pAppId].registerAppInterfaceParams) + test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", + { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) + :Do(function(_, d1) + hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID + end) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) + :Do(function() + mobSession:ExpectNotification("OnHMIStatus", + { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) + mobSession:ExpectNotification("OnPermissionsChange") + end) + end + if pReconnection == true then + RegisterApp() + else + mobSession:StartService(7) + :Do(function() + RegisterApp() + end) + end +end --Description: unregisterAppInterface successfully --pAppId - application number (1, 2, etc.) @@ -85,6 +119,24 @@ function m.unregisterAppInterface(pAppId) mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) end +function m.unregisterAppInterface1(pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local corId = mobSession:SendRPC("UnregisterAppInterface", { }) + EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", + { appID = m.getHMIAppId(), unexpectedDisconnect = false }) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) +end + +function m.unregisterAppInterface2(pAppId) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local corId = mobSession:SendRPC("UnregisterAppInterface", { }) + EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", + { appID = m.getHMIAppId(), unexpectedDisconnect = false }) + mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) +end + --Description: Set all parameter for PutFile local function putFileAllParams() local temp = { @@ -119,8 +171,6 @@ function m.putFile(paramsSend, file, pAppId) mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) end - - function m.getPathToFileInStorage(fileName) return commonPreconditions:GetPathToSDL() .. "storage/" .. m.getAppID() .. "_" @@ -140,16 +190,23 @@ function m.setAppIcon(params, pAppId) m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) end) mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) - :Do(function(_, _) - -- HMI does not respond - end) - mobSession:ExpectResponse(cid, { success = false, resultCode = "GENERIC_ERROR"}) - - commonTestCases:DelayedExp(11000) end function m.connectMobile() test:connectMobile() end -return m +function m.deleteFile( pIcon, pAppId ) + if not pAppId then pAppId = 1 end + local mobSession = m.getMobileSession(pAppId) + local corId = mobSession:SendRPC("DeleteFile", + { syncFileName = pIcon }) + EXPECT_HMINOTIFICATION("BasicCommunication.OnFileRemoved", + { + fileName = pIcon, + fileType = "GRAPHIC_PNG", + appID = 1 }) + mobSession:ExpectResponse( corId, { success = true, resultCode = "SUCCESS", info = nil }) +end + +return m \ No newline at end of file From 24df26164f6ccb029984a00e523f293a18f377f8 Mon Sep 17 00:00:00 2001 From: HSavynetska Date: Thu, 29 Mar 2018 14:55:01 +0300 Subject: [PATCH 25/30] modified_Tests_iconResumed --- ....App1_iconResumed_true.App2_iconResumed_false.lua | 8 ++++---- ...d.App1_iconResumed_true_App2_iconResumed_true.lua | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua index 044e6377d5..f35ea05e48 100644 --- a/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua +++ b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua @@ -43,12 +43,12 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App1 registration with iconresumed = true", common.registerApp1, { 1, true }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("App1 unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true }) -runner.Step("App2 registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("App1 unregistration", common.unregisterAppInterface1, { 1 }) +runner.Step("App1 registration with iconresumed = true", common.registerApp1, { 1, true }) +runner.Step("App2 registration with iconresumed = false", common.registerApp1, { 1, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua index 784d567498..f24564c184 100644 --- a/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua +++ b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua @@ -42,18 +42,18 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App1 registration with iconresumed = true", common.registerApp1, { 1, true }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("App2 registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App2 registration with iconresumed = true", common.registerApp2, { 1, true }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("App1 unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App2 unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App1 unregistration", common.unregisterAppInterface1, { 1 }) +runner.Step("App2 unregistration", common.unregisterAppInterface2, { 1 }) -runner.Step("App1 registration with iconresumed = true", common.registerApp, { 1, true }) -runner.Step("App2 registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App1 registration with iconresumed = true", common.registerApp1, { 1, true }) +runner.Step("App2 registration with iconresumed = true", common.registerApp2, { 1, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) From 264ac5716beff079e3b1d4246957bba1593891cc Mon Sep 17 00:00:00 2001 From: HSavynetska Date: Tue, 3 Apr 2018 12:54:05 +0300 Subject: [PATCH 26/30] Update test_scripts 02.04.2018 --- .../001_Mobile_app_First_Registration.lua | 5 +- ...gistration_with_param_iconResumed_true.lua | 11 ++-- ...03_Mobile_application_is_Unregistered.lua} | 12 ++-- ...emove_icon_and_reregistered_Mobile_app.lua | 18 ++++-- ...onResumed_true_App2_iconResumed_false.lua} | 11 ++-- ...conResumed_true_App2_iconResumed_true.lua} | 25 +++++---- ...nd_to_SetAppIcon_request_GENERIC_ERROR.lua | 11 ++-- ...eived_response_SetAppIcon_INVALID_DATA.lua | 29 +++------- ...eceived_response_SetAppIcon_DISALLOWED.lua | 13 +++-- ..._received_response_SetAppIcon_REJECTED.lua | 12 ++-- ...re_sets_custom_icon_iconResumed_true_.lua} | 20 +++---- ...onSetAppIcon.lua => commonIconResumed.lua} | 55 +++++++++++-------- 12 files changed, 116 insertions(+), 106 deletions(-) rename test_scripts/API/SetAppIcon/{003_Mobile_application_is_OnAppUnregistered.lua => 003_Mobile_application_is_Unregistered.lua} (78%) rename test_scripts/API/SetAppIcon/{005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua => 005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua} (82%) rename test_scripts/API/SetAppIcon/{006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua => 006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua} (65%) rename test_scripts/API/SetAppIcon/{011_App_re_sets_custom_icon_iconResumed_true.lua => 011_App_re_sets_custom_icon_iconResumed_true_.lua} (81%) rename test_scripts/API/SetAppIcon/{commonSetAppIcon.lua => commonIconResumed.lua} (72%) diff --git a/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua index 46ba2eeff1..9a772bc0c9 100644 --- a/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua +++ b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua @@ -5,6 +5,7 @@ -- -- Requirement summary: -- TBD +-- -- Description: -- In case: -- 1) SDL, HMI are started. @@ -13,7 +14,7 @@ --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') +local common = require('test_scripts/API/SetAppIcon/commonIconResumed') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -24,7 +25,7 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua index cdb169b166..569677c3ec 100644 --- a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua +++ b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua @@ -5,20 +5,21 @@ -- -- Requirement summary: -- TBD +-- -- Description: -- In case: -- 1) SDL, HMI are started. -- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. -- 3) Mobile app is re-registered. --- SDL does: --- 1) Successfully registers application. +-- SDL does: +-- 1) Successfully register application. -- 2) Successful processes PutFile and SetAppIcon requests. -- 3) SDL responds with result code "SUCCESS" and "iconResumed" = true for RAI request. -- 4) SDL sends to HMI OnAppRegistered notification "icon" and notifies that apps icon exists. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') +local common = require('test_scripts/API/SetAppIcon/commonIconResumed') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -44,11 +45,11 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = true", common.registerApp, { 1, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/003_Mobile_application_is_OnAppUnregistered.lua b/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua similarity index 78% rename from test_scripts/API/SetAppIcon/003_Mobile_application_is_OnAppUnregistered.lua rename to test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua index 1ed802536e..535e49c1b8 100644 --- a/test_scripts/API/SetAppIcon/003_Mobile_application_is_OnAppUnregistered.lua +++ b/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua @@ -5,19 +5,19 @@ -- -- Requirement summary: -- TBD +-- -- Description: -- In case: -- 1) SDL, HMI are started. -- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. --- 3) Mobile application is OnAppUnregistered. +-- 3) Mobile application is unregistered. -- 4) Mobile app is re-registered. -- SDL does: --- 1) 1) SDL respons with result code "SUCCESS" and "iconResumed" = true for RAI request. +-- 1) SDL respons with result code "SUCCESS" and "iconResumed" = true for RAI request. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') -Test = require('user_modules/connecttest_OnAppUnregistered') +local common = require('test_scripts/API/SetAppIcon/commonIconResumed') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -43,11 +43,11 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = true", common.registerApp, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App OnAppUnregistered", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = true", common.registerApp, { 1, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua index b2c06638ae..de11f2d034 100644 --- a/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua +++ b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua @@ -5,18 +5,20 @@ -- -- Requirement summary: -- TBD +-- -- Description: -- In case: -- 1) SDL, HMI are started. -- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. --- 3) Remove Icon for mobile app from the file system --- 4) Mobile app is re-registered, mobile app is registered. +-- 3) Mobile application is unregistered. +-- 4) Remove Icon for mobile app from the file system +-- 5) Mobile app is re-registered, mobile app is registered. -- SDL does: -- 1) SDL respons with result code "SUCCESS" and "iconResumed" = false for RAI request. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') +local common = require('test_scripts/API/SetAppIcon/commonIconResumed') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -36,18 +38,22 @@ local allParams = { requestUiParams = requestUiParams } +local function IconRemove(pFile) + print(common.getPathToFileInStorage(pFile)) +end + --[[ Scenario ]] runner.Title("Preconditions") runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true}) +runner.Step("App registration with iconResumed = true", common.registerApp, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("Remove Icon for mobile app from the file system", common.deleteFile, { "icon.png", 1 }) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("Remove Icon for mobile app from the file system", IconRemove, { "icon.png"}) +runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua similarity index 82% rename from test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua rename to test_scripts/API/SetAppIcon/005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua index f35ea05e48..d11f4f7564 100644 --- a/test_scripts/API/SetAppIcon/005_Two_apps_are_registered.App1_iconResumed_true.App2_iconResumed_false.lua +++ b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua @@ -5,6 +5,7 @@ -- -- Requirement summary: -- TBD +-- -- Description: -- In case: -- 1) SDL, HMI are started. @@ -17,7 +18,7 @@ --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') +local common = require('test_scripts/API/SetAppIcon/commonIconResumed') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -43,12 +44,12 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App1 registration with iconresumed = true", common.registerApp1, { 1, true }) +runner.Step("App1 registration with iconResumed = false", common.registerApp, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("App1 unregistration", common.unregisterAppInterface1, { 1 }) -runner.Step("App1 registration with iconresumed = true", common.registerApp1, { 1, true }) -runner.Step("App2 registration with iconresumed = false", common.registerApp1, { 1, false }) +runner.Step("App1 unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App1 registration with iconResumed = true", common.registerApp, { 1, true }) +runner.Step("App2 registration with iconResumed = false", common.registerApp, { 2, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua similarity index 65% rename from test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua rename to test_scripts/API/SetAppIcon/006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua index f24564c184..76ca035c08 100644 --- a/test_scripts/API/SetAppIcon/006_Two_apps_are_registered.App1_iconResumed_true_App2_iconResumed_true.lua +++ b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua @@ -5,18 +5,20 @@ -- -- Requirement summary: -- TBD +-- -- Description: -- In case: -- 1) SDL, HMI are started. --- 2) Mobile app is registered. Sends PutFile and invalid SetAppIcon requests. --- 3) Mobile App received response SetAppIcon(INVALID_DATA). Custom Icon is not set. --- 4) App is re-registered. +-- 2) App1 set custom icon via putfile and SetAppIcon requests. +-- 3) App2 set custom icon via putfile and SetAppIcon requests. +-- 4) Two app are re-registered. -- SDL does: --- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +-- 1) Registers an App 1 successfully, responds to RAI with result code "SUCCESS", "iconResumed" = true. +-- 2) Registers an App 2 successfully, responds to RAI with result code "SUCCESS", "iconResumed" = true. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') +local common = require('test_scripts/API/SetAppIcon/commonIconResumed') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -42,18 +44,19 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App1 registration with iconresumed = true", common.registerApp1, { 1, true }) +runner.Step("App1 registration with iconResumed = false", common.registerApp, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("App2 registration with iconresumed = true", common.registerApp2, { 1, true }) +runner.Step("App2 registration with iconResumed = false", common.registerApp, { 2, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("App1 unregistration", common.unregisterAppInterface1, { 1 }) -runner.Step("App2 unregistration", common.unregisterAppInterface2, { 1 }) -runner.Step("App1 registration with iconresumed = true", common.registerApp1, { 1, true }) -runner.Step("App2 registration with iconresumed = true", common.registerApp2, { 1, true }) +runner.Step("App1 unregistration", common.unregisterAppInterface, { 1 }) +runner.Step("App2 unregistration", common.unregisterAppInterface, { 2 }) + +runner.Step("App1 registration with iconResumed = true", common.registerApp, { 1, true }) +runner.Step("App2 registration with iconResumed = true", common.registerApp, { 2, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua b/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua index aa794393db..dcdf9aeefc 100644 --- a/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua +++ b/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua @@ -5,6 +5,7 @@ -- -- Requirement summary: -- TBD +-- -- Description: -- In case: -- 1) SDL, HMI are started. @@ -16,7 +17,7 @@ --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') +local common = require('test_scripts/API/SetAppIcon/commonIconResumed') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -42,10 +43,9 @@ local function setAppIcon_GENERIC_ERROR(params, pAppId) local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) params.requestUiParams.appID = common.getHMIAppId() EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) - :Do(function(_, _) + :Do(function() -- HMI does not respond end) - mobSession:ExpectResponse(cid, { success = false, resultCode = "GENERIC_ERROR" }) end @@ -55,12 +55,11 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) runner.Step("Upload icon file", common.putFile) -runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("HMI does not respond", setAppIcon_GENERIC_ERROR, { allParams }) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua b/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua index eb191cd98d..817e6e6747 100644 --- a/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua +++ b/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua @@ -5,6 +5,7 @@ -- -- Requirement summary: -- TBD +-- -- Description: -- In case: -- 1) SDL, HMI are started. @@ -17,7 +18,7 @@ --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') +local common = require('test_scripts/API/SetAppIcon/commonIconResumed') local commonTestCases = require("user_modules/shared_testcases/commonTestCases") --[[ Test Configuration ]] @@ -25,27 +26,14 @@ runner.testSettings.isSelfIncluded = false --[[ Local Variables ]] local requestParams = { - syncFileName = "icon.pngd" -- -- invalid type of parameter -} -local requestUiParams = { - syncFileName = { - imageType = "DYNAMIC", - value = common.getPathToFileInStorage(requestParams.syncFileName - } -} -local allParams = { - requestParams = requestParams, - requestUiParams = requestUiParams + syncFileName = "123" --invalid type of parameter } -local function setAppIcon_INVALID_DATA(params, pAppId) +local function setAppIcon_INVALID_DATA(params) if not pAppId then pAppId = 1 end local mobSession = common.getMobileSession(pAppId) - local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) - params.requestUiParams.appID = common.getHMIAppId() - + local cid = mobSession:SendRPC("SetAppIcon", params) EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) - :Times(0) mobSession:ExpectResponse(cid, { success = false, resultCode = "INVALID_DATA" }) end @@ -56,12 +44,11 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) runner.Step("Upload icon file", common.putFile) -runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("Gets_INVALID_DATA", setAppIcon_INVALID_DATA, { allParams } ) +runner.Step("Gets_INVALID_DATA", setAppIcon_INVALID_DATA, { requestParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua b/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua index 9581f953bc..d07aa9d6f9 100644 --- a/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua +++ b/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua @@ -5,6 +5,7 @@ -- -- Requirement summary: -- TBD +-- -- Description: -- In case: -- 1) SDL, HMI are started. @@ -17,7 +18,7 @@ --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') +local common = require('test_scripts/API/SetAppIcon/commonIconResumed') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -29,7 +30,7 @@ local requestParams = { local requestUiParams = { syncFileName = { imageType = "DYNAMIC", - value = common.getPathToFileInStorage(requestParams.syncFileName + value = common.getPathToFileInStorage(requestParams.syncFileName) } } local allParams = { @@ -38,7 +39,7 @@ local allParams = { } --[[ Local Functions ]] -local function setAppIcon_DISALLOWED(params, pAppId) +local function setAppIcon_DISALLOWED(params) if not pAppId then pAppId = 1 end local mobSession = common.getMobileSession(pAppId) local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) @@ -50,6 +51,7 @@ end local function updatePTU(tbl) tbl.policy_table.app_policies[config.application.registerAppInterfaceParams.appID]. ImageFieldName = { "appIcon" } +end --[[ Scenario ]] runner.Title("Preconditions") @@ -57,12 +59,11 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) runner.Step("Upload icon file", common.putFile) -runner.Step("SetAppIcon", setAppIcon, { allParams } ) runner.Step("Mobile App received response SetAppIcon(DISALLOWED)", setAppIcon_DISALLOWED, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua b/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua index dee5e65a42..ed81452828 100644 --- a/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua +++ b/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua @@ -5,6 +5,7 @@ -- -- Requirement summary: -- TBD +-- -- Description: -- In case: -- 1) SDL, HMI are started. @@ -16,7 +17,7 @@ --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') +local common = require('test_scripts/API/SetAppIcon/commonIconResumed') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -28,7 +29,7 @@ local requestParams = { local requestUiParams = { syncFileName = { imageType = "DYNAMIC", - value = common.getPathToFileInStorage(requestParams.syncFileName + value = common.getPathToFileInStorage(requestParams.syncFileName) } } local allParams = { @@ -37,13 +38,12 @@ local allParams = { } --[[ Local Functions ]] -local function setAppIcon_resultCode_REJECTED(params, pAppId) +local function setAppIcon_resultCode_REJECTED(params) if not pAppId then pAppId = 1 end local mobSession = common.getMobileSession(pAppId) local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) params.requestUiParams.appID = common.getHMIAppId() EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) - :Times(0) :Do(function(_,data) -- sending UI.SetAppIcon response common.getHMIConnection():SendResponse(data.id, data.method, "REJECTED", {}) @@ -57,12 +57,12 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("Mobile App received response SetAppIcon(REJECTED)", setAppIcon_resultCode_REJECTED, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = true", common.registerApp, { 1, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true.lua b/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true_.lua similarity index 81% rename from test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true.lua rename to test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true_.lua index 002b4e8ac6..71b64a207b 100644 --- a/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true.lua +++ b/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true_.lua @@ -5,6 +5,7 @@ -- -- Requirement summary: -- TBD +-- -- Description: -- In case: -- 1) SDL, HMI are started. @@ -18,10 +19,7 @@ --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') - ---[[ Test Configuration ]] -runner.testSettings.isSelfIncluded = false +local common = require('test_scripts/API/SetAppIcon/commonIconResumed') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -30,12 +28,14 @@ runner.testSettings.isSelfIncluded = false local requestParams = { syncFileName = "icon.png" } + local requestUiParams = { - syncFileName = { - imageType = "DYNAMIC", - value = common.getPathToFileInStorage(requestParams.syncFileName - } + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName) + } } + local allParams = { requestParams = requestParams, requestUiParams = requestUiParams @@ -47,7 +47,7 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) runner.Step("Upload icon file1", common.putFile) runner.Step("SetAppIcon1", common.setAppIcon, { allParams } ) @@ -55,7 +55,7 @@ runner.Step("Upload icon file2", common.putFile) runner.Step("SetAppIcon2", common.setAppIcon, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = true", common.registerApp, { 1, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/commonSetAppIcon.lua b/test_scripts/API/SetAppIcon/commonIconResumed.lua similarity index 72% rename from test_scripts/API/SetAppIcon/commonSetAppIcon.lua rename to test_scripts/API/SetAppIcon/commonIconResumed.lua index 6f12372bc5..733af372ed 100644 --- a/test_scripts/API/SetAppIcon/commonSetAppIcon.lua +++ b/test_scripts/API/SetAppIcon/commonIconResumed.lua @@ -9,6 +9,7 @@ config.defaultProtocolVersion = 2 local actions = require("user_modules/sequences/actions") local utils = require("user_modules/utils") local test = require("user_modules/dummy_connecttest") +local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') --[[ Module ]] local m = actions @@ -20,34 +21,36 @@ local hmiAppIds = {} --[[ @registerApp: register mobile application --! @parameters: --! pAppId - application number (1, 2, etc.) ---! pIconResumed - Existence of apps icon at system +--! pIconResumed - apps icon was resumed at system or is not resumed +--! pReconnection - re-register mobile application --! @return: none --]] -function m.registerApp(pAppId, pIconResumed) +function m.registerApp(pAppId, pIconResumed, pReconnection) if not pAppId then pAppId = 1 end local mobSession = m.getMobileSession(pAppId) - mobSession:StartService(7) - :Do(function() - local corId = mobSession:SendRPC("RegisterAppInterface", m.getConfigAppParams(pAppId)) + local function RegisterApp() + local corId = mobSession:SendRPC("RegisterAppInterface", + config["application" .. pAppId].registerAppInterfaceParams) test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", - { application = { appName = m.getConfigAppParams(pAppId).appName } }) + { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) :Do(function(_, d1) hmiAppIds[m.getConfigAppParams(pAppId).appID] = d1.params.application.appID - test.hmiConnection:ExpectNotification("SDL.OnStatusUpdate", { status = "UPDATE_NEEDED" }, { status = "UPDATING" }) - :Times(2) - test.hmiConnection:ExpectRequest("BasicCommunication.PolicyUpdate") - :Do(function(_, d2) - test.hmiConnection:SendResponse(d2.id, d2.method, "SUCCESS", { }) - ptuTable = utils.jsonFileToTable(d2.params.file) - end) end) mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) :Do(function() mobSession:ExpectNotification("OnHMIStatus", { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) mobSession:ExpectNotification("OnPermissionsChange") - end) + end) + end + if pReconnection == true then + RegisterApp() + else + mobSession:StartService(7) + :Do(function() + RegisterApp() end) + end end --Description: unregisterAppInterface successfully @@ -57,19 +60,19 @@ function m.unregisterAppInterface(pAppId) local mobSession = m.getMobileSession(pAppId) local corId = mobSession:SendRPC("UnregisterAppInterface", { }) EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", - { appID = m.getHMIAppId(), unexpectedDisconnect = false }) + { appID = m.getHMIAppId(pAppId), unexpectedDisconnect = false }) mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) end --Description: Set all parameter for PutFile local function putFileAllParams() local temp = { - syncFileName ="icon.png", - fileType ="GRAPHIC_PNG", - persistentFile =false, + syncFileName = "icon.png", + fileType = "GRAPHIC_PNG", + persistentFile = false, systemFile = false, - offset =0, - length =11600 + offset = 0, + length = 11600 } return temp end @@ -92,11 +95,17 @@ function m.putFile(paramsSend, file, pAppId) cid = mobSession:SendRPC("PutFile",paramsSend, "files/icon.png") end - EXPECT_RESPONSE(cid, { success = true, resultCode = "SUCCESS" }) + mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) +end + +function m.getPathToFileInStorage(fileName) + return commonPreconditions:GetPathToSDL() .. "storage/" + .. m.getConfigAppParams().appID .. "_" + .. utils.getDeviceMAC() .. "/" .. fileName end --Description: setAppIcon successfully - --paramsSend: Parameters will be sent to SDL + --params - Parameters will be sent to SDL --pAppId - application number (1, 2, etc.) function m.setAppIcon(params, pAppId) if not pAppId then pAppId = 1 end @@ -109,3 +118,5 @@ function m.setAppIcon(params, pAppId) end) mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) end + +return m From 78ea31c58411426eaf74937f934b46f2f3e1d002 Mon Sep 17 00:00:00 2001 From: HSavynetska Date: Tue, 3 Apr 2018 13:52:54 +0300 Subject: [PATCH 27/30] Delete test_scripts --- ...gistration_with_param_iconResumed=true.lua | 54 ----- ...003_Mobile_application_is_Unregistered.lua | 2 +- ...eived_response_SetAppIcon_INVALID_DATA.lua | 68 ------ ...eceived_response_SetAppIcon_DISALLOWED.lua | 68 ------ test_scripts/API/SetAppIcon/comSetApp.lua | 212 ------------------ 5 files changed, 1 insertion(+), 403 deletions(-) delete mode 100644 test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed=true.lua delete mode 100644 test_scripts/API/SetAppIcon/008_Mobile_App _received_response_SetAppIcon_INVALID_DATA.lua delete mode 100644 test_scripts/API/SetAppIcon/009_Mobile_App _received_response_SetAppIcon_DISALLOWED.lua delete mode 100644 test_scripts/API/SetAppIcon/comSetApp.lua diff --git a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed=true.lua b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed=true.lua deleted file mode 100644 index 7b2a2d77d4..0000000000 --- a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed=true.lua +++ /dev/null @@ -1,54 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md --- User story:TBD --- Use case:TBD --- --- Requirement summary: --- TBD --- Description: --- In case: --- 1) SDL, HMI are started. --- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. --- 3) 3) Mobile app is re-registered. --- SDL does: --- 1) Successfully registers application. --- 2) Successful processes PutFile and SetAppIcon requests. --- 3) SDL responds with result code "SUCCESS" and "iconResumed" = true for RAI request. --- 4) SDL sends to HMI OnAppRegistered notification "icon" and notifies that apps icon exists. ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') - ---[[ Test Configuration ]] -runner.testSettings.isSelfIncluded = false - ---[[ Local Variables ]] -local requestParams = { - syncFileName = "icon.png" -} -local requestUiParams = { - syncFileName = { - imageType = "DYNAMIC", - value = common.getPathToFileInStorage(requestParams.syncFileName) - } -} -local allParams = { - requestParams = requestParams, - requestUiParams = requestUiParams -} - ---[[ Scenario ]] -runner.Title("Preconditions") -runner.Step("Clean environment", common.preconditions) -runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) - -runner.Title("Test") -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) -runner.Step("Upload icon file", common.putFile) -runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) - -runner.Title("Postconditions") -runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua b/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua index 535e49c1b8..93c8420a34 100644 --- a/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua +++ b/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua @@ -13,7 +13,7 @@ -- 3) Mobile application is unregistered. -- 4) Mobile app is re-registered. -- SDL does: --- 1) SDL respons with result code "SUCCESS" and "iconResumed" = true for RAI request. +-- 1) SDL respon with result code "SUCCESS" and "iconResumed" = true for RAI request. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') diff --git a/test_scripts/API/SetAppIcon/008_Mobile_App _received_response_SetAppIcon_INVALID_DATA.lua b/test_scripts/API/SetAppIcon/008_Mobile_App _received_response_SetAppIcon_INVALID_DATA.lua deleted file mode 100644 index 3fdca36143..0000000000 --- a/test_scripts/API/SetAppIcon/008_Mobile_App _received_response_SetAppIcon_INVALID_DATA.lua +++ /dev/null @@ -1,68 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md --- User story:TBD --- Use case:TBD --- --- Requirement summary: --- TBD --- Description: --- In case: --- 1) SDL, HMI are started. --- 2) Mobile app is registered. Sends PutFile and invalid SetAppIcon requests. --- 3) Mobile App received response SetAppIcon(INVALID_DATA). Custom Icon is not set. --- 4) App is re-registered. --- SDL does: --- 1) Successfully registers application. --- 2) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') -local commonTestCases = require("user_modules/shared_testcases/commonTestCases") - ---[[ Test Configuration ]] -runner.testSettings.isSelfIncluded = false - ---[[ Local Variables ]] -local requestParams = { - syncFileName = "icon.pngd" -- -- invalid type of parameter -} -local requestUiParams = { - syncFileName = { - imageType = "DYNAMIC", - value = common.getPathToFileInStorage(requestParams.syncFileName - } -} -local allParams = { - requestParams = requestParams, - requestUiParams = requestUiParams -} - -local function setAppIcon_INVALID_DATA(params, pAppId) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) - params.requestUiParams.appID = m.getHMIAppId() - - EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) - :Times(0) - - mobSession:ExpectResponse(cid, { success = false, resultCode = "INVALID_DATA" }) - commonTestCases:DelayedExp(comSetApp.timeout) -end - ---[[ Scenario ]] -runner.Title("Preconditions") -runner.Step("Clean environment", common.preconditions) -runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) - -runner.Title("Test") -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false }) -runner.Step("Upload icon file", common.putFile) -runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("Gets_INVALID_DATA", setAppIcon_INVALID_DATA, { false, 1 } ) -runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false, false }) - -runner.Title("Postconditions") -runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/009_Mobile_App _received_response_SetAppIcon_DISALLOWED.lua b/test_scripts/API/SetAppIcon/009_Mobile_App _received_response_SetAppIcon_DISALLOWED.lua deleted file mode 100644 index 0c3cd8bbc4..0000000000 --- a/test_scripts/API/SetAppIcon/009_Mobile_App _received_response_SetAppIcon_DISALLOWED.lua +++ /dev/null @@ -1,68 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md --- User story:TBD --- Use case:TBD --- --- Requirement summary: --- TBD --- Description: --- In case: --- 1) SDL, HMI are started. --- 2) SetAppIcon does not exist in app's assigned policies. --- 3) Mobile app is registered. Sends PutFile and valid SetAppIcon requests. --- 4) Mobile app received response SetAppIcon(DISALLOWED) --- 5) Mobile app is re-registered. --- SDL does: --- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. ---------------------------------------------------------------------------------------------------- ---[[ Required Shared libraries ]] -local runner = require('user_modules/script_runner') -local common = require('test_scripts/API/SetAppIcon/comSetApp') - ---[[ Test Configuration ]] -runner.testSettings.isSelfIncluded = false - ---[[ Local Variables ]] -local requestParams = { - syncFileName = "icon.png" -} -local requestUiParams = { - syncFileName = { - imageType = "DYNAMIC", - value = common.getPathToFileInStorage(requestParams.syncFileName - } -} -local allParams = { - requestParams = requestParams, - requestUiParams = requestUiParams -} - ---[[ Local Functions ]] -local function setAppIcon_DISALLOWED(params, pAppId) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) - params.requestUiParams.appID = m.getHMIAppId() - EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) - :Times(0) - mobSession:ExpectResponse(cid, { success = false, resultCode = "DISALLOWED" }) -end - -local function updatePTU(tbl) - tbl.policy_table.app_policies[config.application.registerAppInterfaceParams.appID]. ImageFieldName = { "appIcon" } - ---[[ Scenario ]] -runner.Title("Preconditions") -runner.Step("Clean environment", common.preconditions) -runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) - -runner.Title("Test") -runner.Step("App registration with iconresumed = true", common.registerApp, { 1, true, true }) -runner.Step("Upload icon file", common.putFile) -runner.Step("SetAppIcon", setAppIcon, { allParams } ) -runner.Step("Mobile App received response SetAppIcon(DISALLOWED)", setAppIcon_DISALLOWED, { false, 1 } ) -runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconresumed = false", common.registerApp, { 1, false, true }) - -runner.Title("Postconditions") -runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/comSetApp.lua b/test_scripts/API/SetAppIcon/comSetApp.lua deleted file mode 100644 index d6a8f596f3..0000000000 --- a/test_scripts/API/SetAppIcon/comSetApp.lua +++ /dev/null @@ -1,212 +0,0 @@ ---------------------------------------------------------------------------------------------------- --- Common module ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- ---[[ General configuration parameters ]] -config.defaultProtocolVersion = 2 - ---[[ Required Shared libraries ]] -local actions = require("user_modules/sequences/actions") -local utils = require("user_modules/utils") -local test = require("user_modules/dummy_connecttest") -local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') - ---[[ Module ]] -local m = actions - ---[[ Variables ]] -local ptuTable = {} -local hmiAppIds = {} - ---[[ @registerApp: register mobile application ---! @parameters: ---! pAppId - application number (1, 2, etc.) ---! pIconResumed - Existence of apps icon at system ---! @return: none ---]] -function m.registerApp(pAppId, pIconResumed, pReconnection) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - local function RegisterApp() - local corId = mobSession:SendRPC("RegisterAppInterface", - config["application" .. pAppId].registerAppInterfaceParams) - test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", - { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) - :Do(function(_, d1) - hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID - end) - mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) - :Do(function() - mobSession:ExpectNotification("OnHMIStatus", - { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) - mobSession:ExpectNotification("OnPermissionsChange") - end) - end - if pReconnection == true then - RegisterApp() - else - mobSession:StartService(7) - :Do(function() - RegisterApp() - end) - end -end - -function m.registerApp1(pAppId, pIconResumed, pReconnection) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - local function RegisterApp() - local corId = mobSession:SendRPC("RegisterAppInterface", - config["application" .. pAppId].registerAppInterfaceParams) - test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", - { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) - :Do(function(_, d1) - hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID - end) - mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) - :Do(function() - mobSession:ExpectNotification("OnHMIStatus", - { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) - mobSession:ExpectNotification("OnPermissionsChange") - end) - end - if pReconnection == true then - RegisterApp() - else - mobSession:StartService(7) - :Do(function() - RegisterApp() - end) - end -end - -function m.registerApp2(pAppId, pIconResumed, pReconnection) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - local function RegisterApp() - local corId = mobSession:SendRPC("RegisterAppInterface", - config["application" .. pAppId].registerAppInterfaceParams) - test.hmiConnection:ExpectNotification("BasicCommunication.OnAppRegistered", - { application = { appName = config["application" .. pAppId].registerAppInterfaceParams.appName } }) - :Do(function(_, d1) - hmiAppIds[m.getAppID(pAppId)] = d1.params.application.appID - end) - mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS", iconResumed = pIconResumed }) - :Do(function() - mobSession:ExpectNotification("OnHMIStatus", - { hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" }) - mobSession:ExpectNotification("OnPermissionsChange") - end) - end - if pReconnection == true then - RegisterApp() - else - mobSession:StartService(7) - :Do(function() - RegisterApp() - end) - end -end - ---Description: unregisterAppInterface successfully - --pAppId - application number (1, 2, etc.) -function m.unregisterAppInterface(pAppId) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - local corId = mobSession:SendRPC("UnregisterAppInterface", { }) - EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", - { appID = m.getHMIAppId(), unexpectedDisconnect = false }) - mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) -end - -function m.unregisterAppInterface1(pAppId) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - local corId = mobSession:SendRPC("UnregisterAppInterface", { }) - EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", - { appID = m.getHMIAppId(), unexpectedDisconnect = false }) - mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) -end - -function m.unregisterAppInterface2(pAppId) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - local corId = mobSession:SendRPC("UnregisterAppInterface", { }) - EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", - { appID = m.getHMIAppId(), unexpectedDisconnect = false }) - mobSession:ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) -end - ---Description: Set all parameter for PutFile -local function putFileAllParams() - local temp = { - syncFileName = "icon.png", - fileType = "GRAPHIC_PNG", - persistentFile = false, - systemFile = false, - offset = 0, - length = 11600 - } - return temp -end - ---Description: PutFile successfully - --paramsSend: Parameters will be sent to SDL - --file: path to file will be used to send to SDL - --pAppId - application number (1, 2, etc.) -function m.putFile(paramsSend, file, pAppId) - if paramsSend then - paramsSend = paramsSend - else paramsSend = putFileAllParams() - end - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - local cid - if file ~= nil then - cid = mobSession:SendRPC("PutFile",paramsSend, file) - else - cid = mobSession:SendRPC("PutFile",paramsSend, "files/icon.png") - end - - mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) -end - -function m.getPathToFileInStorage(fileName) - return commonPreconditions:GetPathToSDL() .. "storage/" - .. m.getAppID() .. "_" - .. utils.getDeviceMAC() .. "/" .. fileName -end - ---Description: setAppIcon successfully - --paramsSend: Parameters will be sent to SDL - --pAppId - application number (1, 2, etc.) -function m.setAppIcon(params, pAppId) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) - params.requestUiParams.appID = m.getHMIAppId() - EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) - :Do(function(_, data) - m.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) - end) - mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) -end - -function m.connectMobile() - test:connectMobile() -end - -function m.deleteFile( pIcon, pAppId ) - if not pAppId then pAppId = 1 end - local mobSession = m.getMobileSession(pAppId) - local corId = mobSession:SendRPC("DeleteFile", - { syncFileName = pIcon }) - EXPECT_HMINOTIFICATION("BasicCommunication.OnFileRemoved", - { - fileName = pIcon, - fileType = "GRAPHIC_PNG", - appID = 1 }) - mobSession:ExpectResponse( corId, { success = true, resultCode = "SUCCESS", info = nil }) -end - -return m \ No newline at end of file From 693d043b4c11cd2007bf635a2b040f6a4d114c28 Mon Sep 17 00:00:00 2001 From: HSavynetska Date: Tue, 3 Apr 2018 14:00:55 +0300 Subject: [PATCH 28/30] =?UTF-8?q?Update=20test=5Fscript=20=E2=84=964=2002.?= =?UTF-8?q?04.2018?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua index de11f2d034..ea2a0a5732 100644 --- a/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua +++ b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua @@ -39,7 +39,7 @@ local allParams = { } local function IconRemove(pFile) - print(common.getPathToFileInStorage(pFile)) + os.remove(common.getPathToFileInStorage(pFile)) end --[[ Scenario ]] From 92b4e770dac12301572ad9e056ddbe7277f3ce5a Mon Sep 17 00:00:00 2001 From: HSavynetska Date: Tue, 3 Apr 2018 15:18:12 +0300 Subject: [PATCH 29/30] Modified test_script_for_iconResumed --- .../001_Mobile_app_First_Registration.lua | 7 ++-- ...gistration_with_param_iconResumed_true.lua | 6 ++-- ...003_Mobile_application_is_Unregistered.lua | 8 ++--- ...emove_icon_and_reregistered_Mobile_app.lua | 8 ++--- ...conResumed_true_App2_iconResumed_false.lua | 12 +++---- ...iconResumed_true_App2_iconResumed_true.lua | 10 +++--- ...nd_to_SetAppIcon_request_GENERIC_ERROR.lua | 6 ++-- ...eived_response_SetAppIcon_INVALID_DATA.lua | 10 +++--- ...eceived_response_SetAppIcon_DISALLOWED.lua | 33 ++++++++----------- ..._received_response_SetAppIcon_REJECTED.lua | 10 +++--- ..._re_sets_custom_icon_iconResumed_true_.lua | 4 +-- .../API/SetAppIcon/commonIconResumed.lua | 6 ++-- 12 files changed, 55 insertions(+), 65 deletions(-) diff --git a/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua index 9a772bc0c9..459c2119a1 100644 --- a/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua +++ b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua @@ -1,6 +1,6 @@ --------------------------------------------------------------------------------------------------- -- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0041-appicon-resumption.md --- User story:TBD +-- User story:TBD -- Use case:TBD -- -- Requirement summary: @@ -10,7 +10,8 @@ -- In case: -- 1) SDL, HMI are started. -- 2) Mobile app registers first time. --- SDL does: Successfully registers application and responds with result code "SUCCESS" and "iconResumed" = false" to mobile application. +-- SDL does: +-- 1) Successfully register application and responds with result code "SUCCESS" and "iconResumed" = false" to mobile application. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') @@ -25,7 +26,7 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua index 569677c3ec..a13264d29e 100644 --- a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua +++ b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua @@ -5,7 +5,7 @@ -- -- Requirement summary: -- TBD --- +-- -- Description: -- In case: -- 1) SDL, HMI are started. @@ -45,11 +45,11 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconResumed = true", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = true", common.registerAppWOPTU, { 1, true, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua b/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua index 93c8420a34..e76dec5395 100644 --- a/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua +++ b/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua @@ -5,9 +5,9 @@ -- -- Requirement summary: -- TBD --- +-- -- Description: --- In case: +-- In case: -- 1) SDL, HMI are started. -- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. -- 3) Mobile application is unregistered. @@ -43,11 +43,11 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconResumed = true", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = true", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App OnAppUnregistered", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconResumed = true", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = true", common.registerAppWOPTU, { 1, true, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua index ea2a0a5732..00ca458d9b 100644 --- a/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua +++ b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua @@ -7,14 +7,14 @@ -- TBD -- -- Description: --- In case: +-- In case: -- 1) SDL, HMI are started. -- 2) Mobile application is registered and sets custom icon via sending PutFile and valid SetAppIcon request. -- 3) Mobile application is unregistered. -- 4) Remove Icon for mobile app from the file system -- 5) Mobile app is re-registered, mobile app is registered. -- SDL does: --- 1) SDL respons with result code "SUCCESS" and "iconResumed" = false for RAI request. +-- 1) SDL respon with result code "SUCCESS" and "iconResumed" = false for RAI request. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') @@ -48,12 +48,12 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconResumed = true", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = true", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) runner.Step("Remove Icon for mobile app from the file system", IconRemove, { "icon.png"}) -runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua index d11f4f7564..cb8706321a 100644 --- a/test_scripts/API/SetAppIcon/005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua +++ b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua @@ -7,14 +7,14 @@ -- TBD -- -- Description: --- In case: +-- In case: -- 1) SDL, HMI are started. -- 2) App1 set custom icon via putfile and SetAppIcon requests and is re-registered with resuming custom icon( "iconResumed" = true). -- 3) Mobile App2 registered. -- SDL does: --- 1) Registers App1 successfully registered and sets its app icon, +-- 1) Register App1 successfully registered and sets its app icon, -- responds to RAI with result code "SUCCESS", "iconResumed" = true --- 2) Registers an App 2 with default icon, "iconResumed" = false +-- 2) Register an App 2 with default icon, "iconResumed" = false --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') @@ -44,12 +44,12 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App1 registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App1 registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App1 unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App1 registration with iconResumed = true", common.registerApp, { 1, true }) -runner.Step("App2 registration with iconResumed = false", common.registerApp, { 2, false }) +runner.Step("App1 registration with iconResumed = true", common.registerAppWOPTU, { 1, true, true }) +runner.Step("App2 registration with iconResumed = false", common.registerAppWOPTU, { 2, false }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua index 76ca035c08..e48115d7d2 100644 --- a/test_scripts/API/SetAppIcon/006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua +++ b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua @@ -12,7 +12,7 @@ -- 2) App1 set custom icon via putfile and SetAppIcon requests. -- 3) App2 set custom icon via putfile and SetAppIcon requests. -- 4) Two app are re-registered. --- SDL does: +-- SDL does: -- 1) Registers an App 1 successfully, responds to RAI with result code "SUCCESS", "iconResumed" = true. -- 2) Registers an App 2 successfully, responds to RAI with result code "SUCCESS", "iconResumed" = true. --------------------------------------------------------------------------------------------------- @@ -44,19 +44,19 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App1 registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App1 registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("App2 registration with iconResumed = false", common.registerApp, { 2, false }) +runner.Step("App2 registration with iconResumed = false", common.registerAppWOPTU, { 2, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App1 unregistration", common.unregisterAppInterface, { 1 }) runner.Step("App2 unregistration", common.unregisterAppInterface, { 2 }) -runner.Step("App1 registration with iconResumed = true", common.registerApp, { 1, true }) -runner.Step("App2 registration with iconResumed = true", common.registerApp, { 2, true }) +runner.Step("App1 registration with iconResumed = true", common.registerAppWOPTU, { 1, true, true }) +runner.Step("App2 registration with iconResumed = true", common.registerAppWOPTU, { 2, true, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua b/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua index dcdf9aeefc..0f37cfff76 100644 --- a/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua +++ b/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua @@ -12,7 +12,7 @@ -- 2) Mobile app is registered. Sends PutFile and SetAppIcon requests. -- 3) HMI is not respond to SetAppIcon request. Mobile App received response SetAppIcon(GENERIC_ERROR). -- 4) App is re-registered. --- SDL does: +-- SDL does: -- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] @@ -55,11 +55,11 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("HMI does not respond", setAppIcon_GENERIC_ERROR, { allParams }) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false,true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua b/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua index 817e6e6747..0746e9138a 100644 --- a/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua +++ b/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua @@ -19,7 +19,6 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') local common = require('test_scripts/API/SetAppIcon/commonIconResumed') -local commonTestCases = require("user_modules/shared_testcases/commonTestCases") --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -30,11 +29,10 @@ local requestParams = { } local function setAppIcon_INVALID_DATA(params) - if not pAppId then pAppId = 1 end - local mobSession = common.getMobileSession(pAppId) + local mobSession = common.getMobileSession() local cid = mobSession:SendRPC("SetAppIcon", params) EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) - + :Times(0) mobSession:ExpectResponse(cid, { success = false, resultCode = "INVALID_DATA" }) end @@ -44,11 +42,11 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("Gets_INVALID_DATA", setAppIcon_INVALID_DATA, { requestParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua b/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua index d07aa9d6f9..089508e2b0 100644 --- a/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua +++ b/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua @@ -9,7 +9,7 @@ -- Description: -- In case: -- 1) SDL, HMI are started. --- 2) SetAppIcon does not exist in app's assigned policies. +-- 2) SetAppIcon does not exist in app's assigned policies after PTU. -- 3) Mobile app is registered. Sends PutFile and valid SetAppIcon requests. -- 4) Mobile app received response SetAppIcon(DISALLOWED) -- 5) Mobile app is re-registered. @@ -19,6 +19,7 @@ --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') local common = require('test_scripts/API/SetAppIcon/commonIconResumed') +local commonFunctions = require("user_modules/shared_testcases/commonFunctions") --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -27,30 +28,21 @@ runner.testSettings.isSelfIncluded = false local requestParams = { syncFileName = "icon.png" } -local requestUiParams = { - syncFileName = { - imageType = "DYNAMIC", - value = common.getPathToFileInStorage(requestParams.syncFileName) - } -} -local allParams = { - requestParams = requestParams, - requestUiParams = requestUiParams -} --[[ Local Functions ]] local function setAppIcon_DISALLOWED(params) - if not pAppId then pAppId = 1 end - local mobSession = common.getMobileSession(pAppId) - local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) - params.requestUiParams.appID = common.getHMIAppId() - EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) + local mobSession = common.getMobileSession() + local cid = mobSession:SendRPC("SetAppIcon", params) + EXPECT_HMICALL("UI.SetAppIcon") :Times(0) mobSession:ExpectResponse(cid, { success = false, resultCode = "DISALLOWED" }) end local function updatePTU(tbl) - tbl.policy_table.app_policies[config.application.registerAppInterfaceParams.appID]. ImageFieldName = { "appIcon" } + local CustomGroup = commonFunctions:cloneTable(tbl.policy_table.functional_groupings["Base-4"]) + CustomGroup.rpcs.SetAppIcon = nil + tbl.policy_table.functional_groupings.GroupWithoutSetAppIcon = CustomGroup + tbl.policy_table.app_policies[common.getConfigAppParams().appID].groups = {"GroupWithoutSetAppIcon"} end --[[ Scenario ]] @@ -59,11 +51,12 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App registration", common.registerApp, { 1 }) +runner.Step("PTU without permissions for SetAppIcon", common.policyTableUpdate, { updatePTU }) runner.Step("Upload icon file", common.putFile) -runner.Step("Mobile App received response SetAppIcon(DISALLOWED)", setAppIcon_DISALLOWED, { allParams } ) +runner.Step("Mobile App received response SetAppIcon(DISALLOWED)", setAppIcon_DISALLOWED, { requestParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua b/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua index ed81452828..44abc4db47 100644 --- a/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua +++ b/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua @@ -39,14 +39,12 @@ local allParams = { --[[ Local Functions ]] local function setAppIcon_resultCode_REJECTED(params) - if not pAppId then pAppId = 1 end - local mobSession = common.getMobileSession(pAppId) + local mobSession = common.getMobileSession() local cid = mobSession:SendRPC("SetAppIcon", params.requestParams) params.requestUiParams.appID = common.getHMIAppId() EXPECT_HMICALL("UI.SetAppIcon", params.requestUiParams) :Do(function(_,data) - -- sending UI.SetAppIcon response - common.getHMIConnection():SendResponse(data.id, data.method, "REJECTED", {}) + common.getHMIConnection():SendResponse(data.id, data.method, "REJECTED", {}) end) mobSession:ExpectResponse(cid, { success = false, resultCode = "REJECTED" }) end @@ -57,12 +55,12 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("Mobile App received response SetAppIcon(REJECTED)", setAppIcon_resultCode_REJECTED, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconResumed = true", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = true", common.registerAppWOPTU, { 1, true, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true_.lua b/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true_.lua index 71b64a207b..e6f66ac0c6 100644 --- a/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true_.lua +++ b/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true_.lua @@ -47,7 +47,7 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconResumed = false", common.registerApp, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file1", common.putFile) runner.Step("SetAppIcon1", common.setAppIcon, { allParams } ) @@ -55,7 +55,7 @@ runner.Step("Upload icon file2", common.putFile) runner.Step("SetAppIcon2", common.setAppIcon, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) -runner.Step("App registration with iconResumed = true", common.registerApp, { 1, true }) +runner.Step("App registration with iconResumed = true", common.registerAppWOPTU, { 1, true, true }) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/API/SetAppIcon/commonIconResumed.lua b/test_scripts/API/SetAppIcon/commonIconResumed.lua index 733af372ed..1ba22fadba 100644 --- a/test_scripts/API/SetAppIcon/commonIconResumed.lua +++ b/test_scripts/API/SetAppIcon/commonIconResumed.lua @@ -15,17 +15,17 @@ local commonPreconditions = require('user_modules/shared_testcases/commonPrecond local m = actions --[[ Variables ]] -local ptuTable = {} +-- local ptuTable = {} local hmiAppIds = {} ---[[ @registerApp: register mobile application +--[[ @registerAppWOPTU: register mobile application --! @parameters: --! pAppId - application number (1, 2, etc.) --! pIconResumed - apps icon was resumed at system or is not resumed --! pReconnection - re-register mobile application --! @return: none --]] -function m.registerApp(pAppId, pIconResumed, pReconnection) +function m.registerAppWOPTU(pAppId, pIconResumed, pReconnection) if not pAppId then pAppId = 1 end local mobSession = m.getMobileSession(pAppId) local function RegisterApp() From 6664e45fa28ebf1d6573d442701c98c7a92956b7 Mon Sep 17 00:00:00 2001 From: HSavynetska Date: Wed, 4 Apr 2018 12:03:12 +0300 Subject: [PATCH 30/30] Made changes to the test script for icon_Resumed --- .../001_Mobile_app_First_Registration.lua | 2 +- ...gistration_with_param_iconResumed_true.lua | 6 +-- ... => 003_Icon_resumption_by_disconnect.lua} | 23 ++++++++-- ...emove_icon_and_reregistered_Mobile_app.lua | 4 +- ...conResumed_true_App2_iconResumed_false.lua | 2 +- ...iconResumed_true_App2_iconResumed_true.lua | 28 ++++++++---- ...nd_to_SetAppIcon_request_GENERIC_ERROR.lua | 2 +- ...eived_response_SetAppIcon_INVALID_DATA.lua | 4 +- ...eceived_response_SetAppIcon_DISALLOWED.lua | 2 +- ..._received_response_SetAppIcon_REJECTED.lua | 2 +- ..._re_sets_custom_icon_iconResumed_true_.lua | 43 ++++++++++++++----- .../API/SetAppIcon/commonIconResumed.lua | 5 ++- 12 files changed, 87 insertions(+), 36 deletions(-) rename test_scripts/API/SetAppIcon/{003_Mobile_application_is_Unregistered.lua => 003_Icon_resumption_by_disconnect.lua} (67%) diff --git a/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua index 459c2119a1..e1e87658b9 100644 --- a/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua +++ b/test_scripts/API/SetAppIcon/001_Mobile_app_First_Registration.lua @@ -11,7 +11,7 @@ -- 1) SDL, HMI are started. -- 2) Mobile app registers first time. -- SDL does: --- 1) Successfully register application and responds with result code "SUCCESS" and "iconResumed" = false" to mobile application. +-- 1) Successfully register application and respond with result code "SUCCESS" and "iconResumed" = false" to mobile application. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') diff --git a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua index a13264d29e..44c4de5526 100644 --- a/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua +++ b/test_scripts/API/SetAppIcon/002_Mobile_app_registration_with_param_iconResumed_true.lua @@ -13,9 +13,9 @@ -- 3) Mobile app is re-registered. -- SDL does: -- 1) Successfully register application. --- 2) Successful processes PutFile and SetAppIcon requests. --- 3) SDL responds with result code "SUCCESS" and "iconResumed" = true for RAI request. --- 4) SDL sends to HMI OnAppRegistered notification "icon" and notifies that apps icon exists. +-- 2) Successful process PutFile and SetAppIcon requests. +-- 3) Respond with result code "SUCCESS" and "iconResumed" = true for RAI request. +-- 4) Send to HMI OnAppRegistered notification "icon" and notify that apps icon exists. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') diff --git a/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua b/test_scripts/API/SetAppIcon/003_Icon_resumption_by_disconnect.lua similarity index 67% rename from test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua rename to test_scripts/API/SetAppIcon/003_Icon_resumption_by_disconnect.lua index e76dec5395..5822a5909e 100644 --- a/test_scripts/API/SetAppIcon/003_Mobile_application_is_Unregistered.lua +++ b/test_scripts/API/SetAppIcon/003_Icon_resumption_by_disconnect.lua @@ -13,11 +13,13 @@ -- 3) Mobile application is unregistered. -- 4) Mobile app is re-registered. -- SDL does: --- 1) SDL respon with result code "SUCCESS" and "iconResumed" = true for RAI request. +-- 1) Respond with result code "SUCCESS" and "iconResumed" = true for RAI request. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') local common = require('test_scripts/API/SetAppIcon/commonIconResumed') +local test = require("user_modules/dummy_connecttest") +local mobile_session = require('mobile_session') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false @@ -37,16 +39,31 @@ local allParams = { requestUiParams = requestUiParams } +local function CloseConnection() + test.mobileConnection:Close() + EXPECT_HMINOTIFICATION("BasicCommunication.OnAppUnregistered", { unexpectedDisconnect = true }) +end + +local function OpenConnection() + test.mobileSession[1] = mobile_session.MobileSession( + test, + test.mobileConnection, + config.application1.registerAppInterfaceParams) + test.mobileConnection:Connect() + test.mobileSession[1]:StartRPC() +end + --[[ Scenario ]] runner.Title("Preconditions") runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconResumed = true", common.registerAppWOPTU, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) -runner.Step("App OnAppUnregistered", common.unregisterAppInterface, { 1 }) +runner.Step("Disconnect mobile app", CloseConnection) +runner.Step("Connect mobile app", OpenConnection) runner.Step("App registration with iconResumed = true", common.registerAppWOPTU, { 1, true, true }) runner.Title("Postconditions") diff --git a/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua index 00ca458d9b..629db3eafd 100644 --- a/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua +++ b/test_scripts/API/SetAppIcon/004_Remove_icon_and_reregistered_Mobile_app.lua @@ -14,7 +14,7 @@ -- 4) Remove Icon for mobile app from the file system -- 5) Mobile app is re-registered, mobile app is registered. -- SDL does: --- 1) SDL respon with result code "SUCCESS" and "iconResumed" = false for RAI request. +-- 1) SDL respond with result code "SUCCESS" and "iconResumed" = false for RAI request. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') @@ -48,7 +48,7 @@ runner.Step("Clean environment", common.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") -runner.Step("App registration with iconResumed = true", common.registerAppWOPTU, { 1, false }) +runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file", common.putFile) runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) diff --git a/test_scripts/API/SetAppIcon/005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua index cb8706321a..0571d19016 100644 --- a/test_scripts/API/SetAppIcon/005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua +++ b/test_scripts/API/SetAppIcon/005_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_false.lua @@ -13,7 +13,7 @@ -- 3) Mobile App2 registered. -- SDL does: -- 1) Register App1 successfully registered and sets its app icon, --- responds to RAI with result code "SUCCESS", "iconResumed" = true +-- respond to RAI with result code "SUCCESS", "iconResumed" = true -- 2) Register an App 2 with default icon, "iconResumed" = false --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] diff --git a/test_scripts/API/SetAppIcon/006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua index e48115d7d2..16f3ea543d 100644 --- a/test_scripts/API/SetAppIcon/006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua +++ b/test_scripts/API/SetAppIcon/006_Two_apps_are_registered_App1_iconResumed_true_App2_iconResumed_true.lua @@ -13,8 +13,8 @@ -- 3) App2 set custom icon via putfile and SetAppIcon requests. -- 4) Two app are re-registered. -- SDL does: --- 1) Registers an App 1 successfully, responds to RAI with result code "SUCCESS", "iconResumed" = true. --- 2) Registers an App 2 successfully, responds to RAI with result code "SUCCESS", "iconResumed" = true. +-- 1) Register an App 1 successfully, respond to RAI with result code "SUCCESS", "iconResumed" = true. +-- 2) Register an App 2 successfully, respond to RAI with result code "SUCCESS", "iconResumed" = true. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') @@ -27,15 +27,27 @@ runner.testSettings.isSelfIncluded = false local requestParams = { syncFileName = "icon.png" } -local requestUiParams = { + +local requestUiParamsApp1 = { syncFileName = { imageType = "DYNAMIC", value = common.getPathToFileInStorage(requestParams.syncFileName) } } -local allParams = { +local requestUiParamsApp2 = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams.syncFileName, 2) + } +} + +local allParamsApp1 = { + requestParams = requestParams, + requestUiParams = requestUiParamsApp1 +} +local allParamsApp2 = { requestParams = requestParams, - requestUiParams = requestUiParams + requestUiParams = requestUiParamsApp2 } --[[ Scenario ]] @@ -46,11 +58,11 @@ runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") runner.Step("App1 registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file", common.putFile) -runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("SetAppIcon", common.setAppIcon, { allParamsApp1 } ) runner.Step("App2 registration with iconResumed = false", common.registerAppWOPTU, { 2, false }) -runner.Step("Upload icon file", common.putFile) -runner.Step("SetAppIcon", common.setAppIcon, { allParams } ) +runner.Step("Upload icon file", common.putFile, {nil, nil, 2}) +runner.Step("SetAppIcon", common.setAppIcon, { allParamsApp2, 2 } ) runner.Step("App1 unregistration", common.unregisterAppInterface, { 1 }) runner.Step("App2 unregistration", common.unregisterAppInterface, { 2 }) diff --git a/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua b/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua index 0f37cfff76..0b28e47aeb 100644 --- a/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua +++ b/test_scripts/API/SetAppIcon/007_HMI_did_not_respond_to_SetAppIcon_request_GENERIC_ERROR.lua @@ -13,7 +13,7 @@ -- 3) HMI is not respond to SetAppIcon request. Mobile App received response SetAppIcon(GENERIC_ERROR). -- 4) App is re-registered. -- SDL does: --- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +-- 1) Register an app successfully, respond to RAI with result code "SUCCESS", "iconResumed" = false. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') diff --git a/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua b/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua index 0746e9138a..a6ff51a5c1 100644 --- a/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua +++ b/test_scripts/API/SetAppIcon/008_Mobile_App_received_response_SetAppIcon_INVALID_DATA.lua @@ -13,8 +13,8 @@ -- 3) Mobile App received response SetAppIcon(INVALID_DATA). Custom Icon is not set. -- 4) App is re-registered. -- SDL does: --- 1) Successfully registers application. --- 2) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +-- 1) Successfully register application. +-- 2) Register an app successfully, respond to RAI with result code "SUCCESS", "iconResumed" = false. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') diff --git a/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua b/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua index 089508e2b0..956b2a7d48 100644 --- a/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua +++ b/test_scripts/API/SetAppIcon/009_Mobile_App_received_response_SetAppIcon_DISALLOWED.lua @@ -14,7 +14,7 @@ -- 4) Mobile app received response SetAppIcon(DISALLOWED) -- 5) Mobile app is re-registered. -- SDL does: --- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +-- 1) Register an app successfully, respond to RAI with result code "SUCCESS", "iconResumed" = false. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') diff --git a/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua b/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua index 44abc4db47..d7b6cf3984 100644 --- a/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua +++ b/test_scripts/API/SetAppIcon/010_Mobile_App_received_response_SetAppIcon_REJECTED.lua @@ -13,7 +13,7 @@ -- 3) HMI responds with REJECTED resultCode to SetAppIcon request. Mobile App received response SetAppIcon(REJECTED). -- 4) App is re-registered. -- SDL does: --- 1) Registers an app successfully, responds to RAI with result code "SUCCESS", "iconResumed" = false. +-- 1) Register an app successfully, respond to RAI with result code "SUCCESS", "iconResumed" = true. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') diff --git a/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true_.lua b/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true_.lua index e6f66ac0c6..3ce5dc0464 100644 --- a/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true_.lua +++ b/test_scripts/API/SetAppIcon/011_App_re_sets_custom_icon_iconResumed_true_.lua @@ -13,9 +13,9 @@ -- 3) App re-sets custom icon via sending PutFile and valid SetAppIcon request. -- 4) App is re-registered. -- SDL does: --- 1) Successfully registers application +-- 1) Successfully register application -- 2) Successful processes PutFile and SetAppIcon requests. --- 3) SDL respons with result code "SUCCESS" and "iconResumed" = true for RAI request. Corresponding custom icon is resumed. +-- 3) Respons with result code "SUCCESS" and "iconResumed" = true for RAI request. Corresponding custom icon is resumed. --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') @@ -25,22 +25,43 @@ local common = require('test_scripts/API/SetAppIcon/commonIconResumed') runner.testSettings.isSelfIncluded = false --[[ Local Variables ]] -local requestParams = { +local requestParams1 = { syncFileName = "icon.png" } -local requestUiParams = { +local requestParams2 = { + syncFileName = "action.png" +} + +local requestUiParams1 = { + syncFileName = { + imageType = "DYNAMIC", + value = common.getPathToFileInStorage(requestParams1.syncFileName) + } +} + +local requestUiParams2 = { syncFileName = { imageType = "DYNAMIC", - value = common.getPathToFileInStorage(requestParams.syncFileName) + value = common.getPathToFileInStorage(requestParams2.syncFileName) } } -local allParams = { - requestParams = requestParams, - requestUiParams = requestUiParams +local allParamsSet1 = { + requestParams = requestParams1, + requestUiParams = requestUiParams1 } +local allParamsSet2 = { + requestParams = requestParams2, + requestUiParams = requestUiParams2 +} + +local PutFileParams = { + syncFileName = "action.png", + fileType = "GRAPHIC_PNG", + } + --[[ Scenario ]] runner.Title("Preconditions") runner.Step("Clean environment", common.preconditions) @@ -49,10 +70,10 @@ runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) runner.Title("Test") runner.Step("App registration with iconResumed = false", common.registerAppWOPTU, { 1, false }) runner.Step("Upload icon file1", common.putFile) -runner.Step("SetAppIcon1", common.setAppIcon, { allParams } ) +runner.Step("SetAppIcon1", common.setAppIcon, { allParamsSet1 } ) -runner.Step("Upload icon file2", common.putFile) -runner.Step("SetAppIcon2", common.setAppIcon, { allParams } ) +runner.Step("Upload icon file2", common.putFile, {PutFileParams}) +runner.Step("SetAppIcon2", common.setAppIcon, { allParamsSet2 } ) runner.Step("App unregistration", common.unregisterAppInterface, { 1 }) runner.Step("App registration with iconResumed = true", common.registerAppWOPTU, { 1, true, true }) diff --git a/test_scripts/API/SetAppIcon/commonIconResumed.lua b/test_scripts/API/SetAppIcon/commonIconResumed.lua index 1ba22fadba..fea40fda89 100644 --- a/test_scripts/API/SetAppIcon/commonIconResumed.lua +++ b/test_scripts/API/SetAppIcon/commonIconResumed.lua @@ -98,9 +98,10 @@ function m.putFile(paramsSend, file, pAppId) mobSession:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) end -function m.getPathToFileInStorage(fileName) +function m.getPathToFileInStorage(fileName, pAppId) + if not pAppId then pAppId = 1 end return commonPreconditions:GetPathToSDL() .. "storage/" - .. m.getConfigAppParams().appID .. "_" + .. m.getConfigAppParams( pAppId ).appID .. "_" .. utils.getDeviceMAC() .. "/" .. fileName end