Skip to content

Commit

Permalink
Merge pull request #174 from chu11/redfishpower_more_detailed_error
Browse files Browse the repository at this point in the history
redfishpower: add more details on hierarchy errors
  • Loading branch information
mergify[bot] authored Apr 11, 2024
2 parents 47a7071 + fb531f9 commit 00cd6c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 10 additions & 2 deletions src/redfishpower/redfishpower.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,16 @@ static void process_waiters(CURLM *mh,
else if (strcmp(pm->cmd, CMD_OFF) == 0
&& strcmp(status_str, STATUS_OFF) == 0)
printf("%s: %s\n", pm->plugname, "ok");
else
printf("%s: ancestor %s\n", pm->plugname, status_str);
else {
struct plug_data *pd = plugs_get_data(plugs, ancestor);
printf("%s: cannot perform %s, dependency %s"
" (host=%s plug=%s)\n",
pm->plugname,
pm->cmd,
status_str,
pd->hostname,
pd->plugname);
}
}

/* this power op is now done */
Expand Down
8 changes: 4 additions & 4 deletions t/t0034-redfishpower.t
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ test_expect_success 'powerman -1 t[1-15] completes' '
echo Command completed successfully >test_parents2L_on1.exp &&
test_cmp test_parents2L_on1.exp test_parents2L_on1.out &&
$powerman -h $testaddr -T -1 t[1-15] >test_parents2L_on1T.out &&
grep "ancestor off" test_parents2L_on1T.out
grep "cannot perform on, dependency off" test_parents2L_on1T.out
'
test_expect_success 'powerman -q shows all off still' '
$powerman -h $testaddr -q >test_parents2L_query2.out &&
Expand Down Expand Up @@ -471,14 +471,14 @@ test_expect_success 'powerman -1 t[1-3] completes but doesnt work' '
echo Command completed successfully >test_parents3L_on1.exp &&
test_cmp test_parents3L_on1.exp test_parents3L_on1.out &&
$powerman -h $testaddr -T -1 t[1-3] >test_parents3L_on1T.out &&
grep "ancestor off" test_parents3L_on1T.out
grep "cannot perform on, dependency off" test_parents3L_on1T.out
'
test_expect_success 'powerman -1 t[4-15] completes but doesnt work' '
$powerman -h $testaddr -1 t[4-15] >test_parents3L_on2.out &&
echo Command completed successfully >test_parents3L_on2.exp &&
test_cmp test_parents3L_on2.exp test_parents3L_on2.out &&
$powerman -h $testaddr -T -1 t[4-15] >test_parents3L_on2T.out &&
grep "ancestor off" test_parents3L_on2T.out
grep "cannot perform on, dependency off" test_parents3L_on2T.out
'
test_expect_success 'powerman -q shows all off still' '
$powerman -h $testaddr -q >test_parents3L_query2.out &&
Expand Down Expand Up @@ -665,7 +665,7 @@ test_expect_success 'powerman -1 t[12-15] completes' '
echo Command completed successfully >test_parents3Lbad_on2.exp &&
test_cmp test_parents3Lbad_on2.exp test_parents3Lbad_on2.out &&
$powerman -h $testaddr -T -1 t[12-15] >test_parents3Lbad_on2T.out &&
grep "Node12" test_parents3Lbad_on2T.out | grep "ancestor error"
grep "Node12" test_parents3Lbad_on2T.out | grep "cannot perform on, dependency error"
'
test_expect_success 'powerman -q shows t[0-2,4-11] on, t3 and children unknown' '
$powerman -h $testaddr -q >test_parents3Lbad_query3.out &&
Expand Down

0 comments on commit 00cd6c3

Please sign in to comment.