From 85ba309e9d6539812c87e0722597e24201830c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 27 Nov 2020 19:02:03 +0100 Subject: [PATCH] tests: Remove pam-wrapper temporary folder on test completion PAM wrapper creates /tmp/pam.X files during its execution (strictly as it does not follow $TMPDIR either), however given the low number of combinations, we may end up in re-using the same pam.* folder during meson test, causing a failure. As per this, remove these temporary files on tearDown so that we won't try reusing the same folder multiple times. --- tests/pam/test_pam_fprintd.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/pam/test_pam_fprintd.py b/tests/pam/test_pam_fprintd.py index e3cfb1e..cad210e 100755 --- a/tests/pam/test_pam_fprintd.py +++ b/tests/pam/test_pam_fprintd.py @@ -18,7 +18,9 @@ import subprocess import dbus import dbusmock import fcntl +import glob import os +import shutil import time import pypamtest @@ -68,6 +70,9 @@ class TestPamFprintd(dbusmock.DBusTestCase): def tearDownClass(klass): klass.stop_monitor() + # Remove pam wrapper files, as they may break other tests + [shutil.rmtree(i) for i in glob.glob('/tmp/pam.[0-9A-z]')] + def setUp(self): (self.p_mock, self.obj_fprintd_manager) = self.spawn_server_template( self.template_name, {}, stdout=subprocess.PIPE)