From 7a77c538d29cff3bf71c4d9c705675590a188d34 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Tue, 19 Dec 2023 16:49:47 -0800 Subject: [PATCH] testsuite: fix FLUX_HWLOC_XMLFILE test under flux-run(1) Problem: When used under flux-run(1), the FLUX_HWLOC_XMLFILE test in t0001-basic.t may fail due to CPU affinity. Before launching flux-start(1), use hwloc-bind(1) to undo any CPU affinity mask so that the expected resources from the fake hwloc XML are available in output. --- t/t0001-basic.t | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/t/t0001-basic.t b/t/t0001-basic.t index de188788ff5c..dfbe04ca697e 100755 --- a/t/t0001-basic.t +++ b/t/t0001-basic.t @@ -370,10 +370,11 @@ test_expect_success 'flux-start dies gracefully when run from removed dir' ' ' command -v hwloc-ls >/dev/null && test_set_prereq HWLOC_LS -test_expect_success HWLOC_LS 'FLUX_HWLOC_XMLFILE works' ' +command -v hwloc-bind >/dev/null && test_set_prereq HWLOC_BIND +test_expect_success HWLOC_LS,HWLOC_BIND 'FLUX_HWLOC_XMLFILE works' ' hwloc-ls --of xml -i "numa:2 core:3 pu:1" >test.xml && - FLUX_HWLOC_XMLFILE=test.xml flux start -s 2 flux resource info \ - >rinfo.out && + FLUX_HWLOC_XMLFILE=test.xml hwloc-bind all \ + flux start -s 2 flux resource info >rinfo.out && test_debug "cat rinfo.out" && grep "12 Cores" rinfo.out '