From a2237ddce8e7591470a4417515687c95dd8acdc0 Mon Sep 17 00:00:00 2001 From: Evgeny Malygin Date: Fri, 17 May 2024 23:48:50 +0300 Subject: [PATCH] Fix: AIX/Solaris use python3.8 in UT (#294) Signed-off-by: Evgeny Malygin --- src/groups/mwc/mwcsys/mwcsys_executil.t.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/groups/mwc/mwcsys/mwcsys_executil.t.cpp b/src/groups/mwc/mwcsys/mwcsys_executil.t.cpp index 4a5548102..8af5fc2bf 100644 --- a/src/groups/mwc/mwcsys/mwcsys_executil.t.cpp +++ b/src/groups/mwc/mwcsys/mwcsys_executil.t.cpp @@ -129,9 +129,19 @@ static void test2_executeSystemFailure() int rc; PVV("Testing abnormal exit of the command"); + +#if defined(BSLS_PLATFORM_OS_SOLARIS) || defined(BSLS_PLATFORM_OS_AIX) + // For AIX/Solaris, python2 support is stopped, and alias `python3` + // doesn't exist. The final supported release is 3.8. + rc = mwcsys::ExecUtil::execute(&output, + "python3.8 -c 'import os,signal; " + "os.kill(os.getpid(), signal.SIGKILL)'"); +#else rc = mwcsys::ExecUtil::execute(&output, "python3 -c 'import os,signal; " "os.kill(os.getpid(), signal.SIGKILL)'"); +#endif + ASSERT_EQ(rc, -2); ASSERT_EQ(output, "");