Add further multilib resolution test-cases
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 29 Aug 2012 11:25:00 +0000 (14:25 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 29 Aug 2012 11:27:39 +0000 (14:27 +0300)
- Also test for the cases where packages are installed in different
  transactions, the outcome should be exactly the same in every case
  regardless of the order.
- Change the expected output to something slightly more readable for
  us humans

tests/rpmconflict.at

index 5dcd2d6..385fed1 100644 (file)
@@ -124,7 +124,7 @@ runroot rpm -U "${TOPDIR}"/RPMS/noarch/selfconflict-1.0-1.noarch.rpm
 AT_CLEANUP
 # ------------------------------
 # File conflict between colored files, prefer 64bit
-AT_SETUP([multilib elf conflict, prefer 64bit])
+AT_SETUP([multilib elf conflict, prefer 64bit 1])
 AT_KEYWORDS([install])
 AT_CHECK([
 RPMDB_CLEAR
@@ -135,16 +135,72 @@ runroot rpm -U --ignoreos --ignorearch --nodeps \
   --define "_prefer_color 2" \
   /data/RPMS/hello-2.0-1.i686.rpm \
   /data/RPMS/hello-2.0-1.x86_64.rpm
-runroot rpm -q --qf "[[%{filestates:fstate} ]]" hello.i686 hello.x86_64
+runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
 ],
 [0],
-[wrong color normal normal normal normal normal normal normal normal normal ],
+[wrong color,normal,normal,normal,normal,
+normal,normal,normal,normal,normal,
+],
+[])
+AT_CLEANUP
+
+# ------------------------------
+# File conflict between colored files, prefer 64bit
+AT_SETUP([multilib elf conflict, prefer 64bit 2])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+
+runroot rpm -U --ignoreos --ignorearch --nodeps \
+  --define "_transaction_color 3" \
+  --define "_prefer_color 2" \
+  /data/RPMS/hello-2.0-1.i686.rpm
+runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686
+runroot rpm -U --ignoreos --ignorearch --nodeps \
+  --define "_transaction_color 3" \
+  --define "_prefer_color 2" \
+  /data/RPMS/hello-2.0-1.x86_64.rpm
+runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
+],
+[0],
+[normal,normal,normal,normal,normal,
+wrong color,normal,normal,normal,normal,
+normal,normal,normal,normal,normal,
+],
+[])
+AT_CLEANUP
+
+# ------------------------------
+# File conflict between colored files, prefer 64bit
+AT_SETUP([multilib elf conflict, prefer 64bit 3])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+
+runroot rpm -U --ignoreos --ignorearch --nodeps \
+  --define "_transaction_color 3" \
+  --define "_prefer_color 2" \
+  /data/RPMS/hello-2.0-1.x86_64.rpm
+runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.x86_64
+runroot rpm -U --ignoreos --ignorearch --nodeps \
+  --define "_transaction_color 3" \
+  --define "_prefer_color 2" \
+  /data/RPMS/hello-2.0-1.i686.rpm
+runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
+],
+[0],
+[normal,normal,normal,normal,normal,
+wrong color,normal,normal,normal,normal,
+normal,normal,normal,normal,normal,
+],
 [])
 AT_CLEANUP
 
 # ------------------------------
 # File conflict between colored files, prefer 32bit
-AT_SETUP([multilib elf conflict, prefer 32bit])
+AT_SETUP([multilib elf conflict, prefer 32bit 1])
 AT_KEYWORDS([install])
 AT_CHECK([
 RPMDB_CLEAR
@@ -155,10 +211,66 @@ runroot rpm -U --ignoreos --ignorearch --nodeps \
   --define "_prefer_color 1" \
   /data/RPMS/hello-2.0-1.i686.rpm \
   /data/RPMS/hello-2.0-1.x86_64.rpm
-runroot rpm -q --qf "[[%{filestates:fstate} ]]" hello.i686 hello.x86_64
+runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
+],
+[0],
+[normal,normal,normal,normal,normal,
+wrong color,normal,normal,normal,normal,
+],
+[])
+AT_CLEANUP
+
+# ------------------------------
+# File conflict between colored files, prefer 32bit
+AT_SETUP([multilib elf conflict, prefer 32bit 2])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+
+runroot rpm -U --ignoreos --ignorearch --nodeps \
+  --define "_transaction_color 3" \
+  --define "_prefer_color 1" \
+  /data/RPMS/hello-2.0-1.i686.rpm 
+runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686
+runroot rpm -U --ignoreos --ignorearch --nodeps \
+  --define "_transaction_color 3" \
+  --define "_prefer_color 1" \
+  /data/RPMS/hello-2.0-1.x86_64.rpm 
+runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
 ],
 [0],
-[normal normal normal normal normal wrong color normal normal normal normal ],
+[normal,normal,normal,normal,normal,
+normal,normal,normal,normal,normal,
+wrong color,normal,normal,normal,normal,
+],
+[])
+AT_CLEANUP
+
+# ------------------------------
+# File conflict between colored files, prefer 32bit
+AT_SETUP([multilib elf conflict, prefer 32bit 3])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+
+runroot rpm -U --ignoreos --ignorearch --nodeps \
+  --define "_transaction_color 3" \
+  --define "_prefer_color 1" \
+  /data/RPMS/hello-2.0-1.x86_64.rpm 
+runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.x86_64
+runroot rpm -U --ignoreos --ignorearch --nodeps \
+  --define "_transaction_color 3" \
+  --define "_prefer_color 1" \
+  /data/RPMS/hello-2.0-1.i686.rpm 
+runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
+],
+[0],
+[normal,normal,normal,normal,normal,
+normal,normal,normal,normal,normal,
+wrong color,normal,normal,normal,normal,
+],
 [])
 AT_CLEANUP