summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2024-05-28 23:51:12 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2024-05-31 10:56:31 +0200
commit424c3613364da85533d0dd9b5c49f33f687e112d (patch)
treead435820985bcb72a9b6e0f862e3600f8e002b13
parent1fd56cde881acd60025c8b844ae6c98849d15b8f (diff)
downloadurpmi-424c3613364da85533d0dd9b5c49f33f687e112d.tar
urpmi-424c3613364da85533d0dd9b5c49f33f687e112d.tar.gz
urpmi-424c3613364da85533d0dd9b5c49f33f687e112d.tar.bz2
urpmi-424c3613364da85533d0dd9b5c49f33f687e112d.tar.xz
urpmi-424c3613364da85533d0dd9b5c49f33f687e112d.zip
Add i586 to i686 upgrate test
-rw-r--r--Changes2
-rw-r--r--MANIFEST3
-rw-r--r--t/data/SPECS/i586-to-i686/libfoobar.spec26
-rw-r--r--t/data/rpm-i586-to-i686/libfoobar-1-1.i586.rpmbin0 -> 8880 bytes
-rw-r--r--t/data/rpm-i586-to-i686/libfoobar-1-1.i686.rpmbin0 -> 8936 bytes
-rw-r--r--t/superuser--i586-to-i686.t22
6 files changed, 53 insertions, 0 deletions
diff --git a/Changes b/Changes
index aa815308..20699892 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,6 @@
- Set wget as default downloader (mga#24362)
+- testsuite:
+ o add i586 to i686 upgrate test
Version 8.131 - 13 April 2023
diff --git a/MANIFEST b/MANIFEST
index 4625799e..34d2d556 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -109,6 +109,8 @@ t/data/reconfig.urpmi
t/data/rpm-buggy/invalid-signature.rpm
t/data/rpm-buggy/not-a-rpm.rpm
t/data/rpm-buggy/weird-header.rpm
+t/data/rpm-i586-to-i686/libfoobar-1-1.i586.rpm
+t/data/rpm-i586-to-i686/libfoobar-1-1.i686.rpm
t/data/rpm-v3/KBackup-1.2.11-1.src.rpm
t/data/rpm-v3/libtermcap-2.0.8-2.i386.rpm
t/data/rpm-v3/nls-1.0-2.i386.rpm
@@ -196,6 +198,7 @@ t/data/SPECS/handle-conflict-deps2/c-2.spec
t/data/SPECS/handle-conflict-deps2/d1-1.spec
t/data/SPECS/handle-conflict-deps2/d1-2.spec
t/data/SPECS/handle-conflict-deps2/d2.spec
+t/data/SPECS/i586-to-i686/libfoobar.spec
t/data/SPECS/kernel-1/kernel-desktop1.spec
t/data/SPECS/kernel-1/kernel-desktop2.spec
t/data/SPECS/kernel-1/kernel-desktop3.spec
diff --git a/t/data/SPECS/i586-to-i686/libfoobar.spec b/t/data/SPECS/i586-to-i686/libfoobar.spec
new file mode 100644
index 00000000..891d2e98
--- /dev/null
+++ b/t/data/SPECS/i586-to-i686/libfoobar.spec
@@ -0,0 +1,26 @@
+# rpmbuild -ba libfoobar.spec --target i586
+# rpmbuild -ba libfoobar.spec --target i686
+
+# we could build with -static but then pkg goes up from 8.5kb to 280Kb:
+%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}libc.so
+Summary: x
+Name: libfoobar
+Version: 1
+Release: 1
+License: x
+
+%build
+cat > t.c <<EOF
+void main () {}
+EOF
+linux32 gcc -m32 -march=i586 -o t t.c
+
+%install
+mkdir -p %buildroot/%_bindir
+cp -a t %buildroot/%_bindir
+
+%description
+binary lib
+
+%files
+%_bindir/t
diff --git a/t/data/rpm-i586-to-i686/libfoobar-1-1.i586.rpm b/t/data/rpm-i586-to-i686/libfoobar-1-1.i586.rpm
new file mode 100644
index 00000000..ed0d9211
--- /dev/null
+++ b/t/data/rpm-i586-to-i686/libfoobar-1-1.i586.rpm
Binary files differ
diff --git a/t/data/rpm-i586-to-i686/libfoobar-1-1.i686.rpm b/t/data/rpm-i586-to-i686/libfoobar-1-1.i686.rpm
new file mode 100644
index 00000000..94055db8
--- /dev/null
+++ b/t/data/rpm-i586-to-i686/libfoobar-1-1.i686.rpm
Binary files differ
diff --git a/t/superuser--i586-to-i686.t b/t/superuser--i586-to-i686.t
new file mode 100644
index 00000000..6ff3914e
--- /dev/null
+++ b/t/superuser--i586-to-i686.t
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+# kernel-desktop-latest request latest kernel-desktop-foobar
+#
+use strict;
+use lib '.', 't';
+use helper;
+use urpm::cfg;
+use urpm::orphans;
+use Test::More 'no_plan';
+
+need_root_and_prepare();
+
+my $arch = urpm::cfg::get_arch();
+my $name = 'kernel';
+my $medium = 'i586-to-i686';
+urpmi_addmedia("$medium $::pwd/media/rpm-i586-to-i686/");
+urpmi("--media $medium --auto libfoobar-1-1.i586");
+check_installed_names('libfoobar');
+urpmi("--media $medium --auto libfoobar-1-1.i686");
+is(`rpm -q --qf '%{NVRA}' --root $::pwd/root libfoobar`, 'libfoobar-1-1.i686', 'i686 pkgs is installed (aka upgraded)');
+check_installed_and_remove('libfoobar');