[partition] Test mixed-with-overlap settings

This commit is contained in:
Adriaan de Groot 2023-11-13 00:40:58 +01:00
parent 3e758d2d5c
commit 196dd55784
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,9 @@
---
efi:
mountPoint: "/boot/thisoverlaps"
minimumSize: 100MiB
recommendedSize: 300MiB
efiSystemPartition: "/boot/ignored"
efiSystemPartitionSize: 175MiB
efiSystemPartitionName: legacy

View File

@ -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" ) );
}
}