From 70c70368ce48cc54856b7de4652ac1162dab80eb Mon Sep 17 00:00:00 2001 From: GitSurmangen Date: Thu, 17 Feb 2022 10:00:18 +0000 Subject: [PATCH 1/2] update tests/lib/shell/common.sh. Modify the indentation and standardize the tar packages --- tests/lib/shell/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/shell/common.sh b/tests/lib/shell/common.sh index a661a57..87935d8 100644 --- a/tests/lib/shell/common.sh +++ b/tests/lib/shell/common.sh @@ -257,7 +257,7 @@ function run_fio_test() { test_fail fi if [ "$ANCERT_TEST_MOUNT_POINT" != "/" ]; then - rm -rf $ANCERT_TEST_MOUNT_POINT/ancert.${test_type}.fio.* + rm -rf $ANCERT_TEST_MOUNT_POINT/ancert.${test_type}.fio.* test_dir=$ANCERT_TEST_MOUNT_POINT/ancert.${test_type}.fio.$$ fi mkdir -p $test_dir -- Gitee From 188099ec327ddde0bafa10ad108170399f836321 Mon Sep 17 00:00:00 2001 From: smj01095381 Date: Thu, 17 Feb 2022 18:34:14 +0800 Subject: [PATCH 2/2] Modify the indentation and standardize the tar packages --- lib/utils.py | 11 +++++++---- tests/lib/shell/common.sh | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/utils.py b/lib/utils.py index a215a1c..dfecdf9 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -586,7 +586,7 @@ def pack_log_dir(logdir, args, result): print('Error: There are no log files to package in path {}'.format(logdir)) return False logdir_dirname = os.path.dirname(logdir) - abs_log_tar_name = logdir_dirname + '/%s.tar.gz' % os.path.basename(logdir) + abs_log_tar_name = logdir_dirname + '/%s.tar' % os.path.basename(logdir) try: with tarfile.open(abs_log_tar_name, "w") as tar: tar.add(logdir, arcname=os.path.basename(logdir)) @@ -611,7 +611,7 @@ def pack_log_dir(logdir, args, result): rpm_verify=rpm_verify_f) cmd += """ tar -rf {log_tar_name} {checksum}/{md5_fname} && - tar -tf {log_tar_name} | grep tar.gz.md5 && + tar -tf {log_tar_name} | grep tar.md5 && rm -rf {md5_path} """.format(log_tar_name=log_tar_name, md5_fname=md5_fname, checksum=os.path.basename(md5_path), md5_path=md5_path) @@ -625,9 +625,12 @@ def pack_log_dir(logdir, args, result): if args.category: print('%s Test *%s*!' % (args.category, 'PASS' if result else 'FAIL')) - print('Save tar log file to: %s' % abs_log_tar_name) - print('Please send tar log file %s OpenAnolis hardware compatibility team. ' + print('Save tar log file to: %s' % abs_log_tar_name) + print('Please send tar log file %s OpenAnolis hardware compatibility team. ' % ('to' if result else 'and ask help from')) + + if args.list_hardware: + print('Save tar log file to: %s' % abs_log_tar_name) return True diff --git a/tests/lib/shell/common.sh b/tests/lib/shell/common.sh index 87935d8..a661a57 100644 --- a/tests/lib/shell/common.sh +++ b/tests/lib/shell/common.sh @@ -257,7 +257,7 @@ function run_fio_test() { test_fail fi if [ "$ANCERT_TEST_MOUNT_POINT" != "/" ]; then - rm -rf $ANCERT_TEST_MOUNT_POINT/ancert.${test_type}.fio.* + rm -rf $ANCERT_TEST_MOUNT_POINT/ancert.${test_type}.fio.* test_dir=$ANCERT_TEST_MOUNT_POINT/ancert.${test_type}.fio.$$ fi mkdir -p $test_dir -- Gitee