diff mbox series

[4/8] auto-t: fix testEncryptedProfiles mtime check

Message ID 20220624230741.1957863-4-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/8] test-runner: remove reference to missing class member | expand

Commit Message

James Prestwood June 24, 2022, 11:07 p.m. UTC
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 mbox series

Patch

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