public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj at gmail.com>
To: iwd at lists.01.org
Subject: [PATCH 1/2] test-runner: catch exception on test file removal
Date: Wed, 22 Dec 2021 17:12:21 -0800	[thread overview]
Message-ID: <20211223011222.20509-1-prestwoj@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 734 bytes --]

Without catching this can result in a fatal error, ending the
test run.
---
 tools/test-runner | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/test-runner b/tools/test-runner
index 7fa8b840..b5c4f777 100755
--- a/tools/test-runner
+++ b/tools/test-runner
@@ -1380,7 +1380,10 @@ def post_test(ctx, to_copy):
 	allowed = ['phonesim.conf', 'certs', 'secrets', 'iwd']
 	for f in [f for f in os.listdir('/tmp') if f not in allowed]:
 		dbg("File %s was not cleaned up!" % f)
-		os.remove('/tmp/' + f)
+		try:
+			os.remove('/tmp/' + f)
+		except:
+			pass
 
 def print_results(results):
 	table = PrettyTable(['Test', colored('Passed', 'green'), colored('Failed', 'red'), \
-- 
2.31.1

             reply	other threads:[~2021-12-23  1:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-23  1:12 James Prestwood [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-23  1:16 [PATCH 1/2] test-runner: catch exception on test file removal Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211223011222.20509-1-prestwoj@gmail.com \
    --to=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox