From 61580a70738f3f262d7bd6ed1fe194a596058b87 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Mon, 13 Dec 2021 11:15:44 -0800 Subject: [PATCH] t2801-top-cmd.t: fix tests now that flux-top uses flux-uri Problem: Many flux-top expected failure tests now fail since flux-top resolves its target argument with flux_uri_resolve(). Updated expected failure output and other tests in t2801-top-cmd.t. --- t/t2801-top-cmd.t | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/t/t2801-top-cmd.t b/t/t2801-top-cmd.t index 05260973b41e..a04293fd1ea9 100755 --- a/t/t2801-top-cmd.t +++ b/t/t2801-top-cmd.t @@ -12,7 +12,7 @@ testssh="${SHARNESS_TEST_SRCDIR}/scripts/tssh" test_expect_success 'flux-top -h prints custom usage' ' flux top -h 2>usage && - grep "Usage:.*JOBID" usage + grep "Usage:.*TARGET" usage ' test_expect_success 'flux-top fails on unknown option' ' test_must_fail flux top --notopt 2>notopt.err && @@ -22,20 +22,22 @@ test_expect_success 'flux-top fails if FLUX_URI is set wrong' ' (FLUX_URI=noturi test_must_fail flux top) 2>baduri.err && grep "connecting to Flux" baduri.err ' -test_expect_success 'flux-top fails if job argument is not a job ID' ' - test_must_fail flux top notjob 2>badjobid.err && - grep "failed to parse JOBID" badjobid.err +test_expect_success 'flux-top fails if job argument is not a valid URI' ' + test_must_fail flux top baduri 2>baduri.err && + test_debug "cat baduri.err" && + grep "failed to resolve" baduri.err ' test_expect_success 'flux-top fails if job argument is unknown' ' test_must_fail flux top 12345 2>unkjobid.err && - grep "unknown job" unkjobid.err + grep "jobid 12345 not found" unkjobid.err ' test_expect_success 'run a test job to completion' ' - flux mini submit --wait -n1 /bin/true >jobid + flux mini submit --wait -n1 flux start /bin/true >jobid ' test_expect_success 'flux-top fails if job is not running' ' - test_must_fail flux top $(cat jobid) 2>notrun.err && - grep "job is not running" notrun.err + test_must_fail flux top $(cat jobid)?local 2>notrun.err && + test_debug "cat notrun.err" && + grep "error connecting to Flux" notrun.err ' test_expect_success 'flux-top fails if stdin is not a tty' ' test_must_fail flux top --test-exit notty.err && @@ -67,7 +69,8 @@ test_expect_success 'flux-top JOBID fails when JOBID is not a flux instance' ' FLUX_SSH=$testssh test_must_fail \ $runpty --format=asciicast -o notflux.log \ flux top --test-exit $(cat jobid3) && - grep "not a Flux instance" notflux.log + test_debug "cat notflux.log" && + grep "URI not found" notflux.log ' test_expect_success NO_CHAIN_LINT 'flux-top quits on q keypress' ' $runpty --quit-char=q --format=asciicast -o keys.log flux top &