From 53e8bf4cb0c040047f41306f7f36ac930db120b0 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Fri, 24 Jun 2022 16:07:37 -0700 Subject: [PATCH] auto-t: fix testEncryptedProfiles mtime check Yet another weird UML quirk. The intent of this tests was to ensure the profile gets encrypted, and to check this both the mtime and contents of the profile were checked. But under UML the profile is copied, IWD started, and the profile is encrypted all without any time passing. The (same) mtime was then updated without any changes which fails the mtime check. This puts a sleep after copying the profile to ensure the system time differs once IWD encrypts the profile. --- autotests/testEncryptedProfiles/connection_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autotests/testEncryptedProfiles/connection_test.py b/autotests/testEncryptedProfiles/connection_test.py index 2b846596..ab5a0ae7 100644 --- a/autotests/testEncryptedProfiles/connection_test.py +++ b/autotests/testEncryptedProfiles/connection_test.py @@ -6,6 +6,7 @@ import sys sys.path.append('../util') import iwd import os +from time import sleep from iwd import IWD from iwd import NetworkType from iwd import PSKAgent @@ -48,6 +49,8 @@ class Test(unittest.TestCase): mtime = os.path.getmtime('/tmp/iwd/' + 'ssidCCMP.psk') self.assertFalse(self.profile_is_encrypted('ssidCCMP.psk')) + sleep(1) + wd = IWD(True) # Make sure profile was accepted