public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] testsuite: Always cleanup gpg agent
@ 2023-05-09  8:25 Anton Mikanovich
  2023-05-12 18:36 ` Henning Schild
  2023-05-19  4:15 ` Uladzimir Bely
  0 siblings, 2 replies; 3+ messages in thread
From: Anton Mikanovich @ 2023-05-09  8:25 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

In addition to 1284155a cleanup gpg agent even if test fails.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 testsuite/cibase.py | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/testsuite/cibase.py b/testsuite/cibase.py
index d1543a9b..df8b350e 100755
--- a/testsuite/cibase.py
+++ b/testsuite/cibase.py
@@ -42,24 +42,26 @@ class CIBaseTest(CIBuilder):
         if result.exit_status:
             self.fail('GPG import failed')
 
-        self.bitbake(targets, **kwargs)
+        try:
+            self.bitbake(targets, **kwargs)
 
-        self.delete_from_build_dir('tmp')
-        self.configure(gpg_pub_key=gpg_pub_key if signed else None, offline=True, sstate_dir="", **kwargs)
+            self.delete_from_build_dir('tmp')
+            self.configure(gpg_pub_key=gpg_pub_key if signed else None, offline=True, sstate_dir="", **kwargs)
 
-        self.bitbake(targets, **kwargs)
+            self.bitbake(targets, **kwargs)
 
-        # Disable use of cached base repository
-        self.unconfigure()
+            # Disable use of cached base repository
+            self.unconfigure()
 
-        if not signed:
-            # Try to build with changed configuration with no cleanup
-            self.configure(**kwargs)
-            self.bitbake(targets, **kwargs)
+            if not signed:
+                # Try to build with changed configuration with no cleanup
+                self.configure(**kwargs)
+                self.bitbake(targets, **kwargs)
 
-        # Cleanup
-        process.run('gpgconf --kill gpg-agent')
-        shutil.rmtree(gnupg_home, True)
+        finally:
+            # Cleanup
+            process.run('gpgconf --kill gpg-agent')
+            shutil.rmtree(gnupg_home, True)
 
     def perform_ccache_test(self, targets, **kwargs):
         def ccache_stats(dir, field):
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-19  4:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-09  8:25 [PATCH] testsuite: Always cleanup gpg agent Anton Mikanovich
2023-05-12 18:36 ` Henning Schild
2023-05-19  4:15 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox