diff options
author | Katja Marttila <katja.marttila@qt.io> | 2020-03-25 14:44:35 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2020-03-31 06:35:34 +0000 |
commit | 8d025e5dcd841939bdf44fc4705dffe429bca5b5 (patch) | |
tree | dd21ddf29cbefe4c7a0dcad3b0553a77ce85b143 /tests | |
parent | 3ed160565686da90f98c23918b57528dfcb6000e (diff) |
Fix bug in command line option update
Update was working only for latter component if several was given as
arguments.
Added also unit tests for cli option update
Also created common functions which are used by several
command line test.
Task-number: QTIFW-1695
Change-Id: I472e1c34bcfb1b60cda110353068f2cec64c468f
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'tests')
37 files changed, 638 insertions, 84 deletions
diff --git a/tests/auto/installer/cliinterface/tst_cliinterface.cpp b/tests/auto/installer/cliinterface/tst_cliinterface.cpp index b466d8771..c1e1de4b2 100644 --- a/tests/auto/installer/cliinterface/tst_cliinterface.cpp +++ b/tests/auto/installer/cliinterface/tst_cliinterface.cpp @@ -29,6 +29,7 @@ #include "metadatajob.h" #include "settings.h" #include "init.h" +#include "../shared/commonfunctions.h" #include <binarycontent.h> #include <component.h> @@ -55,33 +56,6 @@ private: QTest::ignoreMessage(QtDebugMsg, "Id: AB"); } - void verifyInstallerResources(const QString &componentName, const QString &fileName) - { - QDir dir(m_installDir + QDir::separator() + "installerResources" + QDir::separator() + componentName); - QVERIFY(dir.exists()); - QFileInfo fileInfo; - fileInfo.setFile(dir, fileName); - QVERIFY(fileInfo.exists()); - } - - void verifyInstallerResourcesDeletion(const QString &componentName, const QString &fileName) - { - QDir dir(m_installDir + QDir::separator() + "installerResources" + QDir::separator() + componentName); - QVERIFY(!dir.exists()); - QFileInfo fileInfo; - fileInfo.setFile(dir, fileName); - QVERIFY(!fileInfo.exists()); - } - - void verifyFileExistence(const QStringList &fileList) - { - foreach (const QString &file, fileList) { - QVERIFY(QFileInfo::exists(m_installDir + QDir::separator() + file)); - } - QDir dir(m_installDir); - QCOMPARE(dir.entryList(QStringList() << "*.*", QDir::Files).count(), fileList.count()); - } - PackageManagerCore &initPackagemanager(const QString &repository) { PackageManagerCore *core = new PackageManagerCore(BinaryContent::MagicInstallerMarker, QList<OperationBlob> ()); @@ -204,10 +178,10 @@ private slots: QInstaller::init(); //This will eat debug output PackageManagerCore &core = initPackagemanager(":///data/installPackagesRepository"); core.installSelectedComponentsSilently(QStringList() << QLatin1String("componentA")); - verifyInstallerResources("componentA", "1.0.0content.txt"); - verifyInstallerResources("componentE", "1.0.0content.txt"); //ForcedInstall - verifyInstallerResources("componentG", "1.0.0content.txt"); //Depends on componentA - verifyFileExistence(QStringList() << "components.xml" << "installcontent.txt" + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall + VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Depends on componentA + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); } @@ -216,16 +190,16 @@ private slots: QInstaller::init(); //This will eat debug output PackageManagerCore &core = initPackagemanager(":///data/installPackagesRepository"); core.installSelectedComponentsSilently(QStringList() << QLatin1String("componentA")); - verifyFileExistence(QStringList() << "components.xml" << "installcontentE.txt" + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentE.txt" << "installcontentA.txt" << "installcontent.txt" << "installcontentG.txt"); core.commitSessionOperations(); core.setPackageManager(); core.uninstallComponentsSilently(QStringList() << QLatin1String("componentA")); - verifyInstallerResources("componentE", "1.0.0content.txt"); //ForcedInstall - verifyInstallerResourcesDeletion("componentA", "1.0.0content.txt"); - verifyInstallerResourcesDeletion("componentG", "1.0.0content.txt"); //Depends on componentA - verifyFileExistence(QStringList() << "components.xml" << "installcontentE.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall + VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentA", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentG", "1.0.0content.txt"); //Depends on componentA + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentE.txt"); } void testInstallWithDependencySilently() @@ -233,12 +207,12 @@ private slots: QInstaller::init(); //This will eat debug output PackageManagerCore &core = initPackagemanager(":///data/installPackagesRepository"); core.installSelectedComponentsSilently(QStringList() << QLatin1String("componentC")); - verifyInstallerResources("componentA", "1.0.0content.txt"); //Dependency for componentC - verifyInstallerResources("componentB", "1.0.0content.txt"); //Dependency for componentC - verifyInstallerResources("componentE", "1.0.0content.txt"); //ForcedInstall - verifyInstallerResources("componentG", "1.0.0content.txt"); //Depends on componentA - verifyInstallerResources("componentD", "1.0.0content.txt"); //Autodepend on componentA and componentB - verifyFileExistence(QStringList() << "components.xml" << "installcontentC.txt" + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentC + VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "1.0.0content.txt"); //Dependency for componentC + VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall + VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Depends on componentA + VerifyInstaller::verifyInstallerResources(m_installDir, "componentD", "1.0.0content.txt"); //Autodepend on componentA and componentB + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentC.txt" << "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt" << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt"); } @@ -248,20 +222,20 @@ private slots: QInstaller::init(); //This will eat debug output PackageManagerCore &core = initPackagemanager(":///data/installPackagesRepository"); core.installSelectedComponentsSilently(QStringList() << QLatin1String("componentC")); - verifyFileExistence(QStringList() << "components.xml" << "installcontentC.txt" + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentC.txt" << "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt" << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt"); core.commitSessionOperations(); core.setPackageManager(); core.uninstallComponentsSilently(QStringList() << QLatin1String("componentC")); - verifyInstallerResources("componentA", "1.0.0content.txt"); //Dependency for componentC - verifyInstallerResources("componentB", "1.0.0content.txt"); //Dependency for componentC - verifyInstallerResources("componentE", "1.0.0content.txt"); //ForcedInstall - verifyInstallerResources("componentG", "1.0.0content.txt"); //Depends on componentA - verifyInstallerResources("componentD", "1.0.0content.txt"); //Autodepend on componentA and componentB - verifyInstallerResourcesDeletion("componentC", "1.0.0content.txt"); - verifyFileExistence(QStringList() << "components.xml" + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentC + VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "1.0.0content.txt"); //Dependency for componentC + VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall + VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Depends on componentA + VerifyInstaller::verifyInstallerResources(m_installDir, "componentD", "1.0.0content.txt"); //Autodepend on componentA and componentB + VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentC", "1.0.0content.txt"); + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" << "installcontentA.txt" << "installcontentB.txt" << "installcontentD.txt"<< "installcontentE.txt" << "installcontentG.txt"); } @@ -271,13 +245,13 @@ private slots: QInstaller::init(); //This will eat debug output PackageManagerCore &core = initPackagemanager(":///data/installPackagesRepository"); core.installSelectedComponentsSilently(QStringList() << QLatin1String("componentF.subcomponent2.subsubcomponent2")); - verifyInstallerResources("componentF.subcomponent2.subsubcomponent2", "1.0.0content.txt"); - verifyInstallerResources("componentF.subcomponent2", "1.0.0content.txt"); - verifyInstallerResources("componentF", "1.0.0content.txt"); - verifyInstallerResources("componentA", "1.0.0content.txt"); //Dependency for componentG - verifyInstallerResources("componentE", "1.0.0content.txt"); //ForcedInstall - verifyInstallerResources("componentG", "1.0.0content.txt"); //Default install - verifyFileExistence(QStringList() << "components.xml" << "installcontentF.txt" + VerifyInstaller::verifyInstallerResources(m_installDir, "componentF.subcomponent2.subsubcomponent2", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentF.subcomponent2", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentF", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentG + VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall + VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Default install + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentF.txt" << "installcontentF_2.txt" << "installcontentF_2_2.txt" << "installcontent.txt" << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); @@ -288,20 +262,20 @@ private slots: QInstaller::init(); //This will eat debug output PackageManagerCore &core = initPackagemanager(":///data/installPackagesRepository"); core.installSelectedComponentsSilently(QStringList() << QLatin1String("componentF.subcomponent2.subsubcomponent2")); - verifyFileExistence(QStringList() << "components.xml" << "installcontentF.txt" + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentF.txt" << "installcontentF_2.txt" << "installcontentF_2_2.txt" << "installcontent.txt" << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); core.commitSessionOperations(); core.setPackageManager(); core.uninstallComponentsSilently(QStringList() << QLatin1String("componentF.subcomponent2")); - verifyInstallerResources("componentA", "1.0.0content.txt"); //Dependency for componentG - verifyInstallerResources("componentE", "1.0.0content.txt"); //ForcedInstall - verifyInstallerResources("componentG", "1.0.0content.txt"); //Default install - verifyInstallerResourcesDeletion("componentF.subcomponent2.subsubcomponent2", "1.0.0content.txt"); - verifyInstallerResourcesDeletion("componentF.subcomponent2", "1.0.0content.txt"); - verifyInstallerResourcesDeletion("componentF", "1.0.0content.txt"); - verifyFileExistence(QStringList() << "components.xml" + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentG + VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall + VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Default install + VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentF.subcomponent2.subsubcomponent2", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentF.subcomponent2", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentF", "1.0.0content.txt"); + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); } @@ -311,10 +285,10 @@ private slots: QInstaller::init(); //This will eat debug output PackageManagerCore &core = initPackagemanager(":///data/installPackagesRepository"); core.installDefaultComponentsSilently(); - verifyInstallerResources("componentA", "1.0.0content.txt"); //Dependency for componentG - verifyInstallerResources("componentE", "1.0.0content.txt"); //ForcedInstall - verifyInstallerResources("componentG", "1.0.0content.txt"); //Default - verifyFileExistence(QStringList() << "components.xml" << "installcontent.txt" + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentG + VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall + VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Default + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); } @@ -323,16 +297,16 @@ private slots: QInstaller::init(); //This will eat debug output PackageManagerCore &core = initPackagemanager(":///data/installPackagesRepository"); core.installDefaultComponentsSilently(); - verifyFileExistence(QStringList() << "components.xml" << "installcontent.txt" + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); core.commitSessionOperations(); core.setPackageManager(); core.uninstallComponentsSilently(QStringList() << "componentG"); - verifyInstallerResources("componentA", "1.0.0content.txt"); //Dependency for componentG - verifyInstallerResources("componentE", "1.0.0content.txt"); //ForcedInstall - verifyInstallerResourcesDeletion("componentG", "1.0.0content.txt"); - verifyFileExistence(QStringList() << "components.xml" << "installcontent.txt" + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentG + VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall + VerifyInstaller::verifyInstallerResourcesDeletion(m_installDir, "componentG", "1.0.0content.txt"); + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" << "installcontentA.txt" << "installcontentE.txt"); } @@ -345,10 +319,10 @@ private slots: core.setPackageManager(); core.uninstallComponentsSilently(QStringList() << "componentE"); //Nothing is uninstalled as componentE is forced install and cannot be uninstalled - verifyInstallerResources("componentA", "1.0.0content.txt"); //Dependency for componentG - verifyInstallerResources("componentE", "1.0.0content.txt"); //ForcedInstall - verifyInstallerResources("componentG", "1.0.0content.txt"); //Default - verifyFileExistence(QStringList() << "components.xml" << "installcontent.txt" + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); //Dependency for componentG + VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall + VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Default + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); } @@ -361,12 +335,12 @@ private slots: core.setPackageManager(); core.uninstallComponentsSilently(QStringList() << "componentD"); //Nothing is uninstalled as componentD is installed as autodependency to componentA and componentB - verifyInstallerResources("componentA", "1.0.0content.txt"); - verifyInstallerResources("componentB", "1.0.0content.txt"); - verifyInstallerResources("componentD", "1.0.0content.txt"); - verifyInstallerResources("componentE", "1.0.0content.txt"); //ForcedInstall - verifyInstallerResources("componentG", "1.0.0content.txt"); //Default - verifyFileExistence(QStringList() << "components.xml" << "installcontent.txt" + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentD", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall + VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Default + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt" << "installcontentB.txt" << "installcontentD.txt"); } diff --git a/tests/auto/installer/commandlineupdate/commandlineupdate.pro b/tests/auto/installer/commandlineupdate/commandlineupdate.pro new file mode 100644 index 000000000..3446eb286 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/commandlineupdate.pro @@ -0,0 +1,8 @@ +include(../../qttest.pri) + +QT += qml + +SOURCES += tst_commandlineupdate.cpp + +RESOURCES += \ + settings.qrc diff --git a/tests/auto/installer/commandlineupdate/data/config.xml b/tests/auto/installer/commandlineupdate/data/config.xml new file mode 100644 index 000000000..041ce5062 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/config.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Installer> + <Name>Your application</Name> + <Version>1.2.3</Version> + <MaintenanceToolName></MaintenanceToolName> + <MaintenanceToolIniFile></MaintenanceToolIniFile> + <TargetConfigurationFile></TargetConfigurationFile> +</Installer> diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/Updates.xml b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/Updates.xml new file mode 100644 index 000000000..824a6e21f --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/Updates.xml @@ -0,0 +1,153 @@ +<Updates> + <ApplicationName>{AnyApplication}</ApplicationName> + <ApplicationVersion>1.0.0</ApplicationVersion> + <Checksum>false</Checksum> + <PackageUpdate> + <Name>componentA</Name> + <DisplayName>Component A</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>100</SortingPriority> + <UpdateFile OS="Any" CompressedSize="299" UncompressedSize="158"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>92b02a74d0886bc1569ff8b3a7edd1f9d828e56c</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentB</Name> + <DisplayName>Component B</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>90</SortingPriority> + <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>aedfaef53cdc0f52353a8680009be405fa767811</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentC</Name> + <DisplayName>Component C (depends on A and B)</DisplayName> + <Description>This component depends on Component A and Component B. Selecting this component for installation also marks Component A and Component B for installation, which in turn marks Component D, because it has an automatic dependency on Component A and Component B.</Description> + <Dependencies>componentA, componentB</Dependencies> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>80</SortingPriority> + <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>20b9463a5e06f373182b3c7c4cf879806d429409</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentD</Name> + <DisplayName>Component D (auto depends on A and B)</DisplayName> + <Description>This component has an automatic dependency on Component A and Component B. If both A and B are marked for installation, this component is also installed.</Description> + <AutoDependOn>componentA, componentB</AutoDependOn> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>70</SortingPriority> + <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>99cf24c71559c75dfae9933826ed16051fca6ea1</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentE</Name> + <DisplayName>Component E (forced)</DisplayName> + <Description>This is a forced component that is always installed.</Description> + <ForcedInstallation>true</ForcedInstallation> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>60</SortingPriority> + <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>926bf503ccdff93351744843a95e5e2172cad5ec</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF</Name> + <DisplayName>Component F</DisplayName> + <Description>This component contains 2 subcomponents.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>40</SortingPriority> + <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>e6443a8b5a5651f63c0604cae6d32431ca617f1a</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent1</Name> + <DisplayName>Subcomponent 1</DisplayName> + <Description>This component contains 2 leaf components.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>100</SortingPriority> + <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>a3bc5dce1c93add30c22e46436396c66b0b51001</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent1.subsubcomponent1</Name> + <DisplayName>Subsubcomponent 1</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>100</SortingPriority> + <UpdateFile OS="Any" CompressedSize="289" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>ebe4d69414a1675a7f46887e15d9bffc275b7cc4</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent1.subsubcomponent2</Name> + <DisplayName>Subsubcomponent 2</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>50</SortingPriority> + <UpdateFile OS="Any" CompressedSize="289" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>e4379d20320d4c173b2d8e228f5722e3f36e3114</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent2</Name> + <DisplayName>Subcomponent 2</DisplayName> + <Description>This component contains 2 leaf components.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>50</SortingPriority> + <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>6462be25912c490569a7c4f3931d978e78c69dc4</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent2.subsubcomponent1</Name> + <DisplayName>Subsubcomponent 1</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>100</SortingPriority> + <UpdateFile OS="Any" CompressedSize="289" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>72b224bc8f3431210834ce6db373fc8d638a3546</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent2.subsubcomponent2</Name> + <DisplayName>Subsubcomponent 2</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>50</SortingPriority> + <UpdateFile OS="Any" CompressedSize="289" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>3e2744edaef06af75b3248d5935523a6e2e61551</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentG</Name> + <DisplayName>Component G (default, depends on A, dependency added dynamically)</DisplayName> + <Description>By default, this component is selected for installation. It depends on component A. Dependency is added from inside component script.</Description> + <Default>true</Default> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <Script>installscript.js</Script> + <SortingPriority>30</SortingPriority> + <UpdateFile OS="Any" CompressedSize="281" UncompressedSize="99"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>8cba36dd589492c28e0d04942b4f8aa0a09f59cc</SHA1> + </PackageUpdate> +</Updates> diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentA/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentA/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..4ddbe565b --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentA/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentB/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentB/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..f84ffcdc5 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentB/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentC/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentC/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..9ad11e06f --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentC/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentD/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentD/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..0c8c52e31 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentD/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentE/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentE/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..f5abacf81 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentE/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..3aced680f --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..e5385a163 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent1/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent1/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..5bc549863 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent1/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..da9e9f340 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..d0b013706 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent2/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent2/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..74ab44033 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF.subcomponent2/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..4a04b1394 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentF/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentG/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentG/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..81fc02052 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentG/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentG/1.0.0meta.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentG/1.0.0meta.7z Binary files differnew file mode 100644 index 000000000..e5c446f64 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepository/componentG/1.0.0meta.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/Updates.xml b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/Updates.xml new file mode 100644 index 000000000..f87a105b4 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/Updates.xml @@ -0,0 +1,153 @@ +<Updates> + <ApplicationName>{AnyApplication}</ApplicationName> + <ApplicationVersion>1.0.0</ApplicationVersion> + <Checksum>false</Checksum> + <PackageUpdate> + <Name>componentA</Name> + <DisplayName>Component A</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>2.0.0</Version> + <ReleaseDate>2015-08-25</ReleaseDate> + <SortingPriority>100</SortingPriority> + <UpdateFile CompressedSize="297" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>43c8fcc544ea6d35fe5180a50d4764dcf9fd7473</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentB</Name> + <DisplayName>Component B</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>2.0.0</Version> + <ReleaseDate>2015-08-25</ReleaseDate> + <SortingPriority>90</SortingPriority> + <UpdateFile CompressedSize="297" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>c360591443f4f46c14cd05b0e7f93a105857b563</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentC</Name> + <DisplayName>Component C (depends on A and B)</DisplayName> + <Description>This component depends on Component A and Component B. Selecting this component for installation also marks Component A and Component B for installation, which in turn marks Component D, because it has an automatic dependency on Component A and Component B.</Description> + <Dependencies>componentA, componentB</Dependencies> + <Version>2.0.0</Version> + <ReleaseDate>2015-08-25</ReleaseDate> + <SortingPriority>80</SortingPriority> + <UpdateFile CompressedSize="297" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>3c5acf95ad15a2ea6e2baaf55dd79053ca439668</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentD</Name> + <DisplayName>Component D (auto depends on A and B)</DisplayName> + <Description>This component has an automatic dependency on Component A and Component B. If both A and B are marked for installation, this component is also installed.</Description> + <AutoDependOn>componentA, componentB</AutoDependOn> + <Version>2.0.0</Version> + <ReleaseDate>2015-08-25</ReleaseDate> + <SortingPriority>70</SortingPriority> + <UpdateFile CompressedSize="297" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>5b014c99bf083377024f3de42553faad0c69ebbb</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentE</Name> + <DisplayName>Component E (forced)</DisplayName> + <Description>This is a forced component that is always installed.</Description> + <ForcedInstallation>true</ForcedInstallation> + <Version>2.0.0</Version> + <ReleaseDate>2015-08-25</ReleaseDate> + <SortingPriority>60</SortingPriority> + <UpdateFile CompressedSize="297" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>bf312c4593abaa8f6d18a1504c411e5ec8130860</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF</Name> + <DisplayName>Component F</DisplayName> + <Description>This component contains 2 subcomponents.</Description> + <Version>2.0.0</Version> + <ReleaseDate>2015-08-25</ReleaseDate> + <SortingPriority>40</SortingPriority> + <UpdateFile CompressedSize="297" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>d8764d228cc32be0959b286cf57a30252082d2dc</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent1</Name> + <DisplayName>Subcomponent 1</DisplayName> + <Description>This component contains 2 leaf components.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>100</SortingPriority> + <UpdateFile CompressedSize="281" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>fbdd255c25820331ffea46c9a80905580fb8ad4f</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent1.subsubcomponent1</Name> + <DisplayName>Subsubcomponent 1</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>100</SortingPriority> + <UpdateFile CompressedSize="289" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>c96ddbefa66f5a3400e0c2f3a458c0f619d99690</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent1.subsubcomponent2</Name> + <DisplayName>Subsubcomponent 2</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>50</SortingPriority> + <UpdateFile CompressedSize="289" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>c88f52f11f22089d7efc3b65394e96ee1656702e</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent2</Name> + <DisplayName>Subcomponent 2</DisplayName> + <Description>This component contains 2 leaf components.</Description> + <Version>2.0.0</Version> + <ReleaseDate>2015-08-25</ReleaseDate> + <SortingPriority>50</SortingPriority> + <UpdateFile CompressedSize="297" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>57120d69b22e013666b80d3954b1ee65eb37891f</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent2.subsubcomponent1</Name> + <DisplayName>Subsubcomponent 1</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>100</SortingPriority> + <UpdateFile CompressedSize="289" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>3844dc1b4805050f34b483661843a8f8a4e97864</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentF.subcomponent2.subsubcomponent2</Name> + <DisplayName>Subsubcomponent 2</DisplayName> + <Description>This component does not depend on any other component.</Description> + <Version>1.0.0</Version> + <ReleaseDate>2014-08-25</ReleaseDate> + <SortingPriority>50</SortingPriority> + <UpdateFile CompressedSize="289" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>e1d988818cb8fd89e8863b5699b19823e38f0919</SHA1> + </PackageUpdate> + <PackageUpdate> + <Name>componentG</Name> + <DisplayName>Component G (default, depends on A, dependency added dynamically)</DisplayName> + <Description>By default, this component is selected for installation. It depends on component A. Dependency is added from inside component script.</Description> + <Default>true</Default> + <Version>2.0.0</Version> + <ReleaseDate>2015-08-25</ReleaseDate> + <Script>installscript.js</Script> + <SortingPriority>30</SortingPriority> + <UpdateFile CompressedSize="297" UncompressedSize="99" OS="Any"/> + <DownloadableArchives>content.7z</DownloadableArchives> + <SHA1>098b5ecafe8853371fd608acd9b1ccab252ef5df</SHA1> + </PackageUpdate> +</Updates> diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentA/2.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentA/2.0.0content.7z Binary files differnew file mode 100644 index 000000000..9e947f5f7 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentA/2.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentB/2.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentB/2.0.0content.7z Binary files differnew file mode 100644 index 000000000..08f7ad70d --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentB/2.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentC/2.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentC/2.0.0content.7z Binary files differnew file mode 100644 index 000000000..3cd9e94fe --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentC/2.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentD/2.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentD/2.0.0content.7z Binary files differnew file mode 100644 index 000000000..992b756d2 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentD/2.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentE/2.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentE/2.0.0content.7z Binary files differnew file mode 100644 index 000000000..d6e7562b1 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentE/2.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..b559dd72f --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..a2109e812 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent1/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent1/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..55655d1d3 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent1/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..c469c39a9 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..164348ac9 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent2/2.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent2/2.0.0content.7z Binary files differnew file mode 100644 index 000000000..921c501cd --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF.subcomponent2/2.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF/2.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF/2.0.0content.7z Binary files differnew file mode 100644 index 000000000..6973624df --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentF/2.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentG/2.0.0content.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentG/2.0.0content.7z Binary files differnew file mode 100644 index 000000000..a3d72046e --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentG/2.0.0content.7z diff --git a/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentG/2.0.0meta.7z b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentG/2.0.0meta.7z Binary files differnew file mode 100644 index 000000000..a34fd36f1 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/data/installPackagesRepositoryUpdate/componentG/2.0.0meta.7z diff --git a/tests/auto/installer/commandlineupdate/installer-config/config.xml b/tests/auto/installer/commandlineupdate/installer-config/config.xml new file mode 100644 index 000000000..adc24631b --- /dev/null +++ b/tests/auto/installer/commandlineupdate/installer-config/config.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<Installer> + <Name>test</Name> + <Version>1.0.0</Version> +</Installer> diff --git a/tests/auto/installer/commandlineupdate/settings.qrc b/tests/auto/installer/commandlineupdate/settings.qrc new file mode 100644 index 000000000..b410099f4 --- /dev/null +++ b/tests/auto/installer/commandlineupdate/settings.qrc @@ -0,0 +1,38 @@ +<RCC> + <qresource prefix="/"> + <file>data/config.xml</file> + <file>data/installPackagesRepository/Updates.xml</file> + <file>data/installPackagesRepository/componentA/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentB/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentC/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentD/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentE/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentF/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentG/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentG/1.0.0meta.7z</file> + <file>data/installPackagesRepository/componentF.subcomponent1/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentF.subcomponent2/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z</file> + <file>data/installPackagesRepository/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/Updates.xml</file> + <file>data/installPackagesRepositoryUpdate/componentA/2.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentB/2.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentC/2.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentD/2.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentE/2.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentF/2.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentG/2.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentG/2.0.0meta.7z</file> + <file>data/installPackagesRepositoryUpdate/componentF.subcomponent1/1.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentF.subcomponent2/2.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentF.subcomponent1.subsubcomponent1/1.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentF.subcomponent1.subsubcomponent2/1.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentF.subcomponent2.subsubcomponent1/1.0.0content.7z</file> + <file>data/installPackagesRepositoryUpdate/componentF.subcomponent2.subsubcomponent2/1.0.0content.7z</file> + </qresource> + <qresource prefix="/metadata"> + <file>installer-config/config.xml</file> + </qresource> +</RCC> diff --git a/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp b/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp new file mode 100644 index 000000000..1736a2f6c --- /dev/null +++ b/tests/auto/installer/commandlineupdate/tst_commandlineupdate.cpp @@ -0,0 +1,144 @@ +/************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Installer Framework. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +**************************************************************************/ + +#include "metadatajob.h" +#include "settings.h" +#include "init.h" +#include "../shared/commonfunctions.h" + +#include <binarycontent.h> +#include <component.h> +#include <errors.h> +#include <fileutils.h> +#include <packagemanagercore.h> +#include <progresscoordinator.h> + +#include <QLoggingCategory> +#include <QTest> + +using namespace QInstaller; + +class tst_CommandLineUpdate : public QObject +{ + Q_OBJECT + +private: + void setRepository(const QString &repository) + { + core->reset(); + core->cancelMetaInfoJob(); //Call cancel to reset metadata so that update repositories are fetched + + QSet<Repository> repoList; + Repository repo = Repository::fromUserInput(repository); + repoList.insert(repo); + core->settings().setDefaultRepositories(repoList); + } + +private slots: + void initTestCase() + { + core = new PackageManagerCore(BinaryContent::MagicInstallerMarker, QList<OperationBlob> ()); + m_installDir = QInstaller::generateTemporaryFileName(); + QDir().mkpath(m_installDir); + core->setValue(scTargetDir, m_installDir); + } + + void testUpdatePackageSilently() + { + QInstaller::init(); //This will eat debug output + setRepository(":///data/installPackagesRepository"); + core->installSelectedComponentsSilently(QStringList() << "componentA" << "componentB"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "1.0.0content.txt"); + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" + << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt" + << "installcontentB.txt" << "installcontentD.txt"); + core->commitSessionOperations(); + + setRepository(":///data/installPackagesRepositoryUpdate"); + core->updateComponentsSilently(QStringList() << "componentA"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "2.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResourceFileDeletion(m_installDir, "componentA", "1.0.0content.txt"); + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontentA_update.txt" + << "installcontentE.txt" << "installcontentG.txt" + << "installcontentB.txt" << "installcontentD.txt"); + } + + void testUpdateTwoPackageSilently() + { + QInstaller::init(); //This will eat debug output + setRepository(":///data/installPackagesRepository"); + core->installSelectedComponentsSilently(QStringList() << "componentA" << "componentB" << "componentG"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); + core->commitSessionOperations(); + + setRepository(":///data/installPackagesRepositoryUpdate"); + core->updateComponentsSilently(QStringList() << "componentB" << "componentG"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentB", "2.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "2.0.0content.txt"); + VerifyInstaller::verifyInstallerResourceFileDeletion(m_installDir, "componentB", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResourceFileDeletion(m_installDir, "componentG", "1.0.0content.txt"); + } + + void testUpdateAllPackagesSilently() + { + QInstaller::init(); //This will eat debug output + setRepository(":///data/installPackagesRepository"); + core->installSelectedComponentsSilently(QStringList() << "componentA" << "componentB" << "componentG" << "componentF"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentF", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentF.subcomponent1", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentF.subcomponent1.subsubcomponent1", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentF.subcomponent2", "1.0.0content.txt"); + core->commitSessionOperations(); + + setRepository(":///data/installPackagesRepositoryUpdate"); + core->updateComponentsSilently(QStringList()); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentF", "2.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentF.subcomponent2", "2.0.0content.txt"); + VerifyInstaller::verifyInstallerResourceFileDeletion(m_installDir, "componentF", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResourceFileDeletion(m_installDir, "componentF.subcomponent2", "1.0.0content.txt"); + } + + void cleanupTestCase() + { + QDir dir(m_installDir); + QVERIFY(dir.removeRecursively()); + delete core; + } + +private: + QString m_installDir; + PackageManagerCore *core; +}; + + +QTEST_MAIN(tst_CommandLineUpdate) + +#include "tst_commandlineupdate.moc" diff --git a/tests/auto/installer/shared/commonfunctions.h b/tests/auto/installer/shared/commonfunctions.h new file mode 100644 index 000000000..5e8e2304c --- /dev/null +++ b/tests/auto/installer/shared/commonfunctions.h @@ -0,0 +1,71 @@ +/************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Installer Framework. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +**************************************************************************/ + +#ifndef VERIFYINSTALLER_H +#define VERIFYINSTALLER_H + +#include <QDir> +#include <QTest> +#include <QString> +#include <QStringList> + +struct VerifyInstaller +{ + static void verifyInstallerResources(const QString &installDir, const QString &componentName, const QString &fileName) + { + QDir dir(installDir + QDir::separator() + "installerResources" + QDir::separator() + componentName); + QVERIFY(dir.exists()); + QFileInfo fileInfo; + fileInfo.setFile(dir, fileName); + QVERIFY(fileInfo.exists()); + } + + static void verifyInstallerResourcesDeletion(const QString &installDir, const QString &componentName, const QString &fileName) + { + QDir dir(installDir + QDir::separator() + "installerResources" + QDir::separator() + componentName); + QVERIFY(!dir.exists()); + } + + static void verifyInstallerResourceFileDeletion(const QString &installDir, const QString &componentName, const QString &fileName) + { + QDir dir(installDir + QDir::separator() + "installerResources" + QDir::separator() + componentName); + QFileInfo fileInfo; + fileInfo.setFile(dir, fileName); + QVERIFY(!fileInfo.exists()); + } + + static void verifyFileExistence(const QString &installDir, const QStringList &fileList) + { + for (int i = 0; i < fileList.count(); i++) + QVERIFY(QFileInfo::exists(installDir + QDir::separator() + fileList.at(i))); + + QDir dir(installDir); + QCOMPARE(dir.entryList(QStringList() << "*.*", QDir::Files).count(), fileList.count()); + } +}; +#endif |