From 135d98134f4574efafe1a0302c2ecb5fb05f63fb Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 8 Apr 2020 15:21:55 -0300 Subject: [PATCH] tst_QSaveFile: skip test that fails when run as root FAIL! : tst_QSaveFile::retryTransactionalWrite() '!file.open(QIODevice::WriteOnly)' returned FALSE. () Loc: [/home/tjmaciei/src/qt/qt5/qtbase/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp(156)] strace reveals: access("/TEMPDIR/outfile.ro", W_OK) = 0 Change-Id: Ibdc95e9af7bd456a94ecfffd1603eb371aadb02b Reviewed-by: David Faure --- tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp b/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp index 8e500d7c8e..361d18054b 100644 --- a/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp +++ b/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp @@ -136,6 +136,10 @@ void tst_QSaveFile::retryTransactionalWrite() { #ifndef Q_OS_UNIX QSKIP("This test is Unix only"); +#else + // root can open the read-only file for writing... + if (geteuid() == 0) + QSKIP("This test does not work as the root user"); #endif QTemporaryDir dir; QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));