From b715d12b18189e8dc9d068ee7d7f85c475d19b41 Mon Sep 17 00:00:00 2001 From: Samuli Leivo Date: Fri, 8 Nov 2024 08:46:59 +0200 Subject: [PATCH] Add keywords for power measurement Signed-off-by: Samuli Leivo --- .../resources/power_meas_keywords.resource | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Robot-Framework/resources/power_meas_keywords.resource diff --git a/Robot-Framework/resources/power_meas_keywords.resource b/Robot-Framework/resources/power_meas_keywords.resource new file mode 100644 index 00000000..06d5e150 --- /dev/null +++ b/Robot-Framework/resources/power_meas_keywords.resource @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2022-2024 Technology Innovation Institute (TII) +# SPDX-License-Identifier: Apache-2.0 + +*** Settings *** +Resource ../config/variables.robot + + +*** Keywords *** + +Start power measurement + [Documentation] Connect to the measurement agent and run script to start collecting measurement results + [Arguments] ${build_id}=power_data + Connect to measurememnt agent + Start recording power + +Connect to measurememnt agent + [Documentation] Set up SSH connection + [Arguments] ${IP}=${MEAS_IP_ADDRESS} ${PORT}=22 ${target_output}=ghaf@raspberrypi + ${connection}= Open Connection ${IP} port=${PORT} prompt=\$ timeout=15 + ${output}= Login username=${LOGIN_PI} password=${PASSWORD_PI} + Should Contain ${output} ${target_output} + RETURN ${connection} + +Start recording power + Run Keyword And Ignore Error Execute Command -b python ~/ghaf/ghaf-power-meas/measure_power.py timeout=3 \ No newline at end of file