]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Add testcases for the alternative introspection
authorMichael Schroeder <mls@suse.de>
Wed, 14 Dec 2022 16:02:02 +0000 (17:02 +0100)
committerMichael Schroeder <mls@suse.de>
Wed, 14 Dec 2022 16:02:02 +0000 (17:02 +0100)
test/testcases/alternative/job.t [new file with mode: 0644]
test/testcases/alternative/learnt.t [new file with mode: 0644]
test/testcases/alternative/recommends.t [new file with mode: 0644]
test/testcases/alternative/requires.t [new file with mode: 0644]
test/testcases/alternative/strongrecommends.t [new file with mode: 0644]
test/testcases/alternative/update.t [new file with mode: 0644]

diff --git a/test/testcases/alternative/job.t b/test/testcases/alternative/job.t
new file mode 100644 (file)
index 0000000..18e3b78
--- /dev/null
@@ -0,0 +1,22 @@
+repo system 0 empty
+repo test 0 testtags <inline>
+#>=Pkg: A 1 1 noarch
+#>=Prv: X
+#>=Pkg: B 1 1 noarch
+#>=Prv: X
+system unset * system
+job install provides X
+result transaction,problems,alternatives <inline>
+#>alternative 63535fbb  0 X
+#>alternative 63535fbb  1 + A-1-1.noarch@test
+#>alternative 63535fbb  2   B-1-1.noarch@test
+#>install A-1-1.noarch@test
+
+nextjob
+job install oneof A-1-1.noarch@test B-1-1.noarch@test
+result transaction,problems,alternatives <inline>
+#>alternative 63535fbb  0 A-1-1.noarch, B-1-1.noarch
+#>alternative 63535fbb  1 + A-1-1.noarch@test
+#>alternative 63535fbb  2   B-1-1.noarch@test
+#>install A-1-1.noarch@test
+
diff --git a/test/testcases/alternative/learnt.t b/test/testcases/alternative/learnt.t
new file mode 100644 (file)
index 0000000..2aade85
--- /dev/null
@@ -0,0 +1,43 @@
+### or in CC1
+####>=Con: CC2 <UNLESS> (A1 | A2 | A3)
+
+repo system 0 empty
+repo test 0 testtags <inline>
+#>=Pkg: Q 1 1 noarch
+#>=Req: A
+#>=Pkg: A1 1 1 noarch
+#>=Pkg: A2 1 2 noarch
+#>=Pkg: A3 1 3 noarch
+#>=Req: C = 2-1
+#>=Pkg: A 2 1 noarch
+#>=Con: A1
+#>=Con: A2
+#>=Con: A3
+#>=Req: B
+#>=Pkg: B 1 1 noarch
+#>=Req: X
+#>=Pkg: C 2 1 noarch
+#>=Prv: X
+#>=Req: CC1
+#>=Req: CC2
+#>=Pkg: CC1 1 1 noarch
+#>=Pkg: CC2 1 1 noarch
+#>=Req: (A1 | A2 | A3) <IF> CC1
+#>=Pkg: C 2 2 noarch
+#>=Prv: X
+#>=Req: CC1
+#>=Req: CC2
+#>=Pkg: A 1 1 noarch
+#>=Req: C = 2-2
+system unset * system
+job install name Q
+result transaction,problems,alternatives <inline>
+#>alternative d80be72d  0 ((A1 or A2 or A3) if CC1), required by CC2-1-1.noarch
+#>alternative d80be72d  1 + A1-1-1.noarch@test
+#>alternative d80be72d  2   A2-1-2.noarch@test
+#>install A-1-1.noarch@test
+#>install A1-1-1.noarch@test
+#>install C-2-2.noarch@test
+#>install CC1-1-1.noarch@test
+#>install CC2-1-1.noarch@test
+#>install Q-1-1.noarch@test
diff --git a/test/testcases/alternative/recommends.t b/test/testcases/alternative/recommends.t
new file mode 100644 (file)
index 0000000..923e6c6
--- /dev/null
@@ -0,0 +1,16 @@
+repo system 0 empty
+repo test 0 testtags <inline>
+#>=Pkg: A 1 1 noarch
+#>=Rec: X
+#>=Pkg: B 1 1 noarch
+#>=Prv: X
+#>=Pkg: C 1 1 noarch
+#>=Prv: X
+system unset * system
+job install name A
+result transaction,problems,alternatives <inline>
+#>alternative f1989d4c  0 X, recommended by A-1-1.noarch
+#>alternative f1989d4c  1 + B-1-1.noarch@test
+#>alternative f1989d4c  2   C-1-1.noarch@test
+#>install A-1-1.noarch@test
+#>install B-1-1.noarch@test
diff --git a/test/testcases/alternative/requires.t b/test/testcases/alternative/requires.t
new file mode 100644 (file)
index 0000000..953708b
--- /dev/null
@@ -0,0 +1,16 @@
+repo system 0 empty
+repo test 0 testtags <inline>
+#>=Pkg: A 1 1 noarch
+#>=Req: X
+#>=Pkg: B 1 1 noarch
+#>=Prv: X
+#>=Pkg: C 1 1 noarch
+#>=Prv: X
+system unset * system
+job install name A
+result transaction,problems,alternatives <inline>
+#>alternative 8f2fa5fa  0 X, required by A-1-1.noarch
+#>alternative 8f2fa5fa  1 + B-1-1.noarch@test
+#>alternative 8f2fa5fa  2   C-1-1.noarch@test
+#>install A-1-1.noarch@test
+#>install B-1-1.noarch@test
diff --git a/test/testcases/alternative/strongrecommends.t b/test/testcases/alternative/strongrecommends.t
new file mode 100644 (file)
index 0000000..db7c51d
--- /dev/null
@@ -0,0 +1,31 @@
+repo system 0 empty
+repo test 0 testtags <inline>
+#>=Pkg: A 1 1 noarch
+#>=Rec: X
+#>=Pkg: B 1 1 noarch
+#>=Prv: X
+#>=Pkg: C 1 1 noarch
+#>=Prv: X
+#>=Pkg: D 1 1 noarch
+#>=Prv: X
+system unset * system
+solverflags strongrecommends
+job install name A
+result transaction,problems,alternatives <inline>
+#>alternative 432b0214  0 X, recommended by A-1-1.noarch
+#>alternative 432b0214  1 + B-1-1.noarch@test
+#>alternative 432b0214  2   C-1-1.noarch@test
+#>alternative 432b0214  3   D-1-1.noarch@test
+#>install A-1-1.noarch@test
+#>install B-1-1.noarch@test
+
+nextjob
+solverflags strongrecommends
+job install name A
+job disfavor name B
+result transaction,problems,alternatives <inline>
+#>alternative eb7c0cd8  0 X, recommended by A-1-1.noarch
+#>alternative eb7c0cd8  1 + C-1-1.noarch@test
+#>alternative eb7c0cd8  2   D-1-1.noarch@test
+#>install A-1-1.noarch@test
+#>install C-1-1.noarch@test
diff --git a/test/testcases/alternative/update.t b/test/testcases/alternative/update.t
new file mode 100644 (file)
index 0000000..a5ee654
--- /dev/null
@@ -0,0 +1,21 @@
+repo system 0 testtags <inline>
+#>=Pkg: X 1 1 noarch
+repo test 0 testtags <inline>
+#>=Pkg: X 2 1 noarch
+#>=Pkg: B 1 1 noarch
+#>=Obs: X = 1
+system unset * system
+job update all packages
+result transaction,problems,alternatives <inline>
+#>alternative 6014509b  0 X-1-1.noarch
+#>alternative 6014509b  1 + X-2-1.noarch@test
+#>alternative 6014509b  2   B-1-1.noarch@test
+#>upgrade X-1-1.noarch@system X-2-1.noarch@test
+
+nextjob
+job distupgrade all packages [forcebest]
+result transaction,problems,alternatives <inline>
+#>alternative 6014509b  0 X-1-1.noarch
+#>alternative 6014509b  1 + X-2-1.noarch@test
+#>alternative 6014509b  2   B-1-1.noarch@test
+#>upgrade X-1-1.noarch@system X-2-1.noarch@test