From 87b9c421588889b12defbae7da0c8cac597d9a82 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 23 May 2018 09:53:03 -0400 Subject: [PATCH] [shellprocess] Don't crash test - May need to create a JobQueue before doing anything internal - May need to create global settings - Chroot always needs rootMountPath internally --- src/modules/shellprocess/Tests.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/modules/shellprocess/Tests.cpp b/src/modules/shellprocess/Tests.cpp index ebfb8046b..55c5a9560 100644 --- a/src/modules/shellprocess/Tests.cpp +++ b/src/modules/shellprocess/Tests.cpp @@ -18,7 +18,11 @@ #include "Tests.h" +#include "JobQueue.h" +#include "Settings.h" + #include "utils/CommandList.h" +#include "utils/Logger.h" #include "utils/YamlUtils.h" #include @@ -158,7 +162,17 @@ script: )" ); QVariant script = CalamaresUtils::yamlMapToVariant( doc ).toMap().value( "script" ); + if ( !Calamares::JobQueue::instance() ) + (void *)new Calamares::JobQueue( nullptr ); + if ( !Calamares::Settings::instance() ) + (void *)new Calamares::Settings( QString(), true ); + + Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); + QVERIFY( gs != nullptr ); + // Doesn't use @@ROOT@@, so no failures - QVERIFY( bool(CommandList(script, true, 10 ).run()) ); QVERIFY( bool(CommandList(script, false, 10 ).run()) ); + + // Doesn't use @@ROOT@@, but does chroot, so fails + QVERIFY( !bool(CommandList(script, true, 10 ).run()) ); }