HomeFreeBSD

MFC r317290,r317291,r317292,r317293,r317294,r317295,r317304,r317306,r317307…

Description

MFC r317290,r317291,r317292,r317293,r317294,r317295,r317304,r317306,r317307,r317308,r317309:

r317290:

Fix -Wimplicit-function-declaration compilation warning by moving libgeom.h
#include below the stdio.h #include.

gctl_dump(3) needs stdio.h, per reasoning noted in r317289.

PR: 218809

r317291:

Rename gctl.t to gctl_test.t and test.c to gctl_test_helper.c

This is being done to reduce ambiguity and to make the tests more portable
in the future to other locations in the source tree.

r317292:

gctl_test.t: use make to compile gctl_test_helper instead of calling cc directly

r317293:

gctl_test_helper: apply polish

  • Staticize variables to fix warnings.
  • Sprinkle asserts around for calls that can fail
  • Apply style(9) for main(..) definition.
  • ANSIify usage(..) definition.

r317294:

Bump WARNS to 6 per previous commits which fixed warnings

Tested with: clang (4.0), gcc (4.2.1, 6.3.0)

r317295:

The GPT class no longer exists; use the PART class instead

r317304:

gctl_test_helper: add diagnostic output for parse_retval(..)

This will help end-users better diagnose issues with the function.

r317306:

gctl_test.t: minor tweaks

  • Declare $count with the my scope operator to permit use strict.
  • Add use strict.
  • Use use warnings instead of using -w in the shebang.
  • Don't unlink $cmd when done (prevents unnecessary rebuilding).
  • Improve the error message when running with insufficient permissions, e.g., non-root.

r317307:

Use verb=delete not verb=remove

The remove verb hasn't been present in geom_part*(4) for well
over a decade, if ever. I couldn't find any references to it in
^/stable/5 at least, which is around the timeframe that this test
was written.

r317308:

gctl_test.t: more tweaks to try and update the code and get it functional (again?)

  • Make the logfile for $out be built off the basename for $cmd, instead of $cmd. (r317292 broke this assumption).
  • Rename $mntpt to $mntpt_prefix for clarity, as this variable is a prefix for mountpoints.
  • Reindent the umount directive block while here to match the rest of the code.

r317309:

gctl_test.t: improve error reporting with mdcfg and mount directives

If the commands had failed previously, it would press on and result in a
series of cascading failures. Fail early and continue on to the next case
instead of executing additional commands after a previously failed series
of steps.

Details

Provenance
ngieAuthored on
Parents
rS319013: MFC r317290,r317291,r317292,r317293,r317294,r317295,r317304,r317306,r317307…
Branches
Unknown
Tags
Unknown