| |
@@ -27,6 +27,7 @@
|
| |
import unittest
|
| |
import os
|
| |
import os.path
|
| |
+ import shutil
|
| |
import rpm
|
| |
#import base64
|
| |
|
| |
@@ -1269,7 +1270,6 @@
|
| |
"build directory %s already exists" % self.rpmbuild.get_base_dir())
|
| |
|
| |
def tearDown(self):
|
| |
- import shutil
|
| |
shutil.rmtree(self.rpmbuild.get_base_dir(), ignore_errors=True)
|
| |
|
| |
def test_build(self):
|
| |
@@ -1681,10 +1681,17 @@
|
| |
"/usr/bin/perl"))
|
| |
self.rpmbuild.make()
|
| |
|
| |
+ @unittest.skipIf(expectedArch != 'x86_64',
|
| |
+ 'host arch is not x86_64')
|
| |
def test_multiarch_compilation(self):
|
| |
"""Ensure that building on multiple archs works as expected"""
|
| |
- self.rpmbuild.add_simple_compilation()
|
| |
+ self.rpmbuild.buildArchs = ['i386', 'x86_64']
|
| |
+ self.rpmbuild.add_simple_compilation(installPath='/usr/bin/program')
|
| |
self.rpmbuild.make()
|
| |
+ hdr = self.rpmbuild.get_built_rpm_header('i386')
|
| |
+ self.assertEqual(1, rpm.files(hdr)['/usr/bin/program'].color)
|
| |
+ hdr = self.rpmbuild.get_built_rpm_header('x86_64')
|
| |
+ self.assertEqual(2, rpm.files(hdr)['/usr/bin/program'].color)
|
| |
|
| |
def test_multilib_conflict(self):
|
| |
"""Ensure that the hooks to create a multilib conflict work as expected"""
|
| |
@@ -1804,11 +1811,25 @@
|
| |
self.assertTrue(len(element) == 1, "Could not find data for type %s" % mdtype)
|
| |
self.assert_is_file(os.path.join(repo.repoDir, element[0].get('href')))
|
| |
finally:
|
| |
- import shutil
|
| |
shutil.rmtree(repo.repoDir, ignore_errors=True)
|
| |
for pkg in repo.rpmBuilds:
|
| |
shutil.rmtree(pkg.get_base_dir())
|
| |
|
| |
+ @unittest.skipIf(expectedArch != 'x86_64' or not os.path.isfile('/usr/bin/createrepo'),
|
| |
+ 'host arch is not x86_64 or /usr/bin/createrepo not found')
|
| |
+ def test_multiple_arches(self):
|
| |
+ package = SimpleRpmBuild('test-multilib-package', '0.1', '1', ['i386', 'x86_64'])
|
| |
+ repo = YumRepoBuild([package])
|
| |
+ self.addCleanup(shutil.rmtree, package.get_base_dir())
|
| |
+ self.addCleanup(shutil.rmtree, repo.repoDir)
|
| |
+
|
| |
+ repo.make('i386', 'x86_64')
|
| |
+
|
| |
+ # Check that the repo was built with both the i386 and x86_64 packages
|
| |
+ self.assert_is_dir(os.path.join(repo.repoDir, 'repodata'))
|
| |
+ self.assert_is_file(os.path.join(repo.repoDir, 'test-multilib-package-0.1-1.i386.rpm'))
|
| |
+ self.assert_is_file(os.path.join(repo.repoDir, 'test-multilib-package-0.1-1.x86_64.rpm'))
|
| |
+
|
| |
if __name__ == "__main__":
|
| |
unittest.main()
|
| |
|
| |
Following on from #2.