From 3c0814897eb174f153f4cf47a0d5305070c05e79 Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Wed, 23 Mar 2022 14:34:11 -0600 Subject: [PATCH] storage/v2: enable test using space at end --- subiquity/tests/api/test_api.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/subiquity/tests/api/test_api.py b/subiquity/tests/api/test_api.py index 74c9dead..77aa81e8 100755 --- a/subiquity/tests/api/test_api.py +++ b/subiquity/tests/api/test_api.py @@ -101,7 +101,7 @@ class Server(Client): return async def spawn(self, output_base, socket, machine_config, - bootloader='uefi'): + bootloader='uefi', extra_args=None): env = os.environ.copy() env['SUBIQUITY_REPLAY_TIMESCALE'] = '100' cmd = ['python3', '-m', 'subiquity.cmd.server', @@ -110,6 +110,8 @@ class Server(Client): '--socket', socket, '--output-base', output_base, '--machine-config', machine_config] + if extra_args is not None: + cmd.extend(extra_args) self.proc = await astart_command(cmd, env=env) async def close(self): @@ -800,10 +802,10 @@ class TestPartitionTableEditing(TestAPI): await inst.post('/storage/v2/add_partition', data) @timeout() - async def SKIP_test_try_to_use_free_space(self): - # disabled until we can modify existing partition tables - # see also parts_and_gaps_disk() - async with start_server('examples/ubuntu-and-free-space.json') as inst: + async def test_use_free_space_after_existing(self): + cfg = 'examples/ubuntu-and-free-space.json' + extra = ['--storage-version', '2'] + async with start_server(cfg, extra_args=extra) as inst: # Disk has 3 existing partitions and free space. Add one to end. data = { 'disk_id': 'disk-sda', @@ -812,8 +814,7 @@ class TestPartitionTableEditing(TestAPI): 'mount': '/', } } - await inst.post('/storage/v2/add_partition', data) - resp = await inst.get('/storage') + resp = await inst.post('/storage/v2/add_partition', data) json_print(resp)