From 6052b106e6e94cf9df48ad601d6b36b035b41510 Mon Sep 17 00:00:00 2001 From: Samuli Leivo Date: Wed, 18 Dec 2024 12:56:23 +0200 Subject: [PATCH] Change relative paths to absolute Fixes test cases: Sysbench test in VMs on LenovoX1 Sysbench test in NetVM Signed-off-by: Samuli Leivo --- .../performance-tests/performance.robot | 15 ++++++------ .../performance-tests/sysbench_test | 24 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Robot-Framework/test-suites/performance-tests/performance.robot b/Robot-Framework/test-suites/performance-tests/performance.robot index 0df11ed0..5827b272 100644 --- a/Robot-Framework/test-suites/performance-tests/performance.robot +++ b/Robot-Framework/test-suites/performance-tests/performance.robot @@ -224,7 +224,7 @@ Sysbench test in NetVM [Tags] SP-T61-8 nuc orin-agx orin-nx Transfer Sysbench Test Script To NetVM - ${output} Execute Command ./sysbench_test 1 sudo=True sudo_password=${PASSWORD} + ${output} Execute Command /tmp/sysbench_test 1 sudo=True sudo_password=${PASSWORD} &{threads} Create Dictionary net-vm=1 Save sysbench results net-vm _1thread @@ -272,7 +272,7 @@ Sysbench test in NetVM Sysbench test in VMs on LenovoX1 [Documentation] Run CPU and Memory benchmark using Sysbench in Virtual Machines ... for 1 thread and MULTIPLE threads if there are more than 1 thread in VM. - [Tags] SP-T61-9 + [Tags] SP-T61-9 lenovo-x1 &{threads} Create Dictionary net-vm=1 ... gui-vm=2 ... gala-vm=2 @@ -293,7 +293,7 @@ Sysbench test in VMs on LenovoX1 IF '${vm_fail}' == 'FAIL' Log to Console Skipping tests for ${vm} because couldn't connect to it ELSE - ${output} Execute Command ./sysbench_test ${threads_n} sudo=True sudo_password=${PASSWORD} + ${output} Execute Command /tmp/sysbench_test ${threads_n} sudo=True sudo_password=${PASSWORD} Run Keyword If ${threads_n} > 1 Save sysbench results ${vm} Save sysbench results ${vm} _1thread Switch Connection ${netvm_ssh} @@ -381,14 +381,13 @@ Transfer Sysbench Test Script To VM Run Keyword If '${vm_fail}' == 'FAIL' Return From Keyword ${vm_fail} Log to console Successfully connected to ${vm} END - Put File performance-tests/sysbench_test /home/ghaf - Execute Command chmod 777 sysbench_test - + Put File performance-tests/sysbench_test /tmp + Execute Command chmod 777 /tmp/sysbench_test Save cpu results [Arguments] ${test}=cpu ${host}=ghaf_host - ${output} Execute Command cat sysbench_results/${test}_report + ${output} Execute Command cat /tmp/sysbench_results/${test}_report Log ${output} &{data} Parse Cpu Results ${output} &{statistics} Save Cpu Data ${host}_${TEST NAME}_${test} ${data} @@ -404,7 +403,7 @@ Save cpu results Save memory results [Arguments] ${test}=memory_read ${host}=ghaf_host - ${output} Execute Command cat sysbench_results/${test}_report + ${output} Execute Command cat /tmp/sysbench_results/${test}_report Log ${output} &{data} Parse Memory Results ${output} &{statistics} Save Memory Data ${host}_${TEST NAME}_${test} ${data} diff --git a/Robot-Framework/test-suites/performance-tests/sysbench_test b/Robot-Framework/test-suites/performance-tests/sysbench_test index f859faf4..a21e97e6 100755 --- a/Robot-Framework/test-suites/performance-tests/sysbench_test +++ b/Robot-Framework/test-suites/performance-tests/sysbench_test @@ -3,37 +3,37 @@ THREADS="$1" # Create a directory for the results with a timestamp -RESULT_DIR="sysbench_results" +RESULT_DIR="/tmp/sysbench_results" echo -e "\nCreating directory for test results:" -echo "./$RESULT_DIR" +echo "$RESULT_DIR" mkdir -p $RESULT_DIR # Copy this test script file itself into the result directory FileName=${0##*/} -cp ${FileName} ./$RESULT_DIR +cp ${FileName} $RESULT_DIR # Create test_info file with information about the run environment: lscpu, free, df -echo -e "\nSaving information about test environment to ./$RESULT_DIR/test_info\n" -echo -e "$(lscpu)" "\n\n" "$(free)" "\n\n" "$(df)" "\n\n" >> ./$RESULT_DIR/test_info +echo -e "\nSaving information about test environment to $RESULT_DIR/test_info\n" +echo -e "$(lscpu)" "\n\n" "$(free)" "\n\n" "$(df)" "\n\n" >> $RESULT_DIR/test_info -echo -e "\nHost: $(hostname)\n" | tee -a ./$RESULT_DIR/test_info +echo -e "\nHost: $(hostname)\n" | tee -a $RESULT_DIR/test_info # cpu tests echo -e "\nRunning CPU tests...\n" -sysbench cpu --time=10 --threads=1 --cpu-max-prime=20000 run | tee ./$RESULT_DIR/cpu_1thread_report +sysbench cpu --time=10 --threads=1 --cpu-max-prime=20000 run | tee $RESULT_DIR/cpu_1thread_report if [ $THREADS -gt 1 ] then - sysbench cpu --time=10 --threads=${THREADS} --cpu-max-prime=20000 run | tee ./$RESULT_DIR/cpu_report + sysbench cpu --time=10 --threads=${THREADS} --cpu-max-prime=20000 run | tee $RESULT_DIR/cpu_report fi # memory tests echo -e "\nRunning memory tests...\n" -sysbench memory --time=60 --memory-oper=read --threads=1 run | tee ./$RESULT_DIR/memory_read_1thread_report -sysbench memory --time=60 --memory-oper=write --threads=1 run | tee ./$RESULT_DIR/memory_write_1thread_report +sysbench memory --time=60 --memory-oper=read --threads=1 run | tee $RESULT_DIR/memory_read_1thread_report +sysbench memory --time=60 --memory-oper=write --threads=1 run | tee $RESULT_DIR/memory_write_1thread_report if [ $THREADS -gt 1 ] then - sysbench memory --time=15 --memory-oper=read --threads=${THREADS} run | tee ./$RESULT_DIR/memory_read_report - sysbench memory --time=30 --memory-oper=write --threads=${THREADS} run | tee ./$RESULT_DIR/memory_write_report + sysbench memory --time=15 --memory-oper=read --threads=${THREADS} run | tee $RESULT_DIR/memory_read_report + sysbench memory --time=30 --memory-oper=write --threads=${THREADS} run | tee $RESULT_DIR/memory_write_report fi echo -e "\nTest finished.\n"