[partition] Add test demonstrating size edge-case
This commit is contained in:
parent
5c0b20d06a
commit
12413ad9e8
5
src/modules/partition/tests/3a-min-too-large.conf
Normal file
5
src/modules/partition/tests/3a-min-too-large.conf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
efi:
|
||||||
|
recommendedSize: 133MiB
|
||||||
|
minimumSize: 200MiB
|
||||||
|
label: "bigmin"
|
@ -34,6 +34,7 @@ private Q_SLOTS:
|
|||||||
void testEmptyConfig();
|
void testEmptyConfig();
|
||||||
void testLegacySize();
|
void testLegacySize();
|
||||||
void testAll();
|
void testAll();
|
||||||
|
void testWeirdConfig();
|
||||||
};
|
};
|
||||||
|
|
||||||
ConfigTests::ConfigTests() = default;
|
ConfigTests::ConfigTests() = default;
|
||||||
@ -195,6 +196,31 @@ ConfigTests::testAll()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ConfigTests::testWeirdConfig()
|
||||||
|
{
|
||||||
|
Config c( nullptr );
|
||||||
|
|
||||||
|
auto* gs = Calamares::JobQueue::instanceGlobalStorage();
|
||||||
|
QVERIFY( gs );
|
||||||
|
|
||||||
|
|
||||||
|
// Config with an invalid minimum size
|
||||||
|
{
|
||||||
|
const auto file = QStringLiteral( BUILD_AS_TEST "/3a-min-too-large.conf" );
|
||||||
|
bool ok = false;
|
||||||
|
c.setConfigurationMap( Calamares::YAML::load( file, &ok ) );
|
||||||
|
|
||||||
|
cDebug() << "Tried to load" << file << "success?" << ok;
|
||||||
|
QVERIFY( ok );
|
||||||
|
|
||||||
|
QCOMPARE( PartUtils::efiFilesystemRecommendedSize(), 133_MiB );
|
||||||
|
QCOMPARE( PartUtils::efiFilesystemMinimumSize(), 133_MiB ); // Config setting was ignored
|
||||||
|
|
||||||
|
QCOMPARE( gs->value( "efiSystemPartitionName" ).toString(), QStringLiteral( "bigmin" ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QTEST_GUILESS_MAIN( ConfigTests )
|
QTEST_GUILESS_MAIN( ConfigTests )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user