[shellprocess] Test command-substitution

main
Adriaan de Groot 7 years ago
parent b5d900c1c6
commit 8b00a03423

@ -149,3 +149,16 @@ script:
QCOMPARE( cl.at(0).command(), QStringLiteral( "ls /tmp" ) );
QCOMPARE( cl.at(1).timeout(), -1 ); // not set
}
void ShellProcessTests::testRootSubstitution()
{
YAML::Node doc = YAML::Load( R"(---
script:
- "ls /tmp"
)" );
QVariant script = CalamaresUtils::yamlMapToVariant( doc ).toMap().value( "script" );
// Doesn't use @@ROOT@@, so no failures
QVERIFY( bool(CommandList(script, true, 10 ).run()) );
QVERIFY( bool(CommandList(script, false, 10 ).run()) );
}

@ -40,6 +40,8 @@ private Q_SLOTS:
void testProcessFromObject();
// Create from a complex YAML list
void testProcessListFromObject();
// Check @@ROOT@@ substitution
void testRootSubstitution();
};
#endif

Loading…
Cancel
Save