mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 02:45:44 -05:00
[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
1 changed files with 4 additions and 1 deletions
|
@ -131,7 +131,10 @@ UsersTests::testHostnamed()
|
||||||
// root, assume it will succeed.
|
// root, assume it will succeed.
|
||||||
if ( geteuid() != 0 )
|
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" ) ) );
|
QVERIFY( setSystemdHostname( QStringLiteral( "tubophone.calamares.io" ) ) );
|
||||||
if ( !m_originalHostName.isEmpty() )
|
if ( !m_originalHostName.isEmpty() )
|
||||||
|
|
Loading…
Add table
Reference in a new issue