diff options
author | Katja Marttila <katja.marttila@qt.io> | 2020-03-31 14:18:59 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2020-04-02 09:08:40 +0300 |
commit | 8370a30a7cb7d5445bc6fc184141cfcbebc46cb6 (patch) | |
tree | b598899782e13a0d9e002128755ad5d3bc58078e /tests | |
parent | 4ace54659912e0546c451adb932a3ca870ad6c31 (diff) |
Ignore test executable process when running tests
Installer checks if running processes are found from install tree and
prevents removing/updating. Added test executable to allowed running
process list as we are not trying to remove it.
Change-Id: I74445f54971942bbe81bab6c49378fe0a345aa3f
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/installer/cliinterface/tst_cliinterface.cpp | 4 | ||||
-rw-r--r-- | tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/installer/cliinterface/tst_cliinterface.cpp b/tests/auto/installer/cliinterface/tst_cliinterface.cpp index c1e1de4b2..70305a647 100644 --- a/tests/auto/installer/cliinterface/tst_cliinterface.cpp +++ b/tests/auto/installer/cliinterface/tst_cliinterface.cpp @@ -59,6 +59,8 @@ private: PackageManagerCore &initPackagemanager(const QString &repository) { PackageManagerCore *core = new PackageManagerCore(BinaryContent::MagicInstallerMarker, QList<OperationBlob> ()); + QString appFilePath = QCoreApplication::applicationFilePath(); + core->setAllowedRunningProcesses(QStringList() << appFilePath); QSet<Repository> repoList; Repository repo = Repository::fromUserInput(repository); repoList.insert(repo); @@ -135,6 +137,8 @@ private slots: QString loggingRules = (QLatin1String("ifw.installer.installog = true\n")); PackageManagerCore core; core.setPackageManager(); + QString appFilePath = QCoreApplication::applicationFilePath(); + core.setAllowedRunningProcesses(QStringList() << appFilePath); QLoggingCategory::setFilterRules(loggingRules); m_installDir = QInstaller::generateTemporaryFileName(); diff --git a/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp b/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp index 1736a2f6c..d1d174377 100644 --- a/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp +++ b/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp @@ -63,6 +63,8 @@ private slots: void initTestCase() { core = new PackageManagerCore(BinaryContent::MagicInstallerMarker, QList<OperationBlob> ()); + QString appFilePath = QCoreApplication::applicationFilePath(); + core->setAllowedRunningProcesses(QStringList() << appFilePath); m_installDir = QInstaller::generateTemporaryFileName(); QDir().mkpath(m_installDir); core->setValue(scTargetDir, m_installDir); |