summaryrefslogtreecommitdiffstats
path: root/test/packaging
diff options
context:
space:
mode:
authordirkbaechle <devnull@localhost>2012-10-03 11:40:03 (GMT)
committerdirkbaechle <devnull@localhost>2012-10-03 11:40:03 (GMT)
commitaf2b9e2f216459fcdc26f367aaaf528d8122283b (patch)
tree28972b25a5bc9ba70bece2621adcc24af4d357ad /test/packaging
parent80cdf2501dfec07640481bf3d934add3e0cb0a04 (diff)
downloadSCons-af2b9e2f216459fcdc26f367aaaf528d8122283b.zip
SCons-af2b9e2f216459fcdc26f367aaaf528d8122283b.tar.gz
SCons-af2b9e2f216459fcdc26f367aaaf528d8122283b.tar.bz2
- final changes for bug2872 "Fix tests on Buildbot slaves", mainly switched all RPM tests to using the new rpmutils module
Diffstat (limited to 'test/packaging')
-rw-r--r--test/packaging/option--package-type.py7
-rw-r--r--test/packaging/rpm/cleanup.py5
-rw-r--r--test/packaging/rpm/internationalization.py17
3 files changed, 15 insertions, 14 deletions
diff --git a/test/packaging/option--package-type.py b/test/packaging/option--package-type.py
index 2a898ff..c8f22ca 100644
--- a/test/packaging/option--package-type.py
+++ b/test/packaging/option--package-type.py
@@ -29,6 +29,7 @@ Test the --package-type option.
"""
import TestSCons
+import SCons.Tool.rpmutils
_python_ = TestSCons._python_
@@ -67,12 +68,12 @@ env.Package( NAME = 'foo',
""" % locals())
src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.*.rpm'
+machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
test.run(arguments='package PACKAGETYPE=rpm', stderr = None)
test.must_exist( src_rpm )
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
test.must_not_exist( 'bin/main.c' )
test.must_not_exist( '/bin/main.c' )
@@ -80,7 +81,7 @@ test.run(arguments='-c package PACKAGETYPE=rpm', stderr = None)
test.run(arguments='package --package-type=rpm', stderr = None)
test.must_exist( src_rpm )
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
test.must_not_exist( 'bin/main.c' )
test.must_not_exist( '/bin/main.c' )
diff --git a/test/packaging/rpm/cleanup.py b/test/packaging/rpm/cleanup.py
index 91feba1..b77dfd1 100644
--- a/test/packaging/rpm/cleanup.py
+++ b/test/packaging/rpm/cleanup.py
@@ -29,6 +29,7 @@ Assert that files created by the RPM packager will be removed by 'scons -c'.
"""
import TestSCons
+import SCons.Tool.rpmutils
_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -88,9 +89,9 @@ test.up_to_date( arguments='.' )
test.run( arguments='-c .' )
src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.*.rpm'
+machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
-test.must_not_exist_any_of( [machine_rpm] )
+test.must_not_exist( machine_rpm )
test.must_not_exist( src_rpm )
test.must_not_exist( 'foo-1.2.3.tar.gz' )
test.must_not_exist( 'foo-1.2.3.spec' )
diff --git a/test/packaging/rpm/internationalization.py b/test/packaging/rpm/internationalization.py
index 4b75de4..2ef0dfd 100644
--- a/test/packaging/rpm/internationalization.py
+++ b/test/packaging/rpm/internationalization.py
@@ -32,7 +32,7 @@ These are x-rpm-Group, description, summary and the lang_xx file tag.
"""
import os
-import glob
+import SCons.Tool.rpmutils
import TestSCons
@@ -95,30 +95,29 @@ env.Alias ( 'install', prog )
test.run(arguments='', stderr = None)
src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.*.rpm'
+machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
test.must_exist( src_rpm )
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
test.must_not_exist( 'bin/main' )
-machine_rpm_path = glob.glob(machine_rpm)[0].lstrip('./')
cmd = 'rpm -qp --queryformat \'%%{GROUP}-%%{SUMMARY}-%%{DESCRIPTION}\' %s'
os.environ['LANGUAGE'] = 'de'
-out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm) ).read()
test.fail_test( out != 'Applikation/büro-hallo-das sollte wirklich lang sein' )
os.environ['LANGUAGE'] = 'fr'
-out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm) ).read()
test.fail_test( out != 'Application/bureau-bonjour-ceci devrait être vraiment long' )
os.environ['LANGUAGE'] = 'en'
-out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm) ).read()
test.fail_test( out != 'Application/office-hello-this should be really long' )
os.environ['LC_ALL'] = 'ae'
-out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm) ).read()
test.fail_test( out != 'Application/office-hello-this should be really long' )
#
@@ -177,7 +176,7 @@ env.Alias ( 'install', [ prog, man_pages ] )
test.run(arguments='--install-sandbox=blubb install', stderr = None)
test.must_exist( src_rpm )
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
test.pass_test()