From 4b47c233b308dcfefe77a6a493c01d3b4fc59bbe Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Tue, 10 Jan 2023 08:37:03 -0700 Subject: [PATCH] LU-16457 tests: wait for remote sleep in sanity-pcc/101a Wait longer for the remote sleep command to start on the agent node. Test-Parameters: trivial testlist=sanity-pcc env=ONLY=101a,ONLY_REPEAT=200 Signed-off-by: Andreas Dilger Change-Id: I5dcbd6a7127b3e17aa658c87f5c75874432dc353 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49587 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Feng Lei Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- lustre/tests/sanity-pcc.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lustre/tests/sanity-pcc.sh b/lustre/tests/sanity-pcc.sh index a1b1072..8dc3ada 100644 --- a/lustre/tests/sanity-pcc.sh +++ b/lustre/tests/sanity-pcc.sh @@ -1510,13 +1510,18 @@ test_101a() { echo "creating user namespace for $RUNAS_ID" # Create a mount and user namespace with this command, and leave the # process running so we can do the rest of our steps - do_facet $SINGLEAGT $RUNAS unshare -Um sleep 600 & - # Let the child start... - sleep 2 - # Get the sleep PID so we can find its namespace and kill it later - PID=$(do_facet $SINGLEAGT pgrep sleep) + local start=$SECONDS + local PID=$(do_facet $SINGLEAGT \ + "$RUNAS unshare -Um sleep 600 &>/dev/null & echo \\\$!") + local elapsed=$((SECONDS - start)) + local count=0 + + do_facet $SINGLEAGT ps auxww | grep sleep + echo "Created NS: child (sleep) pid=$PID in $elapsed seconds" + [[ -n "$PID" ]] || error "remote sleep start failed" stack_trap "do_facet $SINGLEAGT kill -9 $PID" EXIT - echo "Created NS: child (sleep) pid $PID" + (( elapsed < 300 )) || error "remote sleep took $elapsed sec to start" + # Map 'RUNAS' to root in the namespace, so it has rights to do whatever # This is handled by '-r' in unshare in newer versions do_facet $SINGLEAGT $RUNAS newuidmap $PID 0 $RUNAS_ID 1 || -- 1.8.3.1