tests: Preliminary patchelf smoke tests (#14551)
* Initial patchelf smoke tests
This commit is contained in:
committed by
Tamara Dahlgren
parent
966fc427a9
commit
59e885bd4f
@@ -5,6 +5,12 @@
|
||||
|
||||
from spack import *
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
import llnl.util.tty as tty
|
||||
|
||||
|
||||
class Patchelf(AutotoolsPackage):
|
||||
"""PatchELF is a small utility to modify the dynamic linker and RPATH of
|
||||
@@ -18,3 +24,23 @@ class Patchelf(AutotoolsPackage):
|
||||
version('0.10', sha256='b2deabce05c34ce98558c0efb965f209de592197b2c88e930298d740ead09019')
|
||||
version('0.9', sha256='f2aa40a6148cb3b0ca807a1bf836b081793e55ec9e5540a5356d800132be7e0a')
|
||||
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
|
||||
|
||||
BIN
var/spack/repos/builtin/packages/patchelf/test/hello
Executable file
BIN
var/spack/repos/builtin/packages/patchelf/test/hello
Executable file
Binary file not shown.
Reference in New Issue
Block a user