mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
ctdb-tests: Add database type option for tests
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
parent
d74eb9577d
commit
a388fe1523
@ -55,6 +55,8 @@ static struct poptOption options_database[] = {
|
||||
"Name of database key" },
|
||||
{ "value", 'v', POPT_ARG_STRING, &_values.valuestr, 0,
|
||||
"Value of database key" },
|
||||
{ "dbtype", 'T', POPT_ARG_STRING, &_values.dbtype, 0,
|
||||
"CTDB database type" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@ -84,6 +86,7 @@ static void set_defaults_database(struct test_options *opts)
|
||||
opts->dbname = NULL;
|
||||
opts->keystr = NULL;
|
||||
opts->valuestr = NULL;
|
||||
opts->dbtype = "volatile";
|
||||
}
|
||||
|
||||
static bool verify_options_basic(struct test_options *opts)
|
||||
@ -114,6 +117,12 @@ static bool verify_options_database(struct test_options *opts)
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((strcmp(opts->dbtype, "volatile") != 0) &&
|
||||
(strcmp(opts->dbtype, "persistent") != 0) &&
|
||||
(strcmp(opts->dbtype, "replicated") != 0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ struct test_options {
|
||||
const char *dbname;
|
||||
const char *keystr;
|
||||
const char *valuestr;
|
||||
const char *dbtype;
|
||||
};
|
||||
|
||||
bool process_options_basic(int argc, const char **argv,
|
||||
|
Loading…
Reference in New Issue
Block a user