From a68dbef08a070772449edb2ae7ea1849568162b7 Mon Sep 17 00:00:00 2001 From: Evgeniy Sadovnik Date: Mon, 19 Sep 2016 20:38:17 +0300 Subject: Marm test QSKIP when running as root. The test checks that saving a read-only config file fails. But because root can write into read-only files, the test is failing when running by root. Check for uid when running the test and make it XFAIL if we are running as root. REVIEW: 128916 --- autotests/kconfigtest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'autotests/kconfigtest.cpp') diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp index 2b905b57..4334657b 100644 --- a/autotests/kconfigtest.cpp +++ b/autotests/kconfigtest.cpp @@ -1370,6 +1370,10 @@ void KConfigTest::testFailOnReadOnlyFileSync() QVERIFY(f.exists()); QVERIFY(f.setPermissions(QFileDevice::ReadOwner)); +#ifndef Q_OS_WIN + if (::getuid() == 0) + QSKIP("Root can write to read-only files"); +#endif cgLocal.writeEntry("someLocalString", "whatever2"); QVERIFY(!cgLocal.sync()); -- cgit v1.2.1