From 6a8e29fbd8bf804a95554b1a29114dde4d9e58fb Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Tue, 26 Feb 2019 16:19:03 +0100 Subject: [PATCH] system tests: log_dump: fix multiple issues Fixes: - invalid crash report existence tests - lack of bash dependency in one test - non-unique test file used Change-Id: Iee9c7c9592054008c5e3bfd23e90e0c09f6e849b --- tests/system/log_dump_normal/log_dump_normal.sh.template | 3 +-- tests/system/log_dump_short/log_dump_short.sh.template | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/system/log_dump_normal/log_dump_normal.sh.template b/tests/system/log_dump_normal/log_dump_normal.sh.template index ef22b69..419b648 100644 --- a/tests/system/log_dump_normal/log_dump_normal.sh.template +++ b/tests/system/log_dump_normal/log_dump_normal.sh.template @@ -9,8 +9,7 @@ fi . ${CRASH_WORKER_SYSTEM_TESTS}/utils/minicore-utils.sh clean_logdump -dummy="$CRASH_DUMP_DIR/logdump-short-test" -touch "$dummy" +dummy=$(mktemp $CRASH_DUMP_PATH/logdump-normal-test.XXXXXX) log_dump --normal logfile="${LOGDUMP_RESULT_PATH}"/* # there shall be only one file diff --git a/tests/system/log_dump_short/log_dump_short.sh.template b/tests/system/log_dump_short/log_dump_short.sh.template index e4db298..b40555e 100644 --- a/tests/system/log_dump_short/log_dump_short.sh.template +++ b/tests/system/log_dump_short/log_dump_short.sh.template @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Custom report path test @@ -10,8 +10,7 @@ fi clean_logdump -dummy="$CRASH_DUMP_DIR/logdump-short-test" -touch "$dummy" +dummy=$(mktemp $CRASH_DUMP_PATH/logdump-short-test.XXXXXX) log_dump --short logfile="${LOGDUMP_RESULT_PATH}"/* # there shall be only one file @@ -26,7 +25,7 @@ fi check_zip_contains "$logfile" 'log/dump_systemstate.*log$' check_zip_contains "$logfile" 'log/$' -check_file_not_exists "$dummy" +check_file_exists "$dummy" clean_logdump -- 2.7.4