Skip to content

Commit

Permalink
Merge pull request #160 from chu11/redfishpower_refactor_plugnames
Browse files Browse the repository at this point in the history
redfishpower: refactor internals to use plugs
  • Loading branch information
mergify[bot] authored Mar 14, 2024
2 parents 7d62cad + 974a308 commit a28d07b
Show file tree
Hide file tree
Showing 8 changed files with 589 additions and 248 deletions.
16 changes: 8 additions & 8 deletions man/redfishpower.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ Set extra HEADER to use. Do not specify data to clear.
Set path to obtain power status.
.TP
.I "setonpath <path> [postdata]"
Set path and optional post data to turn on node.
Set path and optional post data to turn on plug.
.TP
.I "setoffpath <path> [postdata]"
Set path and optional post data to turn off node.
Set path and optional post data to turn off plug.
.TP
.I "settimeout <seconds>"
Set command timeout in seconds.
.TP
.I "stat [nodes]"
Get power status of all nodes or specified subset of nodes.
.I "stat [plugs]"
Get power status of all plugs or specified subset of plugs.
.TP
.I "on [nodes]"
Turn on all nodes or specified subset of nodes. Will return "ok" after confirmation "on" has completed.
.I "on [plugs]"
Turn on all plugs or specified subset of plugs. Will return "ok" after confirmation "on" has completed.
.TP
.I "off [nodes]"
Turn off all nodes or specified subset of nodes. Will return "ok" after confirmation "off" has completed.
.I "off [plugs]"
Turn off all plugs or specified subset of plugs. Will return "ok" after confirmation "off" has completed.

.SH "UPDATING REDFISHPOWER DEVICE FILES"
.LP
Expand Down
36 changes: 18 additions & 18 deletions src/libcommon/test/argv.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,49 @@
int
main(int argc, char *argv[])
{
char **av;
char **av;

plan(NO_PLAN);
plan(NO_PLAN);

av = argv_create("foo bar baz", "");
ok (av != NULL,
av = argv_create("foo bar baz", "");
ok (av != NULL,
"argv_create foo bar baz works");
ok (argv_length(av) == 3,
"argv_length returns 3");
av = argv_append(av, "bonk");
av = argv_append(av, "bonk");
ok (argv_length(av) == 4,
"argv_length returns 4");
is (av[0], "foo",
"first arg is foo");
is (av[1], "bar",
is (av[1], "bar",
"second arg is bar");
is (av[2], "baz",
"third arg is baz");
is (av[3], "bonk",
"fourth arg is bonk");
ok (av[4] == NULL,
"vector is NULL terminated");
argv_destroy(av);
argv_destroy(av);

av = argv_create("a,b:c d", ",:");
ok (av != NULL,
av = argv_create("a,b:c d", ",:");
ok (av != NULL,
"argv_create a,:c d with , and : separators works");
ok (argv_length(av) == 4,
ok (argv_length(av) == 4,
"argv_length is 4");
is (av[0], "a",
is (av[0], "a",
"first arg is a");
is (av[1], "b",
is (av[1], "b",
"second arg is b");
is (av[2], "c",
is (av[2], "c",
"third arg is c");
is (av[3], "d",
is (av[3], "d",
"fourth arg is d");
ok (av[4] == NULL,
ok (av[4] == NULL,
"vector is null terminated");
argv_destroy(av);
argv_destroy(av);

done_testing();
exit(0);
done_testing();
exit(0);
}

// vi:ts=4 sw=4 expandtab
Loading

0 comments on commit a28d07b

Please sign in to comment.