Skip to content

Commit

Permalink
[partition] Test mixed-with-overlap settings
Browse files Browse the repository at this point in the history
  • Loading branch information
adriaandegroot committed Nov 12, 2023
1 parent 3e758d2 commit 196dd55
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/modules/partition/tests/2d-overlap.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
efi:
mountPoint: "/boot/thisoverlaps"
minimumSize: 100MiB
recommendedSize: 300MiB

efiSystemPartition: "/boot/ignored"
efiSystemPartitionSize: 175MiB
efiSystemPartitionName: legacy
15 changes: 15 additions & 0 deletions src/modules/partition/tests/ConfigTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) );
}
}


Expand Down

0 comments on commit 196dd55

Please sign in to comment.