Fix FileSystemAccessTest::testFileActions() flakiness

Always add " > /dev/null 2>&1" infix so that the
output of e.g. "rm" command, when failed, is redirected
to dev/null.

Enclose the input data in runInShell() with quotation
marks and escape all the characters in passed data
accordingly. Pass the "-e" option to echo in order to
turn on the escaping mode.

Add a new test for testCreateRemoteFile().

Change-Id: I7db07b57035242279cac7dd77a80ac6dd05bfb1f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-03-16 20:21:49 +01:00
parent de8a67a412
commit 481df466e2
3 changed files with 64 additions and 18 deletions

View File

@@ -45,12 +45,15 @@ class FileSystemAccessTest : public QObject
private slots:
void initTestCase();
void cleanupTestCase();
void testDirStatuses();
void testCreateRemoteFile_data();
void testCreateRemoteFile();
void testDirStatus();
void testBytesAvailable();
void testFileActions();
void cleanupTestCase();
private:
TestLinuxDeviceFactory m_testLinuxDeviceFactory;
bool m_skippedAtWhole = false;