Skip to content

Commit

Permalink
tests: regression test for #1389
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Jan 14, 2016
1 parent 3eccc3a commit caa75cb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@
#

import multiprocessing
import os
import time
import unittest

import qubes.qubes
import qubes.tests
import subprocess


class TC_00_Regressions(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase):
# Bug: #906
Expand Down Expand Up @@ -57,3 +60,22 @@ def create_vm(vmname):
self.assertIsNotNone(qc.get_vm_by_name(vmname1))
self.assertIsNotNone(qc.get_vm_by_name(vmname2))

def test_bug_1389_dispvm_qubesdb_crash(self):
"""
Sometimes QubesDB instance in DispVM crashes at startup.
Unfortunately we don't have reliable way to reproduce it, so try twice
:return:
"""
self.qc.unlock_db()
for try_no in xrange(2):
p = subprocess.Popen(['/usr/lib/qubes/qfile-daemon-dvm',
'qubes.VMShell', 'dom0', 'DEFAULT'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=open(os.devnull, 'w'))
p.stdin.write("qubesdb-read /name || echo ERROR\n")
dispvm_name = p.stdout.readline()
p.stdin.close()
self.assertTrue(dispvm_name.startswith("disp"),
"Try {} failed".format(try_no))

0 comments on commit caa75cb

Please sign in to comment.