tests: minor fixes to time sync tests
- don't crash when ClockVM wasn't set previously - increase allowed delta (for slow systems)
This commit is contained in:
parent
31ad72aa70
commit
c30c9c7d4e
@ -611,7 +611,11 @@ class TC_00_AppVMMixin(qubes.tests.SystemTestsMixin):
|
|||||||
self.testvm2.start()
|
self.testvm2.start()
|
||||||
(start_time, _) = subprocess.Popen(["date", "-u", "+%s"],
|
(start_time, _) = subprocess.Popen(["date", "-u", "+%s"],
|
||||||
stdout=subprocess.PIPE).communicate()
|
stdout=subprocess.PIPE).communicate()
|
||||||
original_clockvm_name = self.qc.get_clockvm_vm().name
|
original_clockvm = self.qc.get_clockvm_vm()
|
||||||
|
if original_clockvm:
|
||||||
|
original_clockvm_name = original_clockvm.name
|
||||||
|
else:
|
||||||
|
original_clockvm_name = "none"
|
||||||
try:
|
try:
|
||||||
# use qubes-prefs to not hassle with qubes.xml locking
|
# use qubes-prefs to not hassle with qubes.xml locking
|
||||||
subprocess.check_call(["qubes-prefs", "-s", "clockvm",
|
subprocess.check_call(["qubes-prefs", "-s", "clockvm",
|
||||||
@ -639,7 +643,7 @@ class TC_00_AppVMMixin(qubes.tests.SystemTestsMixin):
|
|||||||
(dom0_time, _) = subprocess.Popen(["date", "-u", "+%s"],
|
(dom0_time, _) = subprocess.Popen(["date", "-u", "+%s"],
|
||||||
stdout=subprocess.PIPE
|
stdout=subprocess.PIPE
|
||||||
).communicate()
|
).communicate()
|
||||||
self.assertAlmostEquals(int(dom0_time), int(start_time), delta=10)
|
self.assertAlmostEquals(int(dom0_time), int(start_time), delta=30)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
# reset time to some approximation of the real time
|
# reset time to some approximation of the real time
|
||||||
|
Loading…
Reference in New Issue
Block a user