[users] Run an expected-to-fail test in creating groups

This commit is contained in:
Adriaan de Groot 2020-11-02 12:27:50 +01:00
parent 8127ae704c
commit b61b5f8650

View File

@ -75,8 +75,6 @@ GroupTests::testReadGroup()
void GroupTests::testCreateGroup() void GroupTests::testCreateGroup()
{ {
Config g;
// BUILD_AS_TEST is the source-directory path // BUILD_AS_TEST is the source-directory path
QFile fi( QString( "%1/tests/5-issue-1523.conf" ).arg( BUILD_AS_TEST ) ); QFile fi( QString( "%1/tests/5-issue-1523.conf" ).arg( BUILD_AS_TEST ) );
QVERIFY( fi.exists() ); QVERIFY( fi.exists() );
@ -91,6 +89,12 @@ void GroupTests::testCreateGroup()
QCOMPARE( c.defaultGroups().count(), 4 ); QCOMPARE( c.defaultGroups().count(), 4 );
QVERIFY( c.defaultGroups().contains( QStringLiteral( "adm" ) ) ); QVERIFY( c.defaultGroups().contains( QStringLiteral( "adm" ) ) );
QVERIFY( c.defaultGroups().contains( QStringLiteral( "bar" ) ) );
Calamares::JobQueue::instance()->globalStorage()->insert( "rootMountPoint", "/" );
SetupGroupsJob j(&c);
QVERIFY( !j.exec() ); // running as regular user this should fail
} }