[machineid] Polish up the tests
- create dirs as needed (this will normally be done by unsquash, but for tests with paths it needs to be done by hand) - log what file is being checked - filePath() doesn't like the absolute paths we have (they're absolute in the chroot, and existing code just sticks rootMountPoint in front)
This commit is contained in:
parent
5f7c9a00a0
commit
c159ffe491
@ -77,6 +77,12 @@ MachineIdJob::exec()
|
||||
//Create new files
|
||||
for ( const auto& entropy_file : m_entropy_files )
|
||||
{
|
||||
if ( !CalamaresUtils::System::instance()->createTargetParentDirs( entropy_file ) )
|
||||
{
|
||||
return Calamares::JobResult::error(
|
||||
QObject::tr( "Directory not found" ),
|
||||
QObject::tr( "Could not create new random file <pre>%1</pre>." ).arg( entropy_file ) );
|
||||
}
|
||||
auto r = MachineId::createEntropy( m_entropy_copy ? MachineId::EntropyGeneration::CopyFromHost
|
||||
: MachineId::EntropyGeneration::New,
|
||||
root,
|
||||
|
@ -235,7 +235,8 @@ MachineIdTests::testJob()
|
||||
QVERIFY( r );
|
||||
for ( const auto& fileName : j.entropyFileNames() )
|
||||
{
|
||||
QVERIFY( QFile::exists( tempRoot.filePath( fileName ) ) );
|
||||
cDebug() << "Verifying existence of" << fileName;
|
||||
QVERIFY( QFile::exists( tempRoot.filePath( fileName.mid( 1 ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user