Skip to content

Commit

Permalink
tests/integ/storage: check that the snapshot is not stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
rustybird committed Feb 13, 2022
1 parent 46e355f commit e05c3f5
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion qubes/tests/integ/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ async def _test_003_snapshot(self):
self.fail('origin changes propagated to snapshot too early2')

await self.vm2.shutdown(wait=True)
await self.vm2.start()
await self.start_vm(self.vm2)

# only after target VM restart changes should be visible

Expand All @@ -257,6 +257,30 @@ async def _test_003_snapshot(self):
size),
user='root')

await self.vm2.shutdown(wait=True)

# change origin again ...

await self.start_vm(self.vm1)
try:
await self.vm1.run_for_stdio(
'echo test456 > /dev/xvde && sync',
user='root')
except subprocess.CalledProcessError:
self.fail('Write to read-write volume failed2')
await self.vm1.shutdown(wait=True)

# ... and check that the snapshot is not stuck

await self.start_vm(self.vm2)
try:
await self.vm2.run_for_stdio(
'echo test456 | cat - /dev/zero |'
' head -c {} | diff -q /dev/xvde - 2>&1'.format(size),
user='root')
except subprocess.CalledProcessError:
self.fail('origin changes did not refresh snapshot')

def test_004_snapshot_non_persistent(self):
'''Test snapshot volume non-persistence'''
return self.loop.run_until_complete(
Expand Down

0 comments on commit e05c3f5

Please sign in to comment.