tests: fix race condition in firewall formatting test

Use fixed timestamp.
This commit is contained in:
Marek Marczykowski-Górecki 2019-02-27 15:38:22 +01:00
parent 2de5a8e894
commit 933882ee9b
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1278,11 +1278,12 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
'/qubes-service/meminfo-writer': '1',
})
@unittest.mock.patch('datetime.datetime')
@unittest.mock.patch('qubes.utils.get_timezone')
@unittest.mock.patch('qubes.utils.urandom')
@unittest.mock.patch('qubes.vm.qubesvm.QubesVM.untrusted_qdb')
def test_621_qdb_vm_with_network(self, mock_qubesdb, mock_urandom,
mock_timezone):
mock_timezone, mock_datetime):
mock_urandom.return_value = b'A' * 64
mock_timezone.return_value = 'UTC'
template = self.get_vm(cls=qubes.vm.templatevm.TemplateVM, name='template')
@ -1300,6 +1301,8 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
mock_qubesdb.write.side_effect = test_qubesdb.write
mock_qubesdb.rm.side_effect = test_qubesdb.rm
self.maxDiff = None
mock_datetime.now.returnvalue = \
datetime.datetime(2019, 2, 27, 15, 12, 15, 385822)
iptables_header = (
'# Generated by Qubes Core on {}\n'