From f574014a2466260eaf6d464374845a8d6d3ec898 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Mon, 24 Aug 2020 14:38:32 +0200 Subject: [PATCH] test/common: Add small function for printing and purging files The main use case is to make sure that files, which are normally purged upon exiting from the tests (regardless if the test finished successfully or not) are also printed out to stdout - this is done for the sake of debugging any potential failures that might have been hidden out in said tmp files which we don't want to keep around. Change-Id: I294c3bdc8f45be49e414bf45f80848be89355360 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3916 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- test/common/autotest_common.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 6be1830d6..c9b92692b 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -1335,6 +1335,17 @@ function opal_revert_cleanup() { killprocess $spdk_tgt_pid } +function pap() { + while read -r file; do + cat <<- FILE + --- $file --- + $(<"$file") + --- $file --- + FILE + rm -f "$file" + done < <(find "$@" -type f | sort -u) +} + # Define temp storage for all the tests. Look for 2GB at minimum set_test_storage "${TEST_MIN_STORAGE_SIZE:-$((1 << 31))}"