From a580fc73668a9ebd41e93392999fe26eee68a201 Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Mon, 11 Jul 2022 11:59:51 -0600 Subject: [PATCH] filesystem: add resize api test against logical Exposed a calculation flaw in finding the gap offset, which was the motivation for introducing gaps.after() to sidestep that calculation. --- subiquity/tests/api/test_api.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/subiquity/tests/api/test_api.py b/subiquity/tests/api/test_api.py index efe96ffb..ca5ed117 100755 --- a/subiquity/tests/api/test_api.py +++ b/subiquity/tests/api/test_api.py @@ -479,6 +479,20 @@ class TestGuided(TestAPI): } self.assertDictSubset(expected_p5, p5) + @timeout() + async def test_guided_v2_resize_logical(self): + cfg = 'examples/threebuntu-on-msdos.json' + extra = ['--storage-version', '2'] + async with start_server(cfg, extra_args=extra) as inst: + resp = await inst.get('/storage/v2/guided') + [resize] = match( + resp['possible'], _type='GuidedStorageTargetResize', + partition_number=6) + data = {'target': resize} + resp = await inst.post('/storage/v2/guided', data) + self.assertEqual(resize, resp['configured']['target']) + # should not throw a Gap Not Found exception + class TestAdd(TestAPI): @timeout()