Skip to content
Snippets Groups Projects
Commit 22a69b04 authored by Tamara Dahlgren's avatar Tamara Dahlgren Committed by Gregory Becker
Browse files

tests: Preliminary patchelf smoke tests (#14551)

* Initial patchelf smoke tests
parent 0deddad5
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
from spack import * from spack import *
import os
import shutil
import tempfile
import llnl.util.tty as tty
class Patchelf(AutotoolsPackage): class Patchelf(AutotoolsPackage):
"""PatchELF is a small utility to modify the dynamic linker and RPATH of """PatchELF is a small utility to modify the dynamic linker and RPATH of
...@@ -18,3 +24,23 @@ class Patchelf(AutotoolsPackage): ...@@ -18,3 +24,23 @@ class Patchelf(AutotoolsPackage):
version('0.10', sha256='b2deabce05c34ce98558c0efb965f209de592197b2c88e930298d740ead09019') version('0.10', sha256='b2deabce05c34ce98558c0efb965f209de592197b2c88e930298d740ead09019')
version('0.9', sha256='f2aa40a6148cb3b0ca807a1bf836b081793e55ec9e5540a5356d800132be7e0a') version('0.9', sha256='f2aa40a6148cb3b0ca807a1bf836b081793e55ec9e5540a5356d800132be7e0a')
version('0.8', sha256='14af06a2da688d577d64ff8dac065bb8903bbffbe01d30c62df7af9bf4ce72fe') version('0.8', sha256='14af06a2da688d577d64ff8dac065bb8903bbffbe01d30c62df7af9bf4ce72fe')
def test(self):
patchelf = which('patchelf')
assert patchelf is not None
tty.msg('test: Ensuring use of the installed executable')
patchelf_dir = os.path.dirname(patchelf.path)
assert patchelf_dir == self.prefix.bin
tty.msg('test: Checking version')
output = patchelf('--version', output=str.split, error=str.split)
assert output.strip() == 'patchelf {0}'.format(self.spec.version)
tty.msg('test: Ensuring the rpath is changed')
currdir = os.getcwd()
hello_fn = os.path.join(currdir, 'data', 'hello')
patchelf('--set-rpath', currdir, hello_fn)
output = patchelf('--print-rpath', hello_fn,
output=str.split, error=str.split)
assert output.strip() == currdir
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment