Skip to contentSkip to conversation

tests/docker: Fix _get_so_libs() for docker-binfmt-image

PATCH In review Philippe Mathieu-Daudé 2 participants 2 messages Jan 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/docker: Fix _get_so_libs() for docker-binfmt-image

Fix a variable rename mistake from commit 5e33f7fead5:

Traceback (most recent call last):
File "./tests/docker/docker.py", line 710, in <module>
sys.exit(main())
File "./tests/docker/docker.py", line 706, in main
return args.cmdobj.run(args, argv)
File "./tests/docker/docker.py", line 489, in run
_copy_binary_with_libs(args.include_executable,
File "./tests/docker/docker.py", line 149, in _copy_binary_with_libs
libs = _get_so_libs(src)
File "./tests/docker/docker.py", line 123, in _get_so_libs
libs.append(s.group(1))
NameError: name 's' is not defined

Fixes 5e33f7fead5 ("tests/docker: better handle symlinked libs")

---
"Tested-by" but apparently not enough... Well actually it was on Debian, now using Fedora.

---
 tests/docker/docker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/docker/docker.py +1 -1
index 884dfeb29c4..0b4f6167b3d 100755
@@ -120,7 +120,7 @@ def _get_so_libs(executable):
             search = ldd_re.search(line)
             if search:
                 try:
-                    libs.append(s.group(1))
+                    libs.append(search.group(1))
                 except IndexError:
                     pass
     except subprocess.CalledProcessError:
Signature · 1 line
2.26.2
#1 lore raw
Quoted 15 lines · Philippe Mathieu-Daudé

Fix a variable rename mistake from commit 5e33f7fead5:

Traceback (most recent call last):
File "./tests/docker/docker.py", line 710, in <module>
sys.exit(main())
File "./tests/docker/docker.py", line 706, in main
return args.cmdobj.run(args, argv)
File "./tests/docker/docker.py", line 489, in run
_copy_binary_with_libs(args.include_executable,
File "./tests/docker/docker.py", line 149, in _copy_binary_with_libs
libs = _get_so_libs(src)
File "./tests/docker/docker.py", line 123, in _get_so_libs
libs.append(s.group(1))
NameError: name 's' is not defined

Quoted 5 lines
Fixes 5e33f7fead5 ("tests/docker: better handle symlinked libs")

---
"Tested-by" but apparently not enough... Well actually it was on Debian, now using Fedora.

Also we don't notice if we use static binaries (which I do most of the time).

Queued to testing/next, thanks.

Quoted 17 lines
---
 tests/docker/docker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/docker/docker.py +1 -1
index 884dfeb29c4..0b4f6167b3d 100755
@@ -120,7 +120,7 @@ def _get_so_libs(executable):
             search = ldd_re.search(line)
             if search:
                 try:
-                    libs.append(s.group(1))
+                    libs.append(search.group(1))
                 except IndexError:
                     pass
     except subprocess.CalledProcessError:
Signature · 1 line
Alex Bennée