tests: fix race condition in firewall formatting test
Use fixed timestamp.
This commit is contained in:
parent
2de5a8e894
commit
933882ee9b
@ -1278,11 +1278,12 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
|
|||||||
'/qubes-service/meminfo-writer': '1',
|
'/qubes-service/meminfo-writer': '1',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@unittest.mock.patch('datetime.datetime')
|
||||||
@unittest.mock.patch('qubes.utils.get_timezone')
|
@unittest.mock.patch('qubes.utils.get_timezone')
|
||||||
@unittest.mock.patch('qubes.utils.urandom')
|
@unittest.mock.patch('qubes.utils.urandom')
|
||||||
@unittest.mock.patch('qubes.vm.qubesvm.QubesVM.untrusted_qdb')
|
@unittest.mock.patch('qubes.vm.qubesvm.QubesVM.untrusted_qdb')
|
||||||
def test_621_qdb_vm_with_network(self, mock_qubesdb, mock_urandom,
|
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_urandom.return_value = b'A' * 64
|
||||||
mock_timezone.return_value = 'UTC'
|
mock_timezone.return_value = 'UTC'
|
||||||
template = self.get_vm(cls=qubes.vm.templatevm.TemplateVM, name='template')
|
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.write.side_effect = test_qubesdb.write
|
||||||
mock_qubesdb.rm.side_effect = test_qubesdb.rm
|
mock_qubesdb.rm.side_effect = test_qubesdb.rm
|
||||||
self.maxDiff = None
|
self.maxDiff = None
|
||||||
|
mock_datetime.now.returnvalue = \
|
||||||
|
datetime.datetime(2019, 2, 27, 15, 12, 15, 385822)
|
||||||
|
|
||||||
iptables_header = (
|
iptables_header = (
|
||||||
'# Generated by Qubes Core on {}\n'
|
'# Generated by Qubes Core on {}\n'
|
||||||
|
Loading…
Reference in New Issue
Block a user