summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/tools')
-rw-r--r--tests/auto/tools/repotest/packages/A/data/A.txt2
-rw-r--r--tests/auto/tools/repotest/packages/A/meta/package.xml9
-rw-r--r--tests/auto/tools/repotest/packages/A/meta/script1.0.0.qs3
-rw-r--r--tests/auto/tools/repotest/packages/B/data/B.txt2
-rw-r--r--tests/auto/tools/repotest/packages/B/meta/package.xml8
-rw-r--r--tests/auto/tools/repotest/packages_new/C/data/C.txt2
-rw-r--r--tests/auto/tools/repotest/packages_new/C/meta/package.xml8
-rw-r--r--tests/auto/tools/repotest/packages_update/A/data/A_update.txt2
-rw-r--r--tests/auto/tools/repotest/packages_update/A/meta/package.xml9
-rw-r--r--tests/auto/tools/repotest/packages_update/A/meta/script2.0.0.qs3
-rw-r--r--tests/auto/tools/repotest/packages_update/B/data/B_update.txt2
-rw-r--r--tests/auto/tools/repotest/packages_update/B/meta/package.xml8
-rw-r--r--tests/auto/tools/repotest/repository_component/A/2.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/repository_component/A/2.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/repository_component/A/2.0.0meta.7zbin0 -> 209 bytes
-rw-r--r--tests/auto/tools/repotest/repository_component/B/1.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/repository_component/B/1.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/repository_component/B/1.0.0meta.7zbin0 -> 106 bytes
-rw-r--r--tests/auto/tools/repotest/repository_component/Updates.xml28
-rw-r--r--tests/auto/tools/repotest/repository_componentAndUnite/2020-11-10-0816_meta.7zbin0 -> 218 bytes
-rw-r--r--tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7zbin0 -> 200 bytes
-rw-r--r--tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0meta.7zbin0 -> 215 bytes
-rw-r--r--tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7zbin0 -> 199 bytes
-rw-r--r--tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0meta.7zbin0 -> 106 bytes
-rw-r--r--tests/auto/tools/repotest/repository_componentAndUnite/Updates.xml30
-rw-r--r--tests/auto/tools/repotest/repository_unite/2020-11-10-0931_meta.7zbin0 -> 217 bytes
-rw-r--r--tests/auto/tools/repotest/repository_unite/A/2.0.0content.7zbin0 -> 200 bytes
-rw-r--r--tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/repository_unite/C/1.0.0content.7zbin0 -> 199 bytes
-rw-r--r--tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/repository_unite/Updates.xml28
-rw-r--r--tests/auto/tools/repotest/repotest.pro6
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0meta.7zbin0 -> 209 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0meta.7zbin0 -> 106 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/Updates.xml28
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0meta.7zbin0 -> 221 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0meta.7zbin0 -> 106 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/Updates.xml28
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0meta.7zbin0 -> 221 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0meta.7zbin0 -> 106 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/Updates.xml28
-rw-r--r--tests/auto/tools/repotest/tst_repotest.cpp582
-rw-r--r--tests/auto/tools/tools.pro4
57 files changed, 832 insertions, 0 deletions
diff --git a/tests/auto/tools/repotest/packages/A/data/A.txt b/tests/auto/tools/repotest/packages/A/data/A.txt
new file mode 100644
index 000000000..98114dd6e
--- /dev/null
+++ b/tests/auto/tools/repotest/packages/A/data/A.txt
@@ -0,0 +1,2 @@
+Example content for package A.
+
diff --git a/tests/auto/tools/repotest/packages/A/meta/package.xml b/tests/auto/tools/repotest/packages/A/meta/package.xml
new file mode 100644
index 000000000..8383b10c7
--- /dev/null
+++ b/tests/auto/tools/repotest/packages/A/meta/package.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Package>
+ <DisplayName>A</DisplayName>
+ <Description>Example component A</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <Script>script1.0.0.qs</Script>
+</Package>
diff --git a/tests/auto/tools/repotest/packages/A/meta/script1.0.0.qs b/tests/auto/tools/repotest/packages/A/meta/script1.0.0.qs
new file mode 100644
index 000000000..addf3329a
--- /dev/null
+++ b/tests/auto/tools/repotest/packages/A/meta/script1.0.0.qs
@@ -0,0 +1,3 @@
+function Component()
+{
+}
diff --git a/tests/auto/tools/repotest/packages/B/data/B.txt b/tests/auto/tools/repotest/packages/B/data/B.txt
new file mode 100644
index 000000000..1ee864074
--- /dev/null
+++ b/tests/auto/tools/repotest/packages/B/data/B.txt
@@ -0,0 +1,2 @@
+Example content for package B.
+
diff --git a/tests/auto/tools/repotest/packages/B/meta/package.xml b/tests/auto/tools/repotest/packages/B/meta/package.xml
new file mode 100644
index 000000000..99b723d50
--- /dev/null
+++ b/tests/auto/tools/repotest/packages/B/meta/package.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Package>
+ <DisplayName>B</DisplayName>
+ <Description>Example component B</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+</Package>
diff --git a/tests/auto/tools/repotest/packages_new/C/data/C.txt b/tests/auto/tools/repotest/packages_new/C/data/C.txt
new file mode 100644
index 000000000..b45c73606
--- /dev/null
+++ b/tests/auto/tools/repotest/packages_new/C/data/C.txt
@@ -0,0 +1,2 @@
+Example content for package C.
+
diff --git a/tests/auto/tools/repotest/packages_new/C/meta/package.xml b/tests/auto/tools/repotest/packages_new/C/meta/package.xml
new file mode 100644
index 000000000..676f088be
--- /dev/null
+++ b/tests/auto/tools/repotest/packages_new/C/meta/package.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Package>
+ <DisplayName>C</DisplayName>
+ <Description>Example component C</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+</Package>
diff --git a/tests/auto/tools/repotest/packages_update/A/data/A_update.txt b/tests/auto/tools/repotest/packages_update/A/data/A_update.txt
new file mode 100644
index 000000000..98114dd6e
--- /dev/null
+++ b/tests/auto/tools/repotest/packages_update/A/data/A_update.txt
@@ -0,0 +1,2 @@
+Example content for package A.
+
diff --git a/tests/auto/tools/repotest/packages_update/A/meta/package.xml b/tests/auto/tools/repotest/packages_update/A/meta/package.xml
new file mode 100644
index 000000000..1763dc4d8
--- /dev/null
+++ b/tests/auto/tools/repotest/packages_update/A/meta/package.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Package>
+ <DisplayName>A</DisplayName>
+ <Description>Example component A</Description>
+ <Version>2.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <Script>script2.0.0.qs</Script>
+</Package>
diff --git a/tests/auto/tools/repotest/packages_update/A/meta/script2.0.0.qs b/tests/auto/tools/repotest/packages_update/A/meta/script2.0.0.qs
new file mode 100644
index 000000000..addf3329a
--- /dev/null
+++ b/tests/auto/tools/repotest/packages_update/A/meta/script2.0.0.qs
@@ -0,0 +1,3 @@
+function Component()
+{
+}
diff --git a/tests/auto/tools/repotest/packages_update/B/data/B_update.txt b/tests/auto/tools/repotest/packages_update/B/data/B_update.txt
new file mode 100644
index 000000000..1ee864074
--- /dev/null
+++ b/tests/auto/tools/repotest/packages_update/B/data/B_update.txt
@@ -0,0 +1,2 @@
+Example content for package B.
+
diff --git a/tests/auto/tools/repotest/packages_update/B/meta/package.xml b/tests/auto/tools/repotest/packages_update/B/meta/package.xml
new file mode 100644
index 000000000..99b723d50
--- /dev/null
+++ b/tests/auto/tools/repotest/packages_update/B/meta/package.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Package>
+ <DisplayName>B</DisplayName>
+ <Description>Example component B</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+</Package>
diff --git a/tests/auto/tools/repotest/repository_component/A/2.0.0content.7z b/tests/auto/tools/repotest/repository_component/A/2.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_component/A/2.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_component/A/2.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_component/A/2.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_component/A/2.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/repository_component/A/2.0.0meta.7z b/tests/auto/tools/repotest/repository_component/A/2.0.0meta.7z
new file mode 100644
index 000000000..af0863696
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_component/A/2.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_component/B/1.0.0content.7z b/tests/auto/tools/repotest/repository_component/B/1.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_component/B/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_component/B/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_component/B/1.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_component/B/1.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/repository_component/B/1.0.0meta.7z b/tests/auto/tools/repotest/repository_component/B/1.0.0meta.7z
new file mode 100644
index 000000000..e5be1148e
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_component/B/1.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_component/Updates.xml b/tests/auto/tools/repotest/repository_component/Updates.xml
new file mode 100644
index 000000000..dfae8c8bd
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_component/Updates.xml
@@ -0,0 +1,28 @@
+<Updates>
+ <ApplicationName>{AnyApplication}</ApplicationName>
+ <ApplicationVersion>1.0.0</ApplicationVersion>
+ <Checksum>true</Checksum>
+ <PackageUpdate>
+ <Name>A</Name>
+ <DisplayName>A</DisplayName>
+ <Description>Example component A</Description>
+ <Version>2.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <Script>script2.0.0.qs</Script>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>da6dae55a8cc3fb9f012e33fa7b9c187a823aa9a</SHA1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>B</Name>
+ <DisplayName>B</DisplayName>
+ <Description>Example component B</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>d88b373458b4bbec38132692061bf1e7aa68e7f7</SHA1>
+ </PackageUpdate>
+</Updates>
diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/2020-11-10-0816_meta.7z b/tests/auto/tools/repotest/repository_componentAndUnite/2020-11-10-0816_meta.7z
new file mode 100644
index 000000000..6a17ac028
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_componentAndUnite/2020-11-10-0816_meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z
new file mode 100644
index 000000000..ef8741d32
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z.sha1
new file mode 100644
index 000000000..d5e23fd53
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z.sha1
@@ -0,0 +1 @@
+c7cca768ebfe60c4295a79762d4e19e63f2c21d2 \ No newline at end of file
diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0meta.7z b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0meta.7z
new file mode 100644
index 000000000..c3cf7f7fa
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z
new file mode 100644
index 000000000..de70ee790
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z.sha1
new file mode 100644
index 000000000..c290ccf6c
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z.sha1
@@ -0,0 +1 @@
+0e995c11dc35bd2b4ac04d408eb7091f8322ea49 \ No newline at end of file
diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0meta.7z b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0meta.7z
new file mode 100644
index 000000000..8b389f955
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/Updates.xml b/tests/auto/tools/repotest/repository_componentAndUnite/Updates.xml
new file mode 100644
index 000000000..802f0a53e
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_componentAndUnite/Updates.xml
@@ -0,0 +1,30 @@
+<Updates>
+ <ApplicationName>{AnyApplication}</ApplicationName>
+ <ApplicationVersion>1.0.0</ApplicationVersion>
+ <Checksum>false</Checksum>
+ <PackageUpdate>
+ <Name>A</Name>
+ <DisplayName>A</DisplayName>
+ <Description>Example component A</Description>
+ <Version>2.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <Script>script2.0.0.qs</Script>
+ <UpdateFile OS="Any" CompressedSize="240" UncompressedSize="74"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>11f74e8fbc7d6c155dd6503c460c2c1955340cc1</SHA1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>C</Name>
+ <DisplayName>C</DisplayName>
+ <Description>Example component C</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2015-01-01</ReleaseDate>
+ <Default>true</Default>
+ <UpdateFile OS="Any" CompressedSize="239" UncompressedSize="89"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>4558f31428ef88eb23521b4f119465967945e2f7</SHA1>
+ </PackageUpdate>
+ <SHA1>d674e6574895c02d3a02fb97a46b159d35f17c68</SHA1>
+ <MetadataName>2020-11-10-0816_meta.7z</MetadataName>
+</Updates>
diff --git a/tests/auto/tools/repotest/repository_unite/2020-11-10-0931_meta.7z b/tests/auto/tools/repotest/repository_unite/2020-11-10-0931_meta.7z
new file mode 100644
index 000000000..4008dc656
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_unite/2020-11-10-0931_meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z b/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z
new file mode 100644
index 000000000..ef8741d32
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z.sha1
new file mode 100644
index 000000000..d5e23fd53
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z.sha1
@@ -0,0 +1 @@
+c7cca768ebfe60c4295a79762d4e19e63f2c21d2 \ No newline at end of file
diff --git a/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z b/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z
new file mode 100644
index 000000000..de70ee790
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z.sha1
new file mode 100644
index 000000000..c290ccf6c
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z.sha1
@@ -0,0 +1 @@
+0e995c11dc35bd2b4ac04d408eb7091f8322ea49 \ No newline at end of file
diff --git a/tests/auto/tools/repotest/repository_unite/Updates.xml b/tests/auto/tools/repotest/repository_unite/Updates.xml
new file mode 100644
index 000000000..0b0a8987b
--- /dev/null
+++ b/tests/auto/tools/repotest/repository_unite/Updates.xml
@@ -0,0 +1,28 @@
+<Updates>
+ <ApplicationName>{AnyApplication}</ApplicationName>
+ <ApplicationVersion>1.0.0</ApplicationVersion>
+ <Checksum>false</Checksum>
+ <PackageUpdate>
+ <Name>A</Name>
+ <DisplayName>A</DisplayName>
+ <Description>Example component A</Description>
+ <Version>2.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <Script>script2.0.0.qs</Script>
+ <UpdateFile CompressedSize="240" UncompressedSize="74" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>C</Name>
+ <DisplayName>C</DisplayName>
+ <Description>Example component C</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2015-01-01</ReleaseDate>
+ <Default>true</Default>
+ <UpdateFile CompressedSize="239" UncompressedSize="89" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ </PackageUpdate>
+ <SHA1>3b46ef65a751d9498205412fc22de43ce29e5d8a</SHA1>
+ <MetadataName>2020-11-10-0931_meta.7z</MetadataName>
+</Updates>
diff --git a/tests/auto/tools/repotest/repotest.pro b/tests/auto/tools/repotest/repotest.pro
new file mode 100644
index 000000000..c0ff8caa6
--- /dev/null
+++ b/tests/auto/tools/repotest/repotest.pro
@@ -0,0 +1,6 @@
+include(../../qttest.pri)
+
+QT -= gui
+
+SOURCES += tst_repotest.cpp
+
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0meta.7z
new file mode 100644
index 000000000..af0863696
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0meta.7z
new file mode 100644
index 000000000..e5be1148e
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/Updates.xml b/tests/auto/tools/repotest/test_package_versions/repository_1/Updates.xml
new file mode 100644
index 000000000..edb6515bd
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/Updates.xml
@@ -0,0 +1,28 @@
+<Updates>
+ <ApplicationName>{AnyApplication}</ApplicationName>
+ <ApplicationVersion>1.0.0</ApplicationVersion>
+ <Checksum>true</Checksum>
+ <PackageUpdate>
+ <Name>A</Name>
+ <DisplayName>A</DisplayName>
+ <Description>Test component A</Description>
+ <Version>2.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <Script>script2.0.0.qs</Script>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>da6dae55a8cc3fb9f012e33fa7b9c187a823aa9a</SHA1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>B</Name>
+ <DisplayName>B</DisplayName>
+ <Description>Test component B</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>d88b373458b4bbec38132692061bf1e7aa68e7f7</SHA1>
+ </PackageUpdate>
+</Updates>
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0meta.7z
new file mode 100644
index 000000000..c4da482bf
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0meta.7z
new file mode 100644
index 000000000..e5be1148e
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/Updates.xml b/tests/auto/tools/repotest/test_package_versions/repository_2/Updates.xml
new file mode 100644
index 000000000..ac12fba4b
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/Updates.xml
@@ -0,0 +1,28 @@
+<Updates>
+ <ApplicationName>{AnyApplication}</ApplicationName>
+ <ApplicationVersion>1.0.0</ApplicationVersion>
+ <Checksum>true</Checksum>
+ <PackageUpdate>
+ <Name>A</Name>
+ <DisplayName>A</DisplayName>
+ <Description>Example component A</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <Script>script1.0.0.qs</Script>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>da6dae55a8cc3fb9f012e33fa7b9c187a823aa9a</SHA1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>B</Name>
+ <DisplayName>B</DisplayName>
+ <Description>Example component B</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>d88b373458b4bbec38132692061bf1e7aa68e7f7</SHA1>
+ </PackageUpdate>
+</Updates>
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0meta.7z
new file mode 100644
index 000000000..3706e8dd8
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0meta.7z
new file mode 100644
index 000000000..e5be1148e
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/Updates.xml b/tests/auto/tools/repotest/test_package_versions/repository_3/Updates.xml
new file mode 100644
index 000000000..40d86538c
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/Updates.xml
@@ -0,0 +1,28 @@
+<Updates>
+ <ApplicationName>{AnyApplication}</ApplicationName>
+ <ApplicationVersion>1.0.0</ApplicationVersion>
+ <Checksum>true</Checksum>
+ <PackageUpdate>
+ <Name>A</Name>
+ <DisplayName>A</DisplayName>
+ <Description>Example component A</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <Script>script1.0.0.qs</Script>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>da6dae55a8cc3fb9f012e33fa7b9c187a823aa9a</SHA1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>B</Name>
+ <DisplayName>B</DisplayName>
+ <Description>Example component B</Description>
+ <Version>3.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>d88b373458b4bbec38132692061bf1e7aa68e7f7</SHA1>
+ </PackageUpdate>
+</Updates>
diff --git a/tests/auto/tools/repotest/tst_repotest.cpp b/tests/auto/tools/repotest/tst_repotest.cpp
new file mode 100644
index 000000000..f1c0ae9dd
--- /dev/null
+++ b/tests/auto/tools/repotest/tst_repotest.cpp
@@ -0,0 +1,582 @@
+/**************************************************************************
+**
+** Copyright (C) 2022 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 "../../installer/shared/verifyinstaller.h"
+
+#include <repositorygen.h>
+#include <repositorygen.cpp>
+#include <init.h>
+#include <archivefactory.h>
+
+#ifdef IFW_LIB7Z
+#include <lib7z_facade.h>
+#endif
+
+#include <QFile>
+#include <QTest>
+#include <QRegularExpression>
+
+class tst_repotest : public QObject
+{
+ Q_OBJECT
+private:
+ void generateRepo(bool createSplitMetadata, bool createUnifiedMetadata, bool updateNewComponents,
+ QStringList packagesUpdatedWithSha = QStringList())
+ {
+ QStringList filteredPackages;
+
+ m_packages = QInstallerTools::collectPackages(m_repoInfo,
+ &filteredPackages, QInstallerTools::Exclude, updateNewComponents, packagesUpdatedWithSha);
+
+ if (updateNewComponents) { //Verify that component B exists as that is not updated
+ if (createSplitMetadata) {
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/B", QStringList() << "1.0.0content.7z"
+ << "1.0.0content.7z.sha1" << "1.0.0meta.7z");
+ } else {
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/B", QStringList() << "1.0.0content.7z"
+ << "1.0.0content.7z.sha1");
+ }
+ }
+ QTemporaryDir tmp;
+ tmp.setAutoRemove(false);
+ const QString tmpMetaDir = tmp.path();
+ QInstallerTools::createRepository(m_repoInfo, &m_packages, tmpMetaDir, createSplitMetadata,
+ createUnifiedMetadata, QLatin1String("7z"));
+ QInstaller::removeDirectory(tmpMetaDir, true);
+ }
+
+ void clearData()
+ {
+ m_repoInfo.packages.clear();
+ m_repoInfo.repositoryPackages.clear();
+ m_packages.clear();
+ }
+
+ void initRepoUpdate()
+ {
+ clearData();
+ m_repoInfo.packages << "packages_update";
+ }
+
+ void initRepoUpdateFromRepositories(const QStringList &repositories)
+ {
+ clearData();
+ m_repoInfo.repositoryPackages << repositories;
+ }
+
+ void verifyUniteMetadata(const QString &scriptVersion)
+ {
+ QString fileContent = VerifyInstaller::fileContent(m_repoInfo.repositoryDir + QDir::separator()
+ + "Updates.xml");
+ QRegularExpression re("<MetadataName>(.*)<.MetadataName>");
+ QStringList matches = re.match(fileContent).capturedTexts();
+ QString existingUniteMeta7z = QInstallerTools::existingUniteMeta7z(m_repoInfo.repositoryDir);
+ QCOMPARE(2, matches.count());
+ QCOMPARE(existingUniteMeta7z, matches.at(1));
+ QScopedPointer<AbstractArchive> file(ArchiveFactory::instance()
+ .create(m_repoInfo.repositoryDir + QDir::separator() + matches.at(1)));
+ QVERIFY(file->open(QIODevice::ReadOnly));
+
+ //We have script<version>.qs for package A in the unite metadata
+ QVector<ArchiveEntry>::const_iterator fileIt;
+ const QVector<ArchiveEntry> files = file->list();
+ for (fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
+ if (fileIt->isDirectory)
+ continue;
+ QString fileName = "A/script%1.qs";
+ QCOMPARE(qPrintable(fileName.arg(scriptVersion)), fileIt->path);
+ }
+
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir, QStringList() << "Updates.xml"
+ << matches.at(1));
+ VerifyInstaller::verifyFileContent(m_repoInfo.repositoryDir + QDir::separator() + "Updates.xml",
+ "SHA1");
+ VerifyInstaller::verifyFileContent(m_repoInfo.repositoryDir + QDir::separator() + "Updates.xml",
+ "MetadataName");
+ }
+
+ void verifyComponentRepository(const QString &componentAVersion, const QString &componentBVersion, bool hasComponentMeta)
+ {
+ const QString content = "%1content.7z";
+ const QString contentSha1 = "%1content.7z.sha1";
+ const QString meta = "%1meta.7z";
+ QStringList componentA;
+ QStringList componentB;
+ componentA << qPrintable(content.arg(componentAVersion)) << qPrintable(contentSha1.arg(componentAVersion));
+ componentB << qPrintable(content.arg(componentBVersion)) << qPrintable(contentSha1.arg(componentBVersion));
+ if (hasComponentMeta) {
+ componentA << qPrintable(meta.arg(componentAVersion));
+ componentB << qPrintable(meta.arg(componentBVersion));
+ }
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/A", componentA);
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/B", componentB);
+ }
+
+ void verifyComponentMetaUpdatesXml()
+ {
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir, QStringList() << "Updates.xml");
+ VerifyInstaller::verifyFileHasNoContent(m_repoInfo.repositoryDir + QDir::separator() + "Updates.xml",
+ "MetadataName");
+ }
+
+ void ignoreMessagesForComponentHash(const QStringList &components)
+ {
+ QString packageDir = m_repoInfo.packages.first();
+ foreach (const QString component, components) {
+ QString message = "Copying component data for \"%1\"";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(component)));
+ QTest::ignoreMessage(QtDebugMsg, QRegularExpression("Compressing files found in data directory: *"));
+ QTest::ignoreMessage(QtDebugMsg, QRegularExpression("Hash is stored in *"));
+ QTest::ignoreMessage(QtDebugMsg, QRegularExpression("Creating hash of archive *"));
+ QTest::ignoreMessage(QtDebugMsg, QRegularExpression("Generated sha1 hash: *"));
+ }
+ }
+
+ void ignoreMessagesForCopyRepository(const QString &component, const QString &version, const QString &repository)
+ {
+ QStringList contentFiles;
+ contentFiles << "content.7z" << "content.7z.sha1";
+ QString message = "Copying component data for \"%1\"";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(component)));
+ foreach (const QString &fileName, contentFiles) {
+ message = "Copying file from \"%5/%1/%2%4\" to \"%3/%1/%2%4\"";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(component).arg(version)
+ .arg(m_repoInfo.repositoryDir).arg(fileName).arg(repository)));
+ }
+ }
+
+ void ignoreMessageForCollectingRepository(const QStringList &repositories)
+ {
+ const QString message = "Process repository \"%2\"";
+ QTest::ignoreMessage(QtDebugMsg, "Collecting information about available repository packages...");
+ for (auto &repo : repositories)
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(repo)));
+ QTest::ignoreMessage(QtDebugMsg, "Collecting information about available packages...");
+ QTest::ignoreMessage(QtDebugMsg, "No available packages found at the specified location.");
+ }
+
+ void ignoreMessagesForCopyMetadata(const QString &component, bool hasMeta, bool update)
+ {
+ QString message = "Copy meta data for package \"%2\" using \"%1/%2/meta/package.xml\"";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.packages.first(), component)));
+ QTest::ignoreMessage(QtDebugMsg, QRegularExpression("calculate size of directory *"));
+ if (hasMeta) {
+ if (update)
+ message = "Copying associated \"script\" file \"%1/%2/meta/script2.0.0.qs\"";
+ else
+ message = "Copying associated \"script\" file \"%1/%2/meta/script1.0.0.qs\"";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.packages.first(), component)));
+ QTest::ignoreMessage(QtDebugMsg, "done.");
+ }
+ }
+
+ void ignoreMessagesForComponentSha(const QStringList &components, bool clearOldChecksum)
+ {
+ foreach (const QString component, components) {
+ const QString message = "Searching sha1sum node for \"%1\"";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(component)));
+ if (clearOldChecksum)
+ QTest::ignoreMessage(QtDebugMsg, QRegularExpression("- clearing the old sha1sum *"));
+ QTest::ignoreMessage(QtDebugMsg, QRegularExpression("- writing the sha1sum *"));
+ }
+ }
+
+ void ignoreMessagesForUniteMeta(bool update)
+ {
+ QTest::ignoreMessage(QtDebugMsg, "Writing sha1sum node.");
+ if (update)
+ QTest::ignoreMessage(QtDebugMsg, QRegularExpression("- clearing the old sha1sum *"));
+ QTest::ignoreMessage(QtDebugMsg, QRegularExpression("- writing the sha1sum"));
+ QTest::ignoreMessage(QtDebugMsg, QRegularExpression("Updating the metadata node with name *"));
+ }
+
+ void ignoreMessageForCollectingPackages(const QString &versionA = QString(),
+ const QString &versionB = QString(), const QString &versionC = QString())
+ {
+ QTest::ignoreMessage(QtDebugMsg, "Collecting information about available repository packages...");
+ QTest::ignoreMessage(QtDebugMsg, "Collecting information about available packages...");
+ if (!versionA.isEmpty()) {
+ QTest::ignoreMessage(QtDebugMsg, "Found subdirectory \"A\"");
+ const QString message = "- it provides the package \"A\" - \"%1\"";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(versionA)));
+ }
+ if (!versionB.isEmpty()) {
+ QTest::ignoreMessage(QtDebugMsg, "Found subdirectory \"B\"");
+ const QString message = "- it provides the package \"B\" - \"%1\"";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(versionB)));
+ }
+ if (!versionC.isEmpty()) {
+ QTest::ignoreMessage(QtDebugMsg, "Found subdirectory \"C\"");
+ const QString message = "- it provides the package \"C\" - \"%1\"";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(versionC)));
+ }
+ }
+
+ void ignoreMessageForCollectingPackagesFromRepository(const QString &versionA, const QString &versionB)
+ {
+ QString message = "- it provides the package \"B\" - \"%1\"";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(versionB)));
+ message = "- it provides the package \"A\" - \"%1\"";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(versionA)));
+ QTest::ignoreMessage(QtDebugMsg, "Collecting information about available packages...");
+ QTest::ignoreMessage(QtDebugMsg, "No available packages found at the specified location.");
+ }
+
+ void ignoreMessagesForUpdateComponents()
+ {
+ ignoreMessageForCollectingPackages("2.0.0", "1.0.0");
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ ignoreMessagesForComponentHash(QStringList() << "A" << "B");
+ ignoreMessagesForCopyMetadata("A", true, true);
+ ignoreMessagesForCopyMetadata("B", false, true);
+ }
+
+ void ignoreMessageForUpdateComponent()
+ {
+ QString message = "Update component \"A\" in \"%1\" .";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.repositoryDir)));
+ message = "Update component \"C\" in \"%1\" .";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.repositoryDir)));
+ }
+
+ void verifyComponentShaUpdate(int shaUpdateComponents)
+ {
+ QString updatesXmlFile(m_repoInfo.repositoryDir + QDir::separator() + "Updates.xml");
+ QFile file(updatesXmlFile);
+ QDomDocument dom;
+
+ QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY(dom.setContent(&file));
+ file.close();
+ QCOMPARE(dom.elementsByTagName("ContentSha1").count(), shaUpdateComponents);
+ }
+
+private slots:
+ void init()
+ {
+ ignoreMessageForCollectingPackages("1.0.0", "1.0.0");
+
+ m_repoInfo.repositoryDir = QInstallerTools::makePathAbsolute(QInstaller::generateTemporaryFileName());
+ m_tempDirDeleter.add(m_repoInfo.repositoryDir);
+
+ m_repoInfo.packages << "packages";
+
+ ignoreMessagesForComponentHash(QStringList() << "A" << "B");
+ ignoreMessagesForCopyMetadata("A", true, false); //Only A has metadata
+ ignoreMessagesForCopyMetadata("B", false, false);
+ }
+
+ void initTestCase()
+ {
+#ifdef IFW_LIB7Z
+ Lib7z::initSevenZ();
+#endif
+ }
+
+ void testWithComponentMeta()
+ {
+ ignoreMessagesForComponentSha(QStringList () << "A" << "B", false);
+ generateRepo(true, false, false);
+
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+ verifyComponentMetaUpdatesXml();
+ }
+
+ void testWithComponentAndUniteMeta()
+ {
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ ignoreMessagesForUniteMeta(false);
+ generateRepo(true, true, false);
+
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+ verifyUniteMetadata("1.0.0");
+ }
+
+ void testWithUniteMeta()
+ {
+ ignoreMessagesForUniteMeta(false);
+ generateRepo(false, true, false);
+
+ verifyComponentRepository("1.0.0", "1.0.0", false);
+ verifyUniteMetadata("1.0.0");
+ }
+
+ void testWithComponentShaUpdate()
+ {
+ ignoreMessagesForComponentSha(QStringList () << "A" << "B", false);
+ generateRepo(true, false, false, QStringList () << "A");
+
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+ verifyComponentMetaUpdatesXml();
+ verifyComponentShaUpdate(1);
+ }
+
+ void testWithTwoComponentsShaUpdate()
+ {
+ ignoreMessagesForComponentSha(QStringList () << "A" << "B", false);
+ generateRepo(true, false, false, QStringList () << "A" << "B");
+
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+ verifyComponentMetaUpdatesXml();
+ verifyComponentShaUpdate(2);
+ }
+
+ void testUpdateNewComponents()
+ {
+ // Create 'base' repository which will be updated
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ generateRepo(true, false, false);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+
+ // Update the 'base' repository
+ initRepoUpdate();
+ ignoreMessageForCollectingPackages("2.0.0", "1.0.0");
+ ignoreMessagesForComponentSha(QStringList() << "A", false); //Only A has update
+ ignoreMessagesForComponentHash(QStringList() << "A");
+ ignoreMessagesForCopyMetadata("A", true, true);
+ const QString &message = "Update component \"A\" in \"%1\" .";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.repositoryDir)));
+ generateRepo(true, false, true);
+ verifyComponentRepository("2.0.0", "1.0.0", true);
+ verifyComponentMetaUpdatesXml();
+ }
+
+ void testUpdateNewComponentsWithUniteMetadata()
+ {
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ ignoreMessagesForUniteMeta(false);
+ generateRepo(true, true, false);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+
+ initRepoUpdate();
+ ignoreMessageForCollectingPackages("2.0.0", "1.0.0");
+ ignoreMessagesForComponentSha(QStringList() << "A", false); //Only A has update
+ ignoreMessagesForComponentHash(QStringList() << "A");
+ ignoreMessagesForCopyMetadata("A", true, true);
+ ignoreMessagesForUniteMeta(true);
+ const QString &message = "Update component \"A\" in \"%1\" .";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.repositoryDir)));
+ generateRepo(true, true, true);
+ verifyComponentRepository("2.0.0", "1.0.0", true);
+ verifyUniteMetadata("2.0.0");
+ }
+
+ void testUpdateNewComponentsWithOnlyUniteMetadata()
+ {
+ ignoreMessagesForUniteMeta(false);
+ generateRepo(false, true, false);
+ verifyComponentRepository("1.0.0", "1.0.0", false);
+
+ initRepoUpdate();
+ ignoreMessageForCollectingPackages("2.0.0", "1.0.0");
+ ignoreMessagesForComponentHash(QStringList() << "A");
+ ignoreMessagesForCopyMetadata("A", true, true);
+ ignoreMessagesForUniteMeta(true);
+ const QString &message = "Update component \"A\" in \"%1\" .";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.repositoryDir)));
+ generateRepo(false, true, true);
+ verifyComponentRepository("2.0.0", "1.0.0", false);
+ verifyUniteMetadata("2.0.0");
+ }
+
+ void testUpdateComponents()
+ {
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ generateRepo(true, false, false);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+
+ initRepoUpdate();
+ ignoreMessagesForUpdateComponents();
+ generateRepo(true, false, false);
+ verifyComponentRepository("2.0.0", "1.0.0", true);
+ verifyComponentMetaUpdatesXml();
+ }
+
+ void testUpdateComponentsFromPartialPackageDir()
+ {
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ ignoreMessagesForUniteMeta(false);
+ generateRepo(true, true, false);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+
+ clearData();
+ m_repoInfo.packages << "packages_new";
+ { // ignore messages
+ ignoreMessagesForUniteMeta(false);
+ ignoreMessageForCollectingPackages(QString(), QString(), "1.0.0");
+ ignoreMessagesForComponentSha(QStringList() << "C", true);
+ ignoreMessagesForCopyMetadata("C", false, false);
+ ignoreMessagesForComponentHash(QStringList() << "C");
+ }
+ generateRepo(true, true, false);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/C",
+ QStringList() << "1.0.0content.7z" << "1.0.0content.7z.sha1" << "1.0.0meta.7z");
+ verifyUniteMetadata("1.0.0");
+ }
+
+ void testUpdateComponentsWithUniteMetadata()
+ {
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ ignoreMessagesForUniteMeta(false);
+ generateRepo(true, true, false);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+
+ initRepoUpdate();
+ ignoreMessagesForUpdateComponents();
+ ignoreMessagesForUniteMeta(true);
+ generateRepo(true, true, false);
+ verifyComponentRepository("2.0.0", "1.0.0", true);
+ verifyUniteMetadata("2.0.0");
+ }
+
+ void testUpdateComponentsWithOnlyUniteMetadata()
+ {
+ ignoreMessagesForUniteMeta(false);
+ generateRepo(false, true, false);
+ verifyComponentRepository("1.0.0", "1.0.0", false);
+
+ initRepoUpdate();
+ ignoreMessageForCollectingPackages("2.0.0", "1.0.0");
+ ignoreMessagesForComponentHash(QStringList() << "A" << "B");
+ ignoreMessagesForCopyMetadata("A", true, true);
+ ignoreMessagesForCopyMetadata("B", false, true);
+ ignoreMessagesForUniteMeta(true);
+ generateRepo(false, true, false);
+ verifyComponentRepository("2.0.0", "1.0.0", false);
+ verifyUniteMetadata("2.0.0");
+ }
+
+ void testUpdateComponentsFromRepository()
+ {
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ generateRepo(true, false, false);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+
+ initRepoUpdateFromRepositories(QStringList() << "repository_component");
+ ignoreMessageForCollectingRepository(QStringList() << "repository_component");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"A\" - \"2.0.0\"");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"B\" - \"1.0.0\"");
+
+ ignoreMessagesForCopyRepository("B", "1.0.0", "repository_component");
+ ignoreMessagesForCopyRepository("A", "2.0.0", "repository_component");
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", true);
+ generateRepo(true, false, false);
+ verifyComponentRepository("2.0.0", "1.0.0", true);
+ verifyComponentMetaUpdatesXml();
+ }
+
+ void testUpdateComponentsFromMultipleRepositories()
+ {
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ generateRepo(true, false, false);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+
+ initRepoUpdateFromRepositories(QStringList() << "test_package_versions/repository_1"
+ << "test_package_versions/repository_2" << "test_package_versions/repository_3");
+
+ ignoreMessageForCollectingRepository(QStringList()
+ << "repository_1" << "repository_2" << "repository_3");
+
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"A\" - \"2.0.0\"");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"B\" - \"1.0.0\"");
+
+ QTest::ignoreMessage(QtDebugMsg, "- it provides an old version of the package \"A\" - \"1.0.0\" - ignored");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides an old version of the package \"B\" - \"1.0.0\" - ignored");
+
+ QTest::ignoreMessage(QtDebugMsg, "- it provides an old version of the package \"A\" - \"1.0.0\" - ignored");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides a new version of the package \"B\" - \"3.0.0\" - replaced");
+
+ ignoreMessagesForCopyRepository("B", "3.0.0", "test_package_versions/repository_3");
+ ignoreMessagesForCopyRepository("A", "2.0.0", "test_package_versions/repository_1");
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", true);
+ generateRepo(true, false, false);
+ verifyComponentRepository("2.0.0", "3.0.0", true);
+ verifyComponentMetaUpdatesXml();
+ }
+
+ void testUpdateComponentsFromRepositoryWithUniteMetadata()
+ {
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ ignoreMessagesForUniteMeta(false);
+ generateRepo(true, true, false);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+
+ initRepoUpdateFromRepositories(QStringList() << "repository_componentAndUnite");
+ ignoreMessageForCollectingRepository(QStringList() << "repository_componentAndUnite");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"A\" - \"2.0.0\"");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"C\" - \"1.0.0\"");
+ ignoreMessageForUpdateComponent();
+ ignoreMessagesForCopyRepository("A", "2.0.0", "repository_componentAndUnite");
+ ignoreMessagesForCopyRepository("C", "1.0.0", "repository_componentAndUnite");
+ ignoreMessagesForUniteMeta(true);
+ ignoreMessagesForComponentSha(QStringList() << "A" << "C", true);
+
+ generateRepo(true, true, true);
+ verifyComponentRepository("2.0.0", "1.0.0", true);
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/C", QStringList() << "1.0.0content.7z" << "1.0.0content.7z.sha1" << "1.0.0meta.7z");
+ verifyUniteMetadata("2.0.0");
+ }
+
+ void testUpdateComponentsFromRepositoryWithOnlyUniteMetadata()
+ {
+ ignoreMessagesForUniteMeta(false);
+ generateRepo(false, true, false);
+ verifyComponentRepository("1.0.0", "1.0.0", false);
+
+ initRepoUpdateFromRepositories(QStringList() << "repository_unite");
+ ignoreMessageForCollectingRepository(QStringList() << "repository_unite");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"A\" - \"2.0.0\"");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"C\" - \"1.0.0\"");
+ ignoreMessageForUpdateComponent();
+ ignoreMessagesForCopyRepository("A", "2.0.0", "repository_unite");
+ ignoreMessagesForCopyRepository("C", "1.0.0", "repository_unite");
+ ignoreMessagesForUniteMeta(true);
+
+ generateRepo(false, true, true);
+ verifyComponentRepository("2.0.0", "1.0.0", false);
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/C", QStringList() << "1.0.0content.7z" << "1.0.0content.7z.sha1");
+ verifyUniteMetadata("2.0.0");
+ }
+
+ void cleanup()
+ {
+ m_tempDirDeleter.releaseAndDeleteAll();
+ m_repoInfo.packages.clear();
+ m_packages.clear();
+ m_repoInfo.repositoryPackages.clear();
+ }
+
+private:
+ QInstallerTools::RepositoryInfo m_repoInfo;
+ QInstallerTools::PackageInfoVector m_packages;
+ TempPathDeleter m_tempDirDeleter;
+};
+
+QTEST_MAIN(tst_repotest)
+
+#include "tst_repotest.moc"
diff --git a/tests/auto/tools/tools.pro b/tests/auto/tools/tools.pro
new file mode 100644
index 000000000..7e881ecee
--- /dev/null
+++ b/tests/auto/tools/tools.pro
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ repotest