mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-tests: Add dbdir option for creating databases in fake_ctdbd
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
parent
147ff850aa
commit
2de660722d
@ -86,6 +86,7 @@ struct vnn_map {
|
||||
struct database {
|
||||
struct database *prev, *next;
|
||||
const char *name;
|
||||
const char *path;
|
||||
uint32_t id;
|
||||
uint8_t flags;
|
||||
uint64_t seq_num;
|
||||
@ -93,6 +94,7 @@ struct database {
|
||||
|
||||
struct database_map {
|
||||
struct database *db;
|
||||
const char *dbdir;
|
||||
};
|
||||
|
||||
struct fake_control_failure {
|
||||
@ -629,7 +631,8 @@ fail:
|
||||
return false;
|
||||
}
|
||||
|
||||
static struct database_map *dbmap_init(TALLOC_CTX *mem_ctx)
|
||||
static struct database_map *dbmap_init(TALLOC_CTX *mem_ctx,
|
||||
const char *dbdir)
|
||||
{
|
||||
struct database_map *db_map;
|
||||
|
||||
@ -638,6 +641,12 @@ static struct database_map *dbmap_init(TALLOC_CTX *mem_ctx)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
db_map->dbdir = talloc_strdup(db_map, dbdir);
|
||||
if (db_map->dbdir == NULL) {
|
||||
talloc_free(db_map);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return db_map;
|
||||
}
|
||||
|
||||
@ -721,6 +730,11 @@ static bool dbmap_parse(struct database_map *db_map)
|
||||
|
||||
db->id = id;
|
||||
db->name = talloc_steal(db, name);
|
||||
db->path = talloc_asprintf(db, "%s/%s", db_map->dbdir, name);
|
||||
if (db->path == NULL) {
|
||||
talloc_free(db);
|
||||
goto fail;
|
||||
}
|
||||
db->flags = flags;
|
||||
db->seq_num = seq_num;
|
||||
|
||||
@ -936,7 +950,8 @@ static uint32_t new_generation(uint32_t old_generation)
|
||||
return generation;
|
||||
}
|
||||
|
||||
static struct ctdbd_context *ctdbd_setup(TALLOC_CTX *mem_ctx)
|
||||
static struct ctdbd_context *ctdbd_setup(TALLOC_CTX *mem_ctx,
|
||||
const char *dbdir)
|
||||
{
|
||||
struct ctdbd_context *ctdb;
|
||||
char line[1024];
|
||||
@ -963,7 +978,7 @@ static struct ctdbd_context *ctdbd_setup(TALLOC_CTX *mem_ctx)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ctdb->db_map = dbmap_init(ctdb);
|
||||
ctdb->db_map = dbmap_init(ctdb, dbdir);
|
||||
if (ctdb->db_map == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
@ -1414,15 +1429,8 @@ static void control_getdbpath(TALLOC_CTX *mem_ctx,
|
||||
reply.status = ENOENT;
|
||||
reply.errmsg = "Database not found";
|
||||
} else {
|
||||
const char *base;
|
||||
if (db->flags & CTDB_DB_FLAGS_PERSISTENT) {
|
||||
base = "/var/lib/ctdb/persistent";
|
||||
} else {
|
||||
base = "/var/run/ctdb/DB_DIR";
|
||||
}
|
||||
reply.rdata.data.db_path =
|
||||
talloc_asprintf(mem_ctx, "%s/%s.%u",
|
||||
base, db->name, header->destnode);
|
||||
talloc_strdup(mem_ctx, db->path);
|
||||
if (reply.rdata.data.db_path == NULL) {
|
||||
reply.status = ENOMEM;
|
||||
reply.errmsg = "Memory error";
|
||||
@ -3676,18 +3684,23 @@ fail:
|
||||
}
|
||||
|
||||
static struct options {
|
||||
const char *dbdir;
|
||||
const char *sockpath;
|
||||
const char *pidfile;
|
||||
const char *debuglevel;
|
||||
} options;
|
||||
|
||||
static struct poptOption cmdline_options[] = {
|
||||
POPT_AUTOHELP
|
||||
{ "dbdir", 'D', POPT_ARG_STRING, &options.dbdir, 0,
|
||||
"Database directory", "directory" },
|
||||
{ "socket", 's', POPT_ARG_STRING, &options.sockpath, 0,
|
||||
"Unix domain socket path", "filename" },
|
||||
{ "pidfile", 'p', POPT_ARG_STRING, &options.pidfile, 0,
|
||||
"pid file", "filename" } ,
|
||||
{ "debug", 'd', POPT_ARG_STRING, &options.debuglevel, 0,
|
||||
"debug level", "ERR|WARNING|NOTICE|INFO|DEBUG" } ,
|
||||
POPT_TABLEEND
|
||||
};
|
||||
|
||||
static void cleanup(void)
|
||||
@ -3751,6 +3764,12 @@ int main(int argc, const char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (options.dbdir == NULL) {
|
||||
fprintf(stderr, "Please specify database directory\n");
|
||||
poptPrintHelp(pc, stdout, 0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (options.sockpath == NULL) {
|
||||
fprintf(stderr, "Please specify socket path\n");
|
||||
poptPrintHelp(pc, stdout, 0);
|
||||
@ -3776,7 +3795,7 @@ int main(int argc, const char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ctdb = ctdbd_setup(mem_ctx);
|
||||
ctdb = ctdbd_setup(mem_ctx, options.dbdir);
|
||||
if (ctdb == NULL) {
|
||||
exit(1);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ PATH="$PATH:$CTDB_SCRIPTS_TOOLS_HELPER_DIR"
|
||||
|
||||
ctdbd_socket="${TEST_VAR_DIR}/ctdbd.socket.$$"
|
||||
ctdbd_pidfile="${TEST_VAR_DIR}/ctdbd.pid.$$"
|
||||
ctdbd_dbdir="${TEST_VAR_DIR}/ctdbd.db.$$"
|
||||
|
||||
define_test ()
|
||||
{
|
||||
@ -42,14 +43,17 @@ cleanup_ctdbd ()
|
||||
rm -f "$ctdbd_pidfile"
|
||||
fi
|
||||
rm -f "$ctdbd_socket"
|
||||
rm -rf "$ctdbd_dbdir"
|
||||
}
|
||||
|
||||
setup_ctdbd ()
|
||||
{
|
||||
debug "Setting up fake ctdbd"
|
||||
|
||||
mkdir -p "$ctdbd_dbdir"
|
||||
$VALGRIND fake_ctdbd -d "$FAKE_CTDBD_DEBUGLEVEL" \
|
||||
-s "$ctdbd_socket" -p "$ctdbd_pidfile"
|
||||
-s "$ctdbd_socket" -p "$ctdbd_pidfile" \
|
||||
-D "$ctdbd_dbdir"
|
||||
export CTDB_SOCKET="$ctdbd_socket"
|
||||
# This current translates to a 6 second timeout for the
|
||||
# important controls
|
||||
|
@ -22,13 +22,13 @@ EOF
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0 READONLY
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0 STICKY
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb READONLY
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb STICKY
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test
|
||||
|
@ -23,7 +23,7 @@ EOF
|
||||
ok <<EOF
|
||||
dbid: 0x7a19d84d
|
||||
name: locking.tdb
|
||||
path: /var/run/ctdb/DB_DIR/locking.tdb.0
|
||||
path: ${ctdbd_dbdir}/locking.tdb
|
||||
PERSISTENT: no
|
||||
REPLICATED: no
|
||||
STICKY: no
|
||||
@ -35,7 +35,7 @@ simple_test 0x7a19d84d
|
||||
ok <<EOF
|
||||
dbid: 0x4e66c2b2
|
||||
name: brlock.tdb
|
||||
path: /var/run/ctdb/DB_DIR/brlock.tdb.0
|
||||
path: ${ctdbd_dbdir}/brlock.tdb
|
||||
PERSISTENT: no
|
||||
REPLICATED: no
|
||||
STICKY: yes
|
||||
@ -47,7 +47,7 @@ simple_test 0x4e66c2b2
|
||||
ok <<EOF
|
||||
dbid: 0x4d2a432b
|
||||
name: g_lock.tdb
|
||||
path: /var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
path: ${ctdbd_dbdir}/g_lock.tdb
|
||||
PERSISTENT: no
|
||||
REPLICATED: no
|
||||
STICKY: no
|
||||
@ -59,7 +59,7 @@ simple_test 0x4d2a432b
|
||||
ok <<EOF
|
||||
dbid: 0x7132c184
|
||||
name: secrets.tdb
|
||||
path: /var/lib/ctdb/persistent/secrets.tdb.0
|
||||
path: ${ctdbd_dbdir}/secrets.tdb
|
||||
PERSISTENT: yes
|
||||
REPLICATED: no
|
||||
STICKY: no
|
||||
@ -71,7 +71,7 @@ simple_test 0x7132c184
|
||||
ok <<EOF
|
||||
dbid: 0x6cf2837d
|
||||
name: registry.tdb
|
||||
path: /var/lib/ctdb/persistent/registry.tdb.0
|
||||
path: ${ctdbd_dbdir}/registry.tdb
|
||||
PERSISTENT: yes
|
||||
REPLICATED: no
|
||||
STICKY: no
|
||||
@ -83,7 +83,7 @@ simple_test 0x6cf2837d
|
||||
ok <<EOF
|
||||
dbid: 0xbc57b384
|
||||
name: ctdb-ip.tdb
|
||||
path: /var/run/ctdb/DB_DIR/ctdb-ip.tdb.0
|
||||
path: ${ctdbd_dbdir}/ctdb-ip.tdb
|
||||
PERSISTENT: no
|
||||
REPLICATED: yes
|
||||
STICKY: no
|
||||
@ -95,7 +95,7 @@ simple_test 0xbc57b384
|
||||
ok <<EOF
|
||||
dbid: 0xbec75f0b
|
||||
name: ctdb-conn.tdb
|
||||
path: /var/run/ctdb/DB_DIR/ctdb-conn.tdb.0
|
||||
path: ${ctdbd_dbdir}/ctdb-conn.tdb
|
||||
PERSISTENT: no
|
||||
REPLICATED: yes
|
||||
STICKY: no
|
||||
|
@ -23,7 +23,7 @@ EOF
|
||||
ok <<EOF
|
||||
dbid: 0x7a19d84d
|
||||
name: locking.tdb
|
||||
path: /var/run/ctdb/DB_DIR/locking.tdb.1
|
||||
path: ${ctdbd_dbdir}/locking.tdb
|
||||
PERSISTENT: no
|
||||
REPLICATED: no
|
||||
STICKY: no
|
||||
@ -35,7 +35,7 @@ simple_test locking.tdb -n 1
|
||||
ok <<EOF
|
||||
dbid: 0x4e66c2b2
|
||||
name: brlock.tdb
|
||||
path: /var/run/ctdb/DB_DIR/brlock.tdb.1
|
||||
path: ${ctdbd_dbdir}/brlock.tdb
|
||||
PERSISTENT: no
|
||||
REPLICATED: no
|
||||
STICKY: yes
|
||||
@ -47,7 +47,7 @@ simple_test brlock.tdb -n 1
|
||||
ok <<EOF
|
||||
dbid: 0x4d2a432b
|
||||
name: g_lock.tdb
|
||||
path: /var/run/ctdb/DB_DIR/g_lock.tdb.1
|
||||
path: ${ctdbd_dbdir}/g_lock.tdb
|
||||
PERSISTENT: no
|
||||
REPLICATED: no
|
||||
STICKY: no
|
||||
@ -59,7 +59,7 @@ simple_test g_lock.tdb -n 1
|
||||
ok <<EOF
|
||||
dbid: 0x7132c184
|
||||
name: secrets.tdb
|
||||
path: /var/lib/ctdb/persistent/secrets.tdb.1
|
||||
path: ${ctdbd_dbdir}/secrets.tdb
|
||||
PERSISTENT: yes
|
||||
REPLICATED: no
|
||||
STICKY: no
|
||||
@ -71,7 +71,7 @@ simple_test secrets.tdb -n 1
|
||||
ok <<EOF
|
||||
dbid: 0x6cf2837d
|
||||
name: registry.tdb
|
||||
path: /var/lib/ctdb/persistent/registry.tdb.1
|
||||
path: ${ctdbd_dbdir}/registry.tdb
|
||||
PERSISTENT: yes
|
||||
REPLICATED: no
|
||||
STICKY: no
|
||||
@ -83,7 +83,7 @@ simple_test registry.tdb -n 1
|
||||
ok <<EOF
|
||||
dbid: 0xbc57b384
|
||||
name: ctdb-ip.tdb
|
||||
path: /var/run/ctdb/DB_DIR/ctdb-ip.tdb.1
|
||||
path: ${ctdbd_dbdir}/ctdb-ip.tdb
|
||||
PERSISTENT: no
|
||||
REPLICATED: yes
|
||||
STICKY: no
|
||||
@ -95,7 +95,7 @@ simple_test ctdb-ip.tdb -n 1
|
||||
ok <<EOF
|
||||
dbid: 0xbec75f0b
|
||||
name: ctdb-conn.tdb
|
||||
path: /var/run/ctdb/DB_DIR/ctdb-conn.tdb.1
|
||||
path: ${ctdbd_dbdir}/ctdb-conn.tdb
|
||||
PERSISTENT: no
|
||||
REPLICATED: yes
|
||||
STICKY: no
|
||||
|
@ -25,13 +25,13 @@ simple_test 0x7a19d84d
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0 READONLY
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb READONLY
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
@ -41,13 +41,13 @@ simple_test 0x7a19d84d
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0 READONLY
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb READONLY
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
|
@ -25,13 +25,13 @@ simple_test locking.tdb
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0 READONLY
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb READONLY
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
|
@ -27,13 +27,13 @@ simple_test secrets.tdb
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
|
@ -25,13 +25,13 @@ simple_test locking.tdb
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0 STICKY READONLY
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb STICKY READONLY
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
|
@ -27,13 +27,13 @@ simple_test ctdb-ip.tdb
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
|
@ -25,13 +25,13 @@ simple_test 0x4e66c2b2
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0 STICKY
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb STICKY
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
@ -41,13 +41,13 @@ simple_test 0x4e66c2b2
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0 STICKY
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb STICKY
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
|
@ -25,13 +25,13 @@ simple_test brlock.tdb
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0 STICKY
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb STICKY
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
|
@ -27,13 +27,13 @@ simple_test secrets.tdb
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
|
@ -25,13 +25,13 @@ simple_test brlock.tdb
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0 STICKY READONLY
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb STICKY READONLY
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
|
@ -27,13 +27,13 @@ simple_test ctdb-ip.tdb
|
||||
|
||||
ok <<EOF
|
||||
Number of databases:7
|
||||
dbid:0x7a19d84d name:locking.tdb path:/var/run/ctdb/DB_DIR/locking.tdb.0
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:/var/run/ctdb/DB_DIR/brlock.tdb.0
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:/var/run/ctdb/DB_DIR/g_lock.tdb.0
|
||||
dbid:0x7132c184 name:secrets.tdb path:/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:/var/run/ctdb/DB_DIR/ctdb-ip.tdb.0 REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:/var/run/ctdb/DB_DIR/ctdb-conn.tdb.0 REPLICATED
|
||||
dbid:0x7a19d84d name:locking.tdb path:${ctdbd_dbdir}/locking.tdb
|
||||
dbid:0x4e66c2b2 name:brlock.tdb path:${ctdbd_dbdir}/brlock.tdb
|
||||
dbid:0x4d2a432b name:g_lock.tdb path:${ctdbd_dbdir}/g_lock.tdb
|
||||
dbid:0x7132c184 name:secrets.tdb path:${ctdbd_dbdir}/secrets.tdb PERSISTENT
|
||||
dbid:0x6cf2837d name:registry.tdb path:${ctdbd_dbdir}/registry.tdb PERSISTENT
|
||||
dbid:0xbc57b384 name:ctdb-ip.tdb path:${ctdbd_dbdir}/ctdb-ip.tdb REPLICATED
|
||||
dbid:0xbec75f0b name:ctdb-conn.tdb path:${ctdbd_dbdir}/ctdb-conn.tdb REPLICATED
|
||||
EOF
|
||||
|
||||
simple_test_other getdbmap
|
||||
|
@ -13,6 +13,7 @@ fi
|
||||
|
||||
ctdbd_socket="${CTDB_BASE}/ctdbd.socket"
|
||||
ctdbd_pidfile="${CTDB_BASE}/ctdbd.pid"
|
||||
ctdbd_dbdir="${CTDB_BASE}/ctdbd.db"
|
||||
|
||||
define_test ()
|
||||
{
|
||||
@ -48,14 +49,17 @@ cleanup_ctdbd ()
|
||||
rm -f "$ctdbd_pidfile"
|
||||
fi
|
||||
rm -f "$ctdbd_socket"
|
||||
rm -rf "$ctdbd_dbdir"
|
||||
}
|
||||
|
||||
setup_ctdbd ()
|
||||
{
|
||||
echo "Setting up fake ctdbd"
|
||||
|
||||
mkdir -p "$ctdbd_dbdir"
|
||||
$VALGRIND fake_ctdbd -d "$FAKE_CTDBD_DEBUGLEVEL" \
|
||||
-s "$ctdbd_socket" -p "$ctdbd_pidfile"
|
||||
-s "$ctdbd_socket" -p "$ctdbd_pidfile" \
|
||||
-D "$ctdbd_dbdir"
|
||||
# Wait till fake_ctdbd is running
|
||||
wait_until 10 test -S "$ctdbd_socket" || \
|
||||
die "fake_ctdbd failed to start"
|
||||
|
Loading…
Reference in New Issue
Block a user