Add two basic multilib conflict resolution tests
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 26 May 2011 10:49:38 +0000 (13:49 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 26 May 2011 11:18:09 +0000 (14:18 +0300)
- Add colored binary packages (as there's no guarantee we can build
  them from test-suite), test that colored conflicts get resolved
  to preferred color.

tests/Makefile.am
tests/data/RPMS/hello-2.0-1.i686.rpm [new file with mode: 0644]
tests/data/RPMS/hello-2.0-1.x86_64.rpm [new file with mode: 0644]
tests/rpmconflict.at

index 1e8a750..17f1e0f 100644 (file)
@@ -45,6 +45,8 @@ EXTRA_DIST += data/SOURCES/hello-2.0.tar.gz
 EXTRA_DIST += data/RPMS/foo-1.0-1.noarch.rpm
 EXTRA_DIST += data/RPMS/hello-1.0-1.i386.rpm
 EXTRA_DIST += data/RPMS/hello-1.0-1.ppc64.rpm
+EXTRA_DIST += data/RPMS/hello-2.0-1.i686.rpm
+EXTRA_DIST += data/RPMS/hello-2.0-1.x86_64.rpm
 EXTRA_DIST += data/SRPMS/foo-1.0-1.src.rpm
 EXTRA_DIST += data/SRPMS/hello-1.0-1.src.rpm
 
diff --git a/tests/data/RPMS/hello-2.0-1.i686.rpm b/tests/data/RPMS/hello-2.0-1.i686.rpm
new file mode 100644 (file)
index 0000000..ae2df25
Binary files /dev/null and b/tests/data/RPMS/hello-2.0-1.i686.rpm differ
diff --git a/tests/data/RPMS/hello-2.0-1.x86_64.rpm b/tests/data/RPMS/hello-2.0-1.x86_64.rpm
new file mode 100644 (file)
index 0000000..5a35572
Binary files /dev/null and b/tests/data/RPMS/hello-2.0-1.x86_64.rpm differ
index 89b6857..2dc12e3 100644 (file)
@@ -84,6 +84,45 @@ runroot rpm -U \
 [ignore])
 AT_CLEANUP
 
+# ------------------------------
+# File conflict between colored files, prefer 64bit
+AT_SETUP([rpm -U multilib elf conflict, prefer 64bit])
+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 \
+  /data/RPMS/hello-2.0-1.x86_64.rpm
+runroot rpm -q --qf "[[%{filestates:fstate} ]]" hello.i686 hello.x86_64
+],
+[0],
+[wrong color normal normal normal normal normal normal normal normal normal ],
+[])
+AT_CLEANUP
+
+# ------------------------------
+# File conflict between colored files, prefer 32bit
+AT_SETUP([rpm -U multilib elf conflict, prefer 32bit])
+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 \
+  /data/RPMS/hello-2.0-1.x86_64.rpm
+runroot rpm -q --qf "[[%{filestates:fstate} ]]" hello.i686 hello.x86_64
+],
+[0],
+[normal normal normal normal normal wrong color normal normal normal normal ],
+[])
+AT_CLEANUP
 
 # ------------------------------
 # Replace directory with symlink, this is expected to fail