Skip to content
Snippets Groups Projects
Commit cd549c84 authored by Ludovico de Nittis's avatar Ludovico de Nittis
Browse files

tests: Remove problematic check in mock executable

Returning an error when a library was located in a directory that ended
with 32, for x86_64, and 64, for i386, was, in theory, a good and simple
strategy.

However we also check libraries by using their `/proc/${PID}/fd/...`
path instead of the canonical absolute path.
This means that if the PID ended with 32 or 64, we could have received
an unexpected reply.

Given that this check is not actually necessary for the tests that we
have, we can simply remove it.

Fixes: https://gitlab.steamos.cloud/steamrt/tasks/-/issues/162



Signed-off-by: default avatarLudovico de Nittis <ludovico.denittis@collabora.com>
parent 29d35827
No related branches found
No related tags found
1 merge request!499tests: Remove problematic check in mock executable
Pipeline #33886 passed
......@@ -38,12 +38,10 @@ main (int argc,
#if defined(MOCK_ARCHITECTURE_x86_64)
const gchar *multiarch = "x86_64-mock-abi";
const gchar *lib_dir = "lib64";
const gchar *wrong_lib_dir = "32/";
const gchar *wrong_abi = "i386";
#else
const gchar *multiarch = "i386-mock-abi";
const gchar *lib_dir = "lib32";
const gchar *wrong_lib_dir = "64/";
const gchar *wrong_abi = "x86_64";
#endif
......@@ -54,12 +52,10 @@ main (int argc,
if (argv[2][0] == '/')
{
/* This is a very naive check to simulate the exit error that occurrs
/* This is a very naive check to simulate the exit error that occurs
* when we request a library that is of the wrong ELF class. */
if (g_strstr_len (argv[2], -1, wrong_abi) != NULL)
goto out;
if (g_strstr_len (argv[2], -1, wrong_lib_dir) != NULL)
goto out;
/* If the path is already absolute, just prepend the sysroot */
path = g_build_filename (g_environ_getenv (envp, "SRT_TEST_SYSROOT"), argv[2], NULL);
......
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