Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2021-04-21 22:47:13 +1000
committerAllan McRae <allan@archlinux.org>2021-04-22 00:15:21 +1000
commit3179db108a83104d9de6d1d607f55f8118e92160 (patch)
tree2141a5a0a565bbfc8261bbc434bcfa53830115a1 /test
parentabdb4d7fa699ae3b8ff09ba79656f6853b9a1357 (diff)
Add support for multiple 'Architecture' values
This allows architecture to be multivalued. On x86-64 machines, this could be something like: Architecture = x86-64-v3 x86-64 We use the first specified Architecture value in mirrorlist $arch variable replacement, as this is backwards-compatible and sane. Original-patch-by: Dan McGee <dan@archlinux.org> Patch-updated-by: Allan McRae <allan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/meson.build2
-rw-r--r--test/pacman/tests/multiple-architectures01.py14
-rw-r--r--test/pacman/tests/multiple-architectures02.py16
3 files changed, 32 insertions, 0 deletions
diff --git a/test/pacman/meson.build b/test/pacman/meson.build
index 52ff9b9a..6c28bd7d 100644
--- a/test/pacman/meson.build
+++ b/test/pacman/meson.build
@@ -85,6 +85,8 @@ pacman_tests = [
'tests/mode001.py',
'tests/mode002.py',
'tests/mode003.py',
+ 'tests/multiple-architectures01.py',
+ 'tests/multiple-architectures02.py',
'tests/noupgrade-inverted.py',
'tests/overwrite-files-match-negated.py',
'tests/overwrite-files-match.py',
diff --git a/test/pacman/tests/multiple-architectures01.py b/test/pacman/tests/multiple-architectures01.py
new file mode 100644
index 00000000..39f3e1f7
--- /dev/null
+++ b/test/pacman/tests/multiple-architectures01.py
@@ -0,0 +1,14 @@
+self.description = "Install a package (multiple Architecture options, wrong)"
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+p.arch = 'i686'
+self.addpkg(p)
+
+self.option["Architecture"] = ['i586', 'i486', 'i386']
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=dummy")
diff --git a/test/pacman/tests/multiple-architectures02.py b/test/pacman/tests/multiple-architectures02.py
new file mode 100644
index 00000000..18625ec6
--- /dev/null
+++ b/test/pacman/tests/multiple-architectures02.py
@@ -0,0 +1,16 @@
+self.description = "Install a package (multiple Architecture options)"
+
+p = pmpkg("dummy")
+p.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+p.arch = 'i486'
+self.addpkg(p)
+
+self.option["Architecture"] = ['i586', 'i486', 'i386']
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=dummy")
+for f in p.files:
+ self.addrule("FILE_EXIST=%s" % f) \ No newline at end of file