storage/v2: reuse existing partitions

Add test for flow of reusing existing partitions.  Certain operations
are allowed, such as formatting and using an existing partition, or
mounting a partition without formatting it.  Creating new in free space
is off limits, as is deleting a partition (even if it is just about to
be added again).
This commit is contained in:
Dan Bungert 2021-09-28 18:27:59 -06:00
parent cf31bf9606
commit ddbdbb869f
1 changed files with 20 additions and 0 deletions

View File

@ -297,6 +297,26 @@ class TestWin10Start(TestAPI):
with self.assertRaises(Exception):
await self.post('/storage/v2/delete_partition', data)
@timeout(5)
async def test_v2_reuse(self):
disk_id = 'disk-sda'
data = {
'disk_id': disk_id,
'partition': {
'size': 0,
'number': 3,
'format': 'ext4',
'mount': '/',
'grub_device': False,
# 'preserve': False,
}
}
resp = await self.post('/storage/v2/edit_partition', data)
json_print(resp)
await self.post('/storage/v2')
# resp = await self.get('/storage')
# json_print(resp)
# class TestDebug(TestAPI):
# machine_config = 'examples/win10.json'
# need_spawn_server = False