Commit 49ec3ece authored by Jérome Perrin's avatar Jérome Perrin

testing/testcase: use realpath to compare paths

This supports the case where some paths used for shared parts are
symlinks
parent abf16f01
Pipeline #8890 passed with stage
in 0 seconds
......@@ -268,6 +268,7 @@ def checkSoftware(slap, software_url):
Only libraries from `valid_paths_for_libs` are accepted.
Returns a list of error messages.
"""
valid_paths_for_libs = [os.path.realpath(x) for x in valid_paths_for_libs]
executable_link_error_list = []
for path in paths_to_check:
for root, dirs, files in os.walk(path):
......
  • I'm not sure this patch is correct. It was silly to think that it was a small innocent change that I can commit on master without running tests ... I'm checking this now.

  • ahah ! I checked on testnodes and valid_paths_for_libs is something like this:

    before: ('/srv/slapgrid/slappart9/srv/testnode/cxm/inst/test0-0/tmp/soft/1be550d21e789bd67bfb416fad6e864b', '/srv/slapgrid/slappart9/srv/testnode/cxm/inst/test0-0/tmp/shared', '')

    We have an extra '' at the end, this is because of a bug in this:

        shared_part_list=[
            os.path.expanduser(p) for p in os.environ.get(
                'SLAPOS_TEST_SHARED_PART_LIST', '').split(os.pathsep)
        ],

    if we change to realpath, then the '' is expanded to current directory:

    after:  ['/srv/slapgrid/slappart9/srv/testnode/cxm/inst/test0-0/tmp/soft/1be550d21e789bd67bfb416fad6e864b', '/srv/slapgrid/slappart9/srv/testnode/cxm/inst/test0-0/tmp/shared', '/srv/slapgrid/slappart9/srv/testnode/cxm/soft/174f168cce177c717e876a98f1dcfcfa/parts/slapos-repository/software/plantuml/test']

    and the check for :

                    if any(lib_path.startswith(valid_path)
                           for valid_path in valid_paths_for_libs):
                      continue

    was in fact always true ...

    That's a bug, because the failures we now have on master are real problems, but let's revert for now and prepare a proper fix to this check and to all the missing rpaths in profiles.

  • mentioned in commit fa0ebacf

    Toggle commit list
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment