|
|
|
|
@ -18,9 +18,12 @@
|
|
|
|
|
|
|
|
|
|
#include "Tests.h"
|
|
|
|
|
|
|
|
|
|
#include "utils/CalamaresUtilsSystem.h"
|
|
|
|
|
#include "utils/Logger.h"
|
|
|
|
|
#include "utils/Yaml.h"
|
|
|
|
|
|
|
|
|
|
#include <QTemporaryFile>
|
|
|
|
|
|
|
|
|
|
#include <QtTest/QtTest>
|
|
|
|
|
|
|
|
|
|
QTEST_GUILESS_MAIN( LibCalamaresTests )
|
|
|
|
|
@ -113,3 +116,21 @@ LibCalamaresTests::testLoadSaveYamlExtended()
|
|
|
|
|
}
|
|
|
|
|
QFile::remove( "out.yaml" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
LibCalamaresTests::testCommands()
|
|
|
|
|
{
|
|
|
|
|
using CalamaresUtils::System;
|
|
|
|
|
auto r = System::runCommand(
|
|
|
|
|
System::RunLocation::RunInHost,
|
|
|
|
|
{ "/bin/ls", "/tmp" }
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
QVERIFY( r.getExitCode() == 0 );
|
|
|
|
|
|
|
|
|
|
QTemporaryFile tf( "/tmp/calamares-test-XXXXXX" );
|
|
|
|
|
QVERIFY( tf.open() );
|
|
|
|
|
QVERIFY( !tf.fileName().isEmpty() );
|
|
|
|
|
|
|
|
|
|
QVERIFY( r.getOutput().contains( tf.fileName() ) );
|
|
|
|
|
}
|
|
|
|
|
|