tests: check presence not equality for rpath changes (#16637)

Fixes #16636
This commit is contained in:
Tamara Dahlgren 2020-05-20 09:11:26 -07:00 committed by GitHub
parent cc08070da9
commit 92989fbbfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -253,7 +253,9 @@ def test_replace_prefix_bin(hello_world):
# Check that the RPATHs changed # Check that the RPATHs changed
patchelf = spack.util.executable.which('patchelf') patchelf = spack.util.executable.which('patchelf')
output = patchelf('--print-rpath', str(executable), output=str) output = patchelf('--print-rpath', str(executable), output=str)
assert output.strip() == '/foo/lib:/foo/lib64'
# Some compilers add rpaths so ensure changes included in final result
assert '/foo/lib:/foo/lib64' in output
@pytest.mark.requires_executables('patchelf', 'strings', 'file', 'gcc') @pytest.mark.requires_executables('patchelf', 'strings', 'file', 'gcc')
@ -280,7 +282,9 @@ def test_relocate_elf_binaries_absolute_paths(hello_world, tmpdir):
# Check that the RPATHs changed # Check that the RPATHs changed
patchelf = spack.util.executable.which('patchelf') patchelf = spack.util.executable.which('patchelf')
output = patchelf('--print-rpath', str(new_binary), output=str) output = patchelf('--print-rpath', str(new_binary), output=str)
assert output.strip() == '/foo/lib:/usr/lib64'
# Some compilers add rpaths so ensure changes included in final result
assert '/foo/lib:/usr/lib64' in output
@pytest.mark.requires_executables('patchelf', 'strings', 'file', 'gcc') @pytest.mark.requires_executables('patchelf', 'strings', 'file', 'gcc')
@ -307,4 +311,6 @@ def test_relocate_elf_binaries_relative_paths(hello_world, tmpdir):
# Check that the RPATHs changed # Check that the RPATHs changed
patchelf = spack.util.executable.which('patchelf') patchelf = spack.util.executable.which('patchelf')
output = patchelf('--print-rpath', str(new_binary), output=str) output = patchelf('--print-rpath', str(new_binary), output=str)
assert output.strip() == '/foo/lib:/foo/lib64:/opt/local/lib'
# Some compilers add rpaths so ensure changes included in final result
assert '/foo/lib:/foo/lib64:/opt/local/lib' in output