diff options
author | marcel <marcel@FreeBSD.org> | 2005-09-19 06:51:57 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2005-09-19 06:51:57 +0000 |
commit | d94a6a6215e73e7d38d961419dd075d70e9ed70d (patch) | |
tree | 49b8379eeccfc18dce34f7d08a3f0477058da962 /tools/regression/geom_gpt/test.c | |
parent | e4930c9f7b08966fb21684ecaa7030fce17409f3 (diff) | |
download | FreeBSD-src-d94a6a6215e73e7d38d961419dd075d70e9ed70d.zip FreeBSD-src-d94a6a6215e73e7d38d961419dd075d70e9ed70d.tar.gz |
o Extend the suite to run more than just the driver. We need to run
mdconfig(8), because we need a disk to work on.
o Extend the number of tests now that we have a disk.
o Simplify the driver. All parameters are ASCII strings now.
Diffstat (limited to 'tools/regression/geom_gpt/test.c')
-rw-r--r-- | tools/regression/geom_gpt/test.c | 52 |
1 files changed, 8 insertions, 44 deletions
diff --git a/tools/regression/geom_gpt/test.c b/tools/regression/geom_gpt/test.c index 4b092d5..0cb0b30 100644 --- a/tools/regression/geom_gpt/test.c +++ b/tools/regression/geom_gpt/test.c @@ -59,58 +59,18 @@ parse(char *arg, char **param, char **value) return (0); } -static int -add_int32(struct gctl_req *req, char *arg) -{ - char *param, *nptr, *endptr; - uint32_t value; - int error; - - error = parse(arg, ¶m, &nptr); - if (error) - return (error); - if (nptr == NULL) - return (EINVAL); - value = strtol(nptr, &endptr, 0); - if (*endptr) - return (EINVAL); - gctl_ro_param(req, param, sizeof(value), &value); - return (0); -} - -static int -add_string(struct gctl_req *req, char *arg) -{ - char *param, *value; - int error; - - error = parse(arg, ¶m, &value); - if (error) - return (error); - if (value == NULL) - return (EINVAL); - - gctl_ro_param(req, param, -1, value); - return (0); -} - int main(int argc, char *argv[]) { struct gctl_req *req; + char *param, *value; const char *s; int c; req = gctl_get_handle(); gctl_ro_param(req, "class", -1, "GPT"); - while ((c = getopt(argc, argv, "4:s:v")) != -1) { + while ((c = getopt(argc, argv, "v")) != -1) { switch (c) { - case '4': /* uint32_t */ - add_int32(req, optarg); - break; - case 's': /* string */ - add_string(req, optarg); - break; case 'v': verbose = 1; break; @@ -121,8 +81,12 @@ int main(int argc, char *argv[]) break; } } - if (argc != optind) - usage(); + + while (optind < argc) { + parse(argv[optind++], ¶m, &value); + if (value != NULL) + gctl_ro_param(req, param, -1, value); + } if (verbose) gctl_dump(req, stdout); |