summaryrefslogtreecommitdiffstats
path: root/test/packaging/rpm
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2018-08-07 23:05:50 (GMT)
committerMats Wichmann <mats@linux.com>2018-08-13 16:30:23 (GMT)
commit00673a71ed8aeb99831272e0daba01ad36cdd073 (patch)
treeb62631fda58ebf4281599f93eb3d00f065d9e92c /test/packaging/rpm
parent5d21b1cac7605f4df43ddc6db30011e6d1006859 (diff)
downloadSCons-00673a71ed8aeb99831272e0daba01ad36cdd073.zip
SCons-00673a71ed8aeb99831272e0daba01ad36cdd073.tar.gz
SCons-00673a71ed8aeb99831272e0daba01ad36cdd073.tar.bz2
Fix rpm tests for newer rpmbuild (fixes #3164)
Two issues: (1) ARCHITECTURE, if supplied, actually needs to be set in the specfile BuildArch: field (or passed on the command line). (2) rpmbuild on Fedora builds all kind of debug stuff behind the scenes (it makes packages not requested by the specfile!). This causes scons rpm tests to fail, so force in a flag to turn off this generation. That is done unconditionally at the moment by writing %global debug_package %{nil}\n to the specfile. If anyone eventually ends up needing to produce these debug packages through scons, we can add a flag to allow it by omitting the above setting. Some doc and comment cleanup done, and one of the tests now builds a noarch package to test actually supplying an ARCHITECTURE value that is not the machine default. Also, one of the tools called by rpm packaging did not supply the right suffix for the Tar builder, presumably a copy-paste error in a place that is not stressed by any test. Fedora packaging now also generates a file containing the build id and puts it into the package (another behind the scenes bit of magic - this does not appear in our %files section but is still added to the package). It is possible to turn this behavior off as well, but for the tests affected, the choice was made instead to have them now check the files in the generated package /contain/ the expected filenames rather than /exactly-match/ the expected filenames. Testing: on recent Fedora all the rpm-related tests now pass after six failed previously; on a Centos 7.4 system which did not fail any tests, the modified code still passes - did not introduce regressions. At the moment do not believe any of the CI setup will cause rpm tests to be run. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/packaging/rpm')
-rw-r--r--test/packaging/rpm/multipackage.py6
-rw-r--r--test/packaging/rpm/package.py6
-rw-r--r--test/packaging/rpm/tagging.py7
3 files changed, 13 insertions, 6 deletions
diff --git a/test/packaging/rpm/multipackage.py b/test/packaging/rpm/multipackage.py
index ab8734d..f756cf4 100644
--- a/test/packaging/rpm/multipackage.py
+++ b/test/packaging/rpm/multipackage.py
@@ -109,8 +109,10 @@ test.must_exist( machine_rpm2 )
test.must_exist( src_rpm2 )
test.must_not_exist( 'bin/main' )
-test.fail_test( not os.popen('rpm -qpl %s' % machine_rpm).read()=='/bin/main\n')
-test.fail_test( not os.popen('rpm -qpl %s' % src_rpm).read()=='foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
+out = os.popen( 'rpm -qpl %s' % machine_rpm).read()
+test.must_contain_all_lines( out, '/bin/main')
+out = os.popen( 'rpm -qpl %s' % src_rpm).read()
+test.fail_test( not out == 'foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
test.pass_test()
diff --git a/test/packaging/rpm/package.py b/test/packaging/rpm/package.py
index d8c2785..6723a9f 100644
--- a/test/packaging/rpm/package.py
+++ b/test/packaging/rpm/package.py
@@ -88,8 +88,10 @@ machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
test.must_exist( machine_rpm )
test.must_exist( src_rpm )
test.must_not_exist( 'bin/main' )
-test.fail_test( not os.popen('rpm -qpl %s' % machine_rpm).read()=='/bin/main\n')
-test.fail_test( not os.popen('rpm -qpl %s' % src_rpm).read()=='foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
+out = os.popen( 'rpm -qpl %s' % machine_rpm).read()
+test.must_contain_all_lines( out, '/bin/main')
+out = os.popen( 'rpm -qpl %s' % src_rpm).read()
+test.fail_test( not out == 'foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
test.pass_test()
diff --git a/test/packaging/rpm/tagging.py b/test/packaging/rpm/tagging.py
index a558242..15f82a7 100644
--- a/test/packaging/rpm/tagging.py
+++ b/test/packaging/rpm/tagging.py
@@ -91,9 +91,12 @@ src_rpm = 'foo-1.2.3-0.src.rpm'
machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
test.must_exist( machine_rpm )
+out = os.popen('rpm -qpl %s' % machine_rpm).read()
+test.must_contain_all_lines( out, '/bin/main')
+
test.must_exist( src_rpm )
-test.fail_test( not os.popen('rpm -qpl %s' % machine_rpm).read()=='/bin/main\n')
-test.fail_test( not os.popen('rpm -qpl %s' % src_rpm).read()=='foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
+out = os.popen('rpm -qpl %s' % src_rpm).read()
+test.fail_test( not out == 'foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
expect = '(0755, root, users) /bin/main'
test.must_contain_all_lines(test.read('foo-1.2.3.spec',mode='r'), [expect])