From 196dd55784b0d653c03acfb45d1aa3cbd2e8914d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 13 Nov 2023 00:40:58 +0100 Subject: [PATCH] [partition] Test mixed-with-overlap settings --- src/modules/partition/tests/2d-overlap.conf | 9 +++++++++ src/modules/partition/tests/ConfigTests.cpp | 15 +++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/modules/partition/tests/2d-overlap.conf diff --git a/src/modules/partition/tests/2d-overlap.conf b/src/modules/partition/tests/2d-overlap.conf new file mode 100644 index 000000000..9ddfa56df --- /dev/null +++ b/src/modules/partition/tests/2d-overlap.conf @@ -0,0 +1,9 @@ +--- +efi: + mountPoint: "/boot/thisoverlaps" + minimumSize: 100MiB + recommendedSize: 300MiB + +efiSystemPartition: "/boot/ignored" +efiSystemPartitionSize: 175MiB +efiSystemPartitionName: legacy diff --git a/src/modules/partition/tests/ConfigTests.cpp b/src/modules/partition/tests/ConfigTests.cpp index 7191e0a06..ee8150501 100644 --- a/src/modules/partition/tests/ConfigTests.cpp +++ b/src/modules/partition/tests/ConfigTests.cpp @@ -178,6 +178,21 @@ ConfigTests::testAll() QCOMPARE( gs->value( "efiSystemPartition" ).toString(), QStringLiteral( "/boot/thisismixed" ) ); QCOMPARE( gs->value( "efiSystemPartitionName" ).toString(), QStringLiteral( "legacy" ) ); } + + // Mixed settings with overlap + { + gs->clear(); + bool ok = false; + c.setConfigurationMap( Calamares::YAML::load( QStringLiteral( BUILD_AS_TEST "/2d-overlap.conf" ), &ok ) ); + + QVERIFY( ok ); + + QCOMPARE( PartUtils::efiFilesystemRecommendedSize(), 300_MiB ); // From modern config + QCOMPARE( PartUtils::efiFilesystemMinimumSize(), 100_MiB ); // Taken from modern config, legacy ignored + + QCOMPARE( gs->value( "efiSystemPartition" ).toString(), QStringLiteral( "/boot/thisoverlaps" ) ); + QCOMPARE( gs->value( "efiSystemPartitionName" ).toString(), QStringLiteral( "legacy" ) ); + } }