Check basic BMC performance before and after REST suite
Resolves openbmc/openbmc-test-automation#898
Change-Id: I4cf56f7161a1358e156f29268990a649373c5aa7
Signed-off-by: Sivas SRR <sivas.srr@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 7c1d15b..4f05617 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -34,7 +34,7 @@
${HOST_SETTING} ${SETTINGS_URI}host0
# /run/initramfs/ro associate filesystem should be 100% full always
${bmc_file_system_usage_cmd}=
-... df -h | grep -v /run/initramfs/ro | cut -c 52-54 | grep 100 | wc -l
+... df -h | cut -c 52-54 | grep 100 | wc -l
${BOOT_TIME} ${0}
${BOOT_COUNT} ${0}
@@ -717,22 +717,19 @@
BMC CPU Performance Check
[Documentation] Minimal 10% of proc should be free in this instance
- ${bmc_cpu_usage_output} ${stderr}= Execute Command ${bmc_cpu_usage_cmd}
- ... return_stderr=True
- Should be empty ${stderr}
+ ${bmc_cpu_usage_output} ${stderr} ${rc}= BMC Execute Command
+ ... ${bmc_cpu_usage_cmd}
${bmc_cpu_percentage}= Fetch From Left ${bmc_cpu_usage_output} %
Should be true ${bmc_cpu_percentage} < 90
BMC Mem Performance Check
[Documentation] Minimal 10% of memory should be free in this instance
- ${bmc_mem_free_output} ${stderr}= Execute Command ${bmc_mem_free_cmd}
- ... return_stderr=True
- Should be empty ${stderr}
+ ${bmc_mem_free_output} ${stderr} ${rc}= BMC Execute Command
+ ... ${bmc_mem_free_cmd}
- ${bmc_mem_total_output} ${stderr}= Execute Command ${bmc_mem_total_cmd}
- ... return_stderr=True
- Should be empty ${stderr}
+ ${bmc_mem_total_output} ${stderr} ${rc}= BMC Execute Command
+ ... ${bmc_mem_total_cmd}
${bmc_mem_percentage}= Evaluate ${bmc_mem_free_output}*100
${bmc_mem_percentage}= Evaluate
@@ -747,9 +744,8 @@
# /dev/ubiblock0_0 14.4M 14.4M 0 100% /media/rofs-c9249b0e
# /dev/ubiblock8_0 19.6M 19.6M 0 100% /media/pnor-ro-8764baa3
# /dev/ubiblock4_0 14.4M 14.4M 0 100% /media/rofs-407816c
- ${bmc_fs_usage_output} ${stderr}= Execute Command
- ... ${bmc_file_system_usage_cmd} return_stderr=True
- Should Be Empty ${stderr}
+ ${bmc_fs_usage_output} ${stderr} ${rc}= BMC Execute Command
+ ... ${bmc_file_system_usage_cmd}
Should Be True ${bmc_fs_usage_output}==4
Check BMC CPU Performance
diff --git a/tests/test_rest_interfaces.robot b/tests/test_rest_interfaces.robot
index 6027a3b..a85e6a8 100644
--- a/tests/test_rest_interfaces.robot
+++ b/tests/test_rest_interfaces.robot
@@ -4,8 +4,11 @@
Resource ../lib/rest_client.robot
Resource ../lib/openbmc_ffdc.robot
Resource ../lib/resource.txt
+Resource ../lib/utils.robot
Library Collections
+Suite Setup Run Keyword And Ignore Error Check BMC Performance
Test Teardown FFDC On Test Case Fail
+Suite Teardown Run Keyword And Ignore Error Check BMC Performance
*** Variables ***