[users] In tests, adjust failure expectations
Some distro's let the user change the hostname at will; others don't, and yet others don't have systemd to change the hostname with at all. Check if we **can** change the hostname (as a non-root user), before setting expectations.
This commit is contained in:
parent
6a9d9700d4
commit
b4c23b8b70
@ -131,7 +131,10 @@ UsersTests::testHostnamed()
|
||||
// root, assume it will succeed.
|
||||
if ( geteuid() != 0 )
|
||||
{
|
||||
QEXPECT_FAIL( "", "Hostname changes are access-controlled", Continue );
|
||||
if ( !setSystemdHostname( QStringLiteral( "tubophone.calamares.io" ) ) )
|
||||
{
|
||||
QEXPECT_FAIL( "", "Hostname changes are access-controlled", Continue );
|
||||
}
|
||||
}
|
||||
QVERIFY( setSystemdHostname( QStringLiteral( "tubophone.calamares.io" ) ) );
|
||||
if ( !m_originalHostName.isEmpty() )
|
||||
|
Loading…
Reference in New Issue
Block a user