[shellprocess] Test command-substitution
This commit is contained in:
parent
b5d900c1c6
commit
8b00a03423
@ -149,3 +149,16 @@ script:
|
|||||||
QCOMPARE( cl.at(0).command(), QStringLiteral( "ls /tmp" ) );
|
QCOMPARE( cl.at(0).command(), QStringLiteral( "ls /tmp" ) );
|
||||||
QCOMPARE( cl.at(1).timeout(), -1 ); // not set
|
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();
|
void testProcessFromObject();
|
||||||
// Create from a complex YAML list
|
// Create from a complex YAML list
|
||||||
void testProcessListFromObject();
|
void testProcessListFromObject();
|
||||||
|
// Check @@ROOT@@ substitution
|
||||||
|
void testRootSubstitution();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user