diff options
author | Sami Nurmenniemi <sami.nurmenniemi@qt.io> | 2017-04-18 13:29:04 +0300 |
---|---|---|
committer | Sami Nurmenniemi <sami.nurmenniemi@qt.io> | 2017-04-26 09:12:12 +0000 |
commit | a1e94bcfbb7b2814340f481b632ebab224eddda5 (patch) | |
tree | 358f911f69ced345d274f315399d124f6d3aeb79 /tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp | |
parent | 9b52cfd64c089901b2e3fa0a19d6f342adad6025 (diff) |
Fix tests that assume system files are owned by root for qemu
If QEMU is provided sysroot with QEMU_LD_PREFIX, it opens files from there. If their
owner is the current user, testing their access rights based on assumption that they
are root fails. Skip the tests in that case similarly as is already done when the
tests are run as root.
This fixes following tests:
- tst_QTemporaryDir::nonWritableCurrentDir
- tst_QNetworkReply::getErrors(file-permissions)
- tst_qstandardpaths::testCustomRuntimeDirectory
Task-number: QTBUG-59966
Change-Id: I972ce37b4b5a7747cdd732a8e4a737ef09cbc6a5
Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp')
-rw-r--r-- | tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp index 758bbead84..4bed8d0fd6 100644 --- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp +++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp @@ -42,6 +42,7 @@ # include <sys/types.h> # include <unistd.h> #endif +#include "emulationdetector.h" class tst_QTemporaryDir : public QObject { @@ -316,6 +317,13 @@ void tst_QTemporaryDir::nonWritableCurrentDir() const QFileInfo nonWritableDirFi = QFileInfo(QLatin1String(nonWritableDir)); QVERIFY(nonWritableDirFi.isDir()); + + if (EmulationDetector::isRunningArmOnX86()) { + if (nonWritableDirFi.ownerId() == ::geteuid()) { + QSKIP("Sysroot directories are owned by the current user"); + } + } + QVERIFY(!nonWritableDirFi.isWritable()); ChdirOnReturn cor(QDir::currentPath()); |