Skip to content

Commit

Permalink
Scripts for resumption within low voltage
Browse files Browse the repository at this point in the history
  • Loading branch information
dboltovskyi committed Jul 25, 2018
1 parent e424464 commit c801cea
Show file tree
Hide file tree
Showing 21 changed files with 1,217 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ runner.Step("PolicyTableUpdate", common.policyTableUpdate)
runner.Step("Activate App", common.activateApp)

runner.Title("Test")
runner.Step("Wait until Resumption Data is stored" , common.waitUntilResumptionDataIsStored)
runner.Step("RPC Show partially", processRPCPartially)
runner.Step("Send LOW_VOLTAGE signal", common.sendLowVoltageSignal)
runner.Step("Close mobile connection", common.cleanSessions)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---------------------------------------------------------------------------------------------------
-- In case:
-- 1. Mobile app is in FULL HMILevel
-- 2. App has some persistent data that can be resumed
-- 3. Mobile app is disconnected during the time frame of 30 sec (inclusive) before "SDL_LOW_VOLTAGE" unix signal from HMI
-- 4. Mobile app registers with the same hashID during 30 sec. after "WAKE_UP" unix signal in the same ignition cycle
-- 5. there is no application currently in FULL
-- SDL does:
-- 1. resume FULL HMILevel for app
-- 2. resume persistent data
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require('test_scripts/LowVoltage/common')
local runner = require('user_modules/script_runner')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false

--[[ Local Functions ]]
local function addResumptionData()
common.rpcSend.AddCommand(1, 1)
end

local function checkResumptionData()
common.rpcCheck.AddCommand(1, 1)
end

local function checkAppId(pAppId, pData)
if pData.params.application.appID ~= common.getHMIAppId(pAppId) then
return false, "App " .. pAppId .. " is registered with not the same HMI App Id"
end
return true
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile", common.start)
runner.Step("Register App ", common.registerApp)
runner.Step("PolicyTableUpdate", common.policyTableUpdate)
runner.Step("Activate app", common.activateApp)
runner.Step("Add resumption data for App ", addResumptionData)

runner.Title("Test")
runner.Step("Wait until Resumption Data is stored" , common.waitUntilResumptionDataIsStored)
runner.Step("Close mobile connection", common.cleanSessions)
runner.Step("Wait 10 sec before LOW_VOLTAGE", common.wait, {10000})
runner.Step("Send LOW_VOLTAGE signal", common.sendLowVoltageSignal)
runner.Step("Send WAKE_UP signal", common.sendWakeUpSignal)
runner.Step("Wait 10 sec before registration", common.wait, {10000})
runner.Step("Re-connect Mobile", common.connectMobile)
runner.Step("Re-register App, check resumption data and HMI level", common.reRegisterApp, {
1, checkAppId, checkResumptionData, common.checkResumptionHMILevel, "SUCCESS", 1000
})

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---------------------------------------------------------------------------------------------------
-- In case:
-- 1. Mobile app is in FULL HMILevel
-- 2. App has some persistent data that can be resumed
-- 3. Mobile app is disconnected during the time frame of 30 sec (inclusive) before "SDL_LOW_VOLTAGE" unix signal from HMI
-- 4. Mobile app registers with the same hashID during 30 sec. after "WAKE_UP" unix signal in the same ignition cycle
-- 5. there is application currently in FULL
-- SDL does:
-- 1. not resume FULL HMILevel for app
-- 2. resume persistent data
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require('test_scripts/LowVoltage/common')
local runner = require('user_modules/script_runner')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false

--[[ Local Functions ]]
local function addResumptionData()
common.rpcSend.AddCommand(1, 1)
end

local function checkResumptionData()
common.rpcCheck.AddCommand(1, 1)
end

local function checkResumptionHMILevel()
common.getMobileSession(1):ExpectNotification("OnHMIStatus",
{ hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" })
common.getMobileSession(2):ExpectNotification("OnHMIStatus")
:Times(0)
end

local function checkAppId(pAppId, pData)
if pData.params.application.appID ~= common.getHMIAppId(pAppId) then
return false, "App " .. pAppId .. " is registered with not the same HMI App Id"
end
return true
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile", common.start)
runner.Step("Register App ", common.registerApp)
runner.Step("PolicyTableUpdate", common.policyTableUpdate)
runner.Step("Activate app", common.activateApp)
runner.Step("Add resumption data for App ", addResumptionData)

runner.Title("Test")
runner.Step("Wait until Resumption Data is stored" , common.waitUntilResumptionDataIsStored)
runner.Step("Close mobile connection", common.cleanSessions)
runner.Step("Wait 5 sec before LOW_VOLTAGE", common.wait, {5000})
runner.Step("Send LOW_VOLTAGE signal", common.sendLowVoltageSignal)
runner.Step("Send WAKE_UP signal", common.sendWakeUpSignal)
runner.Step("Wait 5 sec before registration", common.wait, {5000})
runner.Step("Re-connect Mobile", common.connectMobile)
runner.Step("Register app2", common.registerApp, { 2 })
runner.Step("Activate app2", common.activateApp, { 2 })
runner.Step("Re-register App , check resumption data and HMI level", common.reRegisterApp, {
1, checkAppId, checkResumptionData, checkResumptionHMILevel, "SUCCESS", 10000
})

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---------------------------------------------------------------------------------------------------
-- In case:
-- 1. Mobile app is in FULL HMILevel
-- 2. App has some persistent data that can be resumed
-- 3. Mobile app is disconnected in 35 sec before "SDL_LOW_VOLTAGE" unix signal from HMI
-- 4. Mobile app registers with the same hashID during 30 sec. after "WAKE_UP" unix signal in the same ignition cycle
-- 5. there is no application currently in FULL
-- SDL does:
-- 1. not resume FULL HMILevel for app
-- 2. resume persistent data
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require('test_scripts/LowVoltage/common')
local runner = require('user_modules/script_runner')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false

--[[ Local Functions ]]
local function addResumptionData()
common.rpcSend.AddCommand(1, 1)
end

local function checkResumptionData()
common.rpcCheck.AddCommand(1, 1)
end

local function checkResumptionHMILevel()
common.getMobileSession(1):ExpectNotification("OnHMIStatus",
{ hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" })
common.getHMIConnection():ExpectRequest("BasicCommunication.ActivateApp")
:Times(0)
end

local function checkAppId(pAppId, pData)
if pData.params.application.appID ~= common.getHMIAppId(pAppId) then
return false, "App " .. pAppId .. " is registered with not the same HMI App Id"
end
return true
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile", common.start)
runner.Step("Register App ", common.registerApp)
runner.Step("PolicyTableUpdate", common.policyTableUpdate)
runner.Step("Activate app", common.activateApp)
runner.Step("Add resumption data for App ", addResumptionData)

runner.Title("Test")
runner.Step("Wait until Resumption Data is stored" , common.waitUntilResumptionDataIsStored)
runner.Step("Close mobile connection", common.cleanSessions)
runner.Step("Wait 35 sec before LOW_VOLTAGE", common.wait, {35000})
runner.Step("Send LOW_VOLTAGE signal", common.sendLowVoltageSignal)
runner.Step("Send WAKE_UP signal", common.sendWakeUpSignal)
runner.Step("Wait 5 sec before registration", common.wait, {5000})
runner.Step("Re-connect Mobile", common.connectMobile)
runner.Step("Re-register App, check resumption data and HMI level", common.reRegisterApp, {
1, checkAppId, checkResumptionData, checkResumptionHMILevel, "SUCCESS", 5000
})

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
-- In case:
-- 1. Mobile app is in FULL HMILevel
-- 2. App has some persistent data that can be resumed
-- 3. Mobile app is disconnected during the time frame of 30 sec (inclusive) before "SDL_LOW_VOLTAGE" unix signal from HMI
-- 4. Mobile app registers with the same hashID in 35 sec after "WAKE_UP" unix signal in the same ignition cycle
-- 5. there is no application currently in FULL
-- SDL does:
-- 1. not resume FULL HMILevel for app
-- 2. resume persistent data
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require('test_scripts/LowVoltage/common')
local runner = require('user_modules/script_runner')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false

--[[ Local Functions ]]
local function addResumptionData()
common.rpcSend.AddCommand(1, 1)
end

local function checkResumptionData()
common.rpcCheck.AddCommand(1, 1)
end

local function checkResumptionHMILevel()
common.getMobileSession(1):ExpectNotification("OnHMIStatus",
{ hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" })
common.getHMIConnection():ExpectRequest("BasicCommunication.ActivateApp")
:Times(0)
end

local function checkAppId(pAppId, pData)
if pData.params.application.appID ~= common.getHMIAppId(pAppId) then
return false, "App " .. pAppId .. " is registered with not the same HMI App Id"
end
return true
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile", common.start)
runner.Step("Register App ", common.registerApp)
runner.Step("PolicyTableUpdate", common.policyTableUpdate)
runner.Step("Activate app", common.activateApp)
runner.Step("Add resumption data for App ", addResumptionData)

runner.Title("Test")
runner.Step("Wait until Resumption Data is stored" , common.waitUntilResumptionDataIsStored)
runner.Step("Close mobile connection", common.cleanSessions)
runner.Step("Wait 5 sec before LOW_VOLTAGE", common.wait, {5000})
runner.Step("Send LOW_VOLTAGE signal", common.sendLowVoltageSignal)
runner.Step("Send WAKE_UP signal", common.sendWakeUpSignal)
runner.Step("Wait 35 sec before registration", common.wait, {35000})
runner.Step("Re-connect Mobile", common.connectMobile)
runner.Step("Re-register App, check resumption data and HMI level", common.reRegisterApp, {
1, checkAppId, checkResumptionData, checkResumptionHMILevel, "SUCCESS", 5000
})

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---------------------------------------------------------------------------------------------------
-- In case:
-- 1. Mobile app is in FULL HMILevel
-- 2. App has some persistent data that can be resumed
-- 3. Mobile app is disconnected during the time frame of 30 sec (inclusive) before "SDL_LOW_VOLTAGE" unix signal from HMI
-- 4. Mobile app registers with the same hashID during 30 sec. after "WAKE_UP" unix signal in the same ignition cycle
-- 5. there is no application currently in FULL
-- 6. there is application currently in LIMITED
-- SDL does:
-- 1. resume FULL HMILevel for app
-- 2. resume persistent data
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require('test_scripts/LowVoltage/common')
local runner = require('user_modules/script_runner')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false

--[[ Local Functions ]]
local function addResumptionData()
common.rpcSend.AddCommand(1, 1)
end

local function checkResumptionData()
common.rpcCheck.AddCommand(1, 1)
end

local function checkAppId(pAppId, pData)
if pData.params.application.appID ~= common.getHMIAppId(pAppId) then
return false, "App " .. pAppId .. " is registered with not the same HMI App Id"
end
return true
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile", common.start)
runner.Step("Register App ", common.registerApp)
runner.Step("PolicyTableUpdate", common.policyTableUpdate)
runner.Step("Activate app", common.activateApp)
runner.Step("Add resumption data for App ", addResumptionData)

runner.Title("Test")
runner.Step("Wait until Resumption Data is stored" , common.waitUntilResumptionDataIsStored)
runner.Step("Close mobile connection", common.cleanSessions)
runner.Step("Wait 5 sec before LOW_VOLTAGE", common.wait, {5000})
runner.Step("Send LOW_VOLTAGE signal", common.sendLowVoltageSignal)
runner.Step("Send WAKE_UP signal", common.sendWakeUpSignal)
runner.Step("Wait 5 sec before registration", common.wait, {5000})
runner.Step("Re-connect Mobile", common.connectMobile)
runner.Step("Register app2", common.registerApp, { 2 })
runner.Step("Activate app2", common.activateApp, { 2 })
runner.Step("Deactivate app2 to limited", common.deactivateAppToLimited, { 2 })
runner.Step("Re-register App, check resumption data and HMI level", common.reRegisterApp, {
1, checkAppId, checkResumptionData, common.checkResumptionHMILevel, "SUCCESS", 1000
})

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---------------------------------------------------------------------------------------------------
-- In case:
-- 1. Mobile app is in LIMITED HMILevel
-- 2. App has some persistent data that can be resumed
-- 3. Mobile app is disconnected during the time frame of 30 sec (inclusive) before "SDL_LOW_VOLTAGE" unix signal from HMI
-- 4. Mobile app registers with the same hashID during 30 sec. after "WAKE_UP" unix signal in the same ignition cycle
-- 5. there is no application currently in FULL/LIMITED
-- SDL does:
-- 1. resume LIMITED HMILevel for app
-- 2. resume persistent data
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local common = require('test_scripts/LowVoltage/common')
local runner = require('user_modules/script_runner')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.isMediaApplication = true

--[[ Local Functions ]]
local function addResumptionData()
common.rpcSend.AddCommand(1, 1)
end

local function checkResumptionData()
common.rpcCheck.AddCommand(1, 1)
end

local function checkAppId(pAppId, pData)
if pData.params.application.appID ~= common.getHMIAppId(pAppId) then
return false, "App " .. pAppId .. " is registered with not the same HMI App Id"
end
return true
end

local function checkResumptionHMILevel()
common.getMobileSession(1):ExpectNotification("OnHMIStatus",
{ hmiLevel = "NONE", systemContext = "MAIN", audioStreamingState = "NOT_AUDIBLE" },
{ hmiLevel = "LIMITED", systemContext = "MAIN", audioStreamingState = "AUDIBLE" })
:Times(2)
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile", common.start)
runner.Step("Register App", common.registerApp)
runner.Step("PolicyTableUpdate", common.policyTableUpdate)
runner.Step("Activate app", common.activateApp)
runner.Step("Deactivate app to limited", common.deactivateAppToLimited, { 1 })
runner.Step("Add resumption data for App ", addResumptionData)

runner.Title("Test")
runner.Step("Wait until Resumption Data is stored" , common.waitUntilResumptionDataIsStored)
runner.Step("Close mobile connection", common.cleanSessions)
runner.Step("Wait 10 sec before LOW_VOLTAGE", common.wait, {10000})
runner.Step("Send LOW_VOLTAGE signal", common.sendLowVoltageSignal)
runner.Step("Send WAKE_UP signal", common.sendWakeUpSignal)
runner.Step("Wait 10 sec before registration", common.wait, {10000})
runner.Step("Re-connect Mobile", common.connectMobile)
runner.Step("Re-register App, check resumption data and HMI level", common.reRegisterApp, {
1, checkAppId, checkResumptionData, checkResumptionHMILevel, "SUCCESS", 1000
})

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Loading

0 comments on commit c801cea

Please # to comment.