mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-02 11:55:36 -04:00
[users] Add tests for moved password-check configuration
- link the PW checks to the test, and libpwquality if needed - test only does very basic config-mungeing
This commit is contained in:
parent
900deb5dc8
commit
b2b9ae7799
2 changed files with 18 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
// Implementation details
|
||||
extern void setConfigurationDefaultGroups( const QVariantMap& map, QStringList& defaultGroups );
|
||||
extern HostNameActions getHostNameActions( const QVariantMap& configurationMap );
|
||||
extern bool addPasswordCheck( const QString& key, const QVariant& value, PasswordCheckList& passwordChecks );
|
||||
|
||||
/** @brief Test Config object methods and internals
|
||||
*
|
||||
|
@ -43,6 +44,7 @@ private Q_SLOTS:
|
|||
void testDefaultGroups();
|
||||
void testHostActions_data();
|
||||
void testHostActions();
|
||||
void testPasswordChecks();
|
||||
};
|
||||
|
||||
UserTests::UserTests() {}
|
||||
|
@ -141,6 +143,19 @@ UserTests::testHostActions()
|
|||
QCOMPARE( getHostNameActions( m ), HostNameActions( result ) | HostNameAction::WriteEtcHosts );
|
||||
}
|
||||
|
||||
void
|
||||
UserTests::testPasswordChecks()
|
||||
{
|
||||
{
|
||||
PasswordCheckList l;
|
||||
QCOMPARE( l.length(), 0 );
|
||||
QVERIFY( !addPasswordCheck( "nonempty", QVariant(false), l ) ); // a silly setting
|
||||
QCOMPARE( l.length(), 0 );
|
||||
QVERIFY( addPasswordCheck( "nonempty", QVariant(true), l ) );
|
||||
QCOMPARE( l.length(), 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QTEST_GUILESS_MAIN( UserTests )
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue