Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redfishpower: add more details on hierarchy errors #174

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading