aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeniy Sadovnik <red0ct@yandex.ru>2016-09-19 20:38:17 +0300
committerGleb Popov <6yearold@gmail.com>2016-09-27 01:21:24 +0300
commita68dbef08a070772449edb2ae7ea1849568162b7 (patch)
tree3c327bcc9aa99b534cb8d4de82eef18006f9ee98
parent0389727be4cf7396d9e1728610b12af778daf444 (diff)
downloadkconfig-a68dbef08a070772449edb2ae7ea1849568162b7.tar.gz
kconfig-a68dbef08a070772449edb2ae7ea1849568162b7.tar.bz2
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
-rw-r--r--autotests/kconfigtest.cpp4
1 files changed, 4 insertions, 0 deletions
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());