From e71fa7f5e6077634ae8b6b092a55b8e012e4f49d Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez-Fernandez Date: Jul 03 2023 23:27:10 +0000 Subject: sysstat: run sa1 and sa2 tests Signed-off-by: Carlos Rodriguez-Fernandez --- diff --git a/tests/p_sysstat/25-sa-tests.sh b/tests/p_sysstat/25-sa-tests.sh new file mode 100644 index 0000000..c93102d --- /dev/null +++ b/tests/p_sysstat/25-sa-tests.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Author: Carlos Rodriguez-Fernandez + +t_Log "Running $0 - sa tests" + +tests_in_order=( + "/usr/lib64/sa/sa1 --boot" + "sar -u | grep -q -e 'LINUX RESTART'" + "/usr/lib64/sa/sa1 1 1" + "sleep 3 && /usr/lib64/sa/sa1 1 1 && sar -u | grep -q -e 'Average'" + "/usr/lib64/sa/sa2 -A" +) + +for cmd in "${tests_in_order[@]}"; do + t_Log "Running $0 - sa test: ${cmd}" + if ! eval "${cmd}" > /dev/null 2>&1; then + t_Log "FAIL: $0: sa test: ${cmd}" + exit 1 + else + t_Log "PASS: $0: sa test: ${cmd}" + fi +done