--- /dev/null
+# test that locked packages trump best rules
+
+repo system 0 testtags <inline>
+#>=Pkg: b 1 1 i686
+repo available 0 testtags <inline>
+#>=Pkg: a 2 1 i686
+#>=Pkg: a 3 1 i686
+#>=Pkg: b 2 1 i686
+#>=Pkg: b 3 1 i686
+
+system i686 * system
+
+job install name a [forcebest]
+job lock name a = 3
+result transaction,problems <inline>
+#>install a-2-1.i686@available
+
+nextjob
+job update name b [forcebest]
+job lock name b = 3
+result transaction,problems <inline>
+#>upgrade b-1-1.i686@system b-2-1.i686@available
+
+nextjob
+job update name b [forcebest]
+job lock name b = 1
+result transaction,problems <inline>
--- /dev/null
+# test that locked packages trump dup rules
+
+repo system 0 testtags <inline>
+#>=Pkg: a 1 1 i686
+repo available 0 testtags <inline>
+#>=Pkg: a 2 1 i686
+
+system i686 * system
+
+job distupgrade all packages
+job lock name a
+result transaction,problems <inline>
+
+# but we still get a problem if only the available packages
+# are locked
+#
+nextjob
+job distupgrade all packages
+job lock name a = 2
+result transaction,problems <inline>
+#>problem 1889163e info problem with installed package a-1-1.i686
+#>problem 1889163e solution 25ae2253 allow a-1-1.i686@system
+#>problem 1889163e solution d4b95104 deljob lock name a = 2
+#>problem 1889163e solution e5fc66c9 erase a-1-1.i686@system
+#>upgrade a-1-1.i686@system a-2-1.i686@available