summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSusan LoVerso <sue@mongodb.com>2016-03-17 10:39:32 -0400
committerSusan LoVerso <sue@mongodb.com>2016-03-17 10:39:32 -0400
commit20b1a6ed80bd342a957c91acd090760de6ba3d24 (patch)
tree89c6489f083f811822650e4480e9c922f7e7b676
parentd5a67f2c0f84527a8db92ad17204be02f314366b (diff)
downloadmongo-20b1a6ed80bd342a957c91acd090760de6ba3d24.tar.gz
WT-2497 Create second backup copy.
-rw-r--r--test/format/backup.c7
-rw-r--r--test/format/format.h1
-rw-r--r--test/format/util.c14
3 files changed, 18 insertions, 4 deletions
diff --git a/test/format/backup.c b/test/format/backup.c
index 56657940514..2b1463bd0e3 100644
--- a/test/format/backup.c
+++ b/test/format/backup.c
@@ -67,6 +67,13 @@ copy_file(const char *name)
"cp %s/%s %s/%s", g.home, name, g.home_backup, name);
testutil_checkfmt(system(cmd), "backup copy: %s", cmd);
free(cmd);
+
+ len = strlen(g.home) + strlen(g.home_backup2) + strlen(name) * 2 + 20;
+ cmd = dmalloc(len);
+ (void)snprintf(cmd, len,
+ "cp %s/%s %s/%s", g.home, name, g.home_backup2, name);
+ testutil_checkfmt(system(cmd), "backup copy: %s", cmd);
+ free(cmd);
}
/*
diff --git a/test/format/format.h b/test/format/format.h
index c54fd061736..a129c5395fd 100644
--- a/test/format/format.h
+++ b/test/format/format.h
@@ -109,6 +109,7 @@ typedef struct {
char *home; /* Home directory */
char *home_backup; /* Hot-backup directory */
+ char *home_backup2; /* Saved Hot-backup directory */
char *home_backup_init; /* Initialize backup command */
char *home_bdb; /* BDB directory */
char *home_config; /* Run CONFIG file path */
diff --git a/test/format/util.c b/test/format/util.c
index 347b2ea1db3..2e4c869366c 100644
--- a/test/format/util.c
+++ b/test/format/util.c
@@ -310,6 +310,10 @@ path_setup(const char *home)
g.home_backup = dmalloc(len);
snprintf(g.home_backup, len, "%s/%s", g.home, "BACKUP");
+ len = strlen(g.home) + strlen("BACKUP2") + 2;
+ g.home_backup2 = dmalloc(len);
+ snprintf(g.home_backup2, len, "%s/%s", g.home, "BACKUP2");
+
/* BDB directory. */
len = strlen(g.home) + strlen("bdb") + 2;
g.home_bdb = dmalloc(len);
@@ -340,13 +344,15 @@ path_setup(const char *home)
/* Backup directory initialize command, remove and re-create it. */
#undef CMD
#ifdef _WIN32
-#define CMD "del /s /q >:nul && mkdir %s"
+#define CMD "del /s /q >:nul && mkdir %s %s"
#else
-#define CMD "rm -rf %s && mkdir %s"
+#define CMD "rm -rf %s %s && mkdir %s %s"
#endif
- len = strlen(g.home_backup) * 2 + strlen(CMD) + 1;
+ len = strlen(g.home_backup) * 2 +
+ strlen(g.home_backup2) * 2 + strlen(CMD) + 1;
g.home_backup_init = dmalloc(len);
- snprintf(g.home_backup_init, len, CMD, g.home_backup, g.home_backup);
+ snprintf(g.home_backup_init, len, CMD, g.home_backup, g.home_backup2,
+ g.home_backup, g.home_backup2);
/*
* Salvage command, save the interesting files so we can replay the