summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-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
4 files changed, 48 insertions, 0 deletions
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');