summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2012-11-22 15:59:04 +1100
committerAlex Gorrod <alexg@wiredtiger.com>2012-11-22 15:59:04 +1100
commit9676c86afceb0fa2cdaac4c97b5f7c6a0475f7b9 (patch)
tree4df4f9bf9985923918e5ae4aa70799594b7f4afe /test
parentcbd566ddf4101d0d30268c9953367505d6e6fe09 (diff)
downloadmongo-9676c86afceb0fa2cdaac4c97b5f7c6a0475f7b9.tar.gz
Add partial implementation for tracking dirty pages in cache.
Diffstat (limited to 'test')
-rw-r--r--test/format/config.c18
-rw-r--r--test/format/config.h6
-rw-r--r--test/format/format.h1
-rw-r--r--test/format/wts.c8
4 files changed, 19 insertions, 14 deletions
diff --git a/test/format/config.c b/test/format/config.c
index c82cb6856f1..dd07d6d2c7c 100644
--- a/test/format/config.c
+++ b/test/format/config.c
@@ -324,23 +324,21 @@ config_single(const char *s, int perm)
++ep;
if (cp->flags & C_STRING) {
- if (strncmp(s, "data_source", strlen("data_source")) == 0) {
- if (strncmp("file", ep, strlen("file")) != 0 &&
- strncmp("table", ep, strlen("table")) != 0 &&
- strncmp("lsm", ep, strlen("lsm")) != 0) {
+ if (strncmp(s, "data_source", strlen("data_source")) == 0 &&
+ strncmp("file", ep, strlen("file")) != 0 &&
+ strncmp("table", ep, strlen("table")) != 0 &&
+ strncmp("lsm", ep, strlen("lsm")) != 0) {
fprintf(stderr,
- "Invalid file type option: %s\n", ep);
+ "Invalid data source option: %s\n", ep);
exit(EXIT_FAILURE);
- }
- *cp->vstr = strdup(ep);
}
- else if (strncmp(s, "file_type", strlen("file_type")) == 0)
+ if (strncmp(s, "file_type", strlen("file_type")) == 0)
*cp->vstr = strdup(
config_file_type(config_translate(ep)));
- else if (strncmp(s, "compression", strlen("compression")) == 0)
+ else
*cp->vstr = strdup(ep);
if (*cp->vstr == NULL)
- syserr("strdup");
+ syserr("Config string parsing");
return;
}
diff --git a/test/format/config.h b/test/format/config.h
index 07751a5a5d5..479cb115bd2 100644
--- a/test/format/config.h
+++ b/test/format/config.h
@@ -76,7 +76,7 @@ static CONFIG c[] = {
{ "cache",
"size of the cache in MB",
- 0, 0, 1, 100, &g.c_cache, NULL },
+ 0, 0, 1, 500, &g.c_cache, NULL },
{ "compression",
"type of compression (none | bzip | ext | snappy)",
@@ -158,6 +158,10 @@ static CONFIG c[] = {
"minimum size of values",
C_ROW|C_VAR, 0, 1, 20, &g.c_value_min, NULL },
+ { "wiredtiger_config",
+ "configuration string used to wiredtiger_open",
+ 0, C_IGNORE|C_STRING, 0, 0, NULL, &g.c_config_open },
+
{ "write_pct",
"percent operations that are writes",
0, C_OPS, 0, 90, &g.c_write_pct, NULL },
diff --git a/test/format/format.h b/test/format/format.h
index 8ac9794cb63..e18b2630b83 100644
--- a/test/format/format.h
+++ b/test/format/format.h
@@ -106,6 +106,7 @@ typedef struct {
u_int c_bitcnt; /* Config values */
u_int c_cache;
char *c_compression;
+ char *c_config_open;
char *c_data_source;
u_int c_delete_pct;
u_int c_dictionary;
diff --git a/test/format/wts.c b/test/format/wts.c
index 24532db56ff..f37e486fece 100644
--- a/test/format/wts.c
+++ b/test/format/wts.c
@@ -70,16 +70,18 @@ wts_open(void)
/*
* Open configuration.
*
- * Put command line configuration options at the end so they override
- * the standard configuration.
+ * Put configuration file configuration options second to last. Put
+ * command line configuration options at the end. Do this so they
+ * override the standard configuration.
*/
snprintf(config, sizeof(config),
"create,error_prefix=\"%s\",cache_size=%" PRIu32 "MB,sync=false,"
- "extensions=[\"%s\",\"%s\", \"%s\"],%s",
+ "extensions=[\"%s\",\"%s\", \"%s\"],%s,%s",
g.progname, g.c_cache,
access(BZIP_PATH, R_OK) == 0 ? BZIP_PATH : "",
access(SNAPPY_PATH, R_OK) == 0 ? SNAPPY_PATH : "",
REVERSE_PATH,
+ g.c_config_open == NULL ? "" : g.c_config_open,
g.config_open == NULL ? "" : g.config_open);
if ((ret =