[libcalamares] Test more targetPath() scenario's

This commit is contained in:
Adriaan de Groot 2020-02-07 13:57:14 +01:00
parent 8d23e665ea
commit 394eee3954

View File

@ -80,6 +80,13 @@ TestPaths::testTargetPath()
QCOMPARE( m_system->targetPath( "/etc/calamares" ), QStringLiteral( "/tmp/etc/calamares" ) );
QCOMPARE( m_system->targetPath( "//etc//calamares" ), QStringLiteral( "/tmp//etc//calamares" ) ); // extra / are not cleaned up
QCOMPARE( m_system->targetPath( "etc/calamares" ), QStringLiteral( "/tmp/etc/calamares" ) ); // relative to root
// Weird Paths
QCOMPARE( m_system->targetPath( QString() ), QStringLiteral( "/tmp/" ) );
// Now break GS
Calamares::JobQueue::instance()->globalStorage()->remove( "rootMountPoint" );
QCOMPARE( m_system->targetPath( QString() ), QString() ); // Without root, no path
}
QTEST_GUILESS_MAIN( TestPaths )