00001 #include "config.h"
00002
00003 #ifdef HAVE_UNISTD_H
00004 #include <unistd.h>
00005 #endif
00006
00007 #include <iostream>
00008 #include <string>
00009 #include <fstream>
00010 #include <iomanip>
00011 #include <string>
00012 #include <cassert>
00013 #include <algorithm>
00014
00015 #include "asserts.h"
00016 #include "error.h"
00017 #include "fs.h"
00018 #include "rconfig.h"
00019 #include "logger.h"
00020 #include "vaulter.h"
00021 #include "archiver.h"
00022 #include "cataloger.h"
00023 #include "reporter.h"
00024 #include "test-fs-cwd.h"
00025
00026 #define ERR_OUT(e) std::cerr << e
00027
00028
00029 bool make_dir(const std::string& path)
00030 {
00031 bool thrown;
00032 bool value;
00033
00034 thrown = false;
00035 try {
00036 mk_dir(path);
00037 }
00038 catch(...) {
00039 thrown = true;
00040 }
00041
00042 value = (thrown == false);
00043
00044 return(value);
00045 }
00046
00047 void setup(void)
00048 {
00049 std::ofstream out;
00050
00051 assert(make_dir("./test-rvm.dir"));
00052 assert(make_dir("./test-rvm.dir/vault"));
00053 assert(make_dir("./test-rvm.dir/log.dir"));
00054 assert(make_dir("./test-rvm.dir/catalog.dir"));
00055
00056 out.open("./test-rvm.dir/file.conf");
00057 assert(out.is_open());
00058 out << "link-catalog-dir ./test-rvm.dir/catalog.dir" << std::endl;
00059 out << "log-dir ./test-rvm.dir/log.dir" << std::endl;
00060 out << "logging-level rsync" << std::endl;
00061 out << "rsync-local-path " << LOCAL_RSYNC << std::endl;
00062 out << "rsync-parallel 1" << std::endl;
00063 out << "timestamp-resolution second" << std::endl;
00064 out << "vault ./test-rvm.dir/vault" << std::endl;
00065 out << "vault-overflow-behavior quit" << std::endl;
00066 out << "vault-overflow-blocks 0" << std::endl;
00067 out << "vault-overflow-inodes 0" << std::endl;
00068 out << "vault-selection-behavior round-robin" << std::endl;
00069 out << "<job>" << std::endl;
00070 out << " jobname test-job" << std::endl;
00071 out << " archive-path jobname/permutation" << std::endl;
00072 out << " path " << check_cwd << "/" << std::endl;
00073 out << " rsync-connection-type local" << std::endl;
00074 out << " rsync-hardlink true" << std::endl;
00075 out << " rsync-multi-hardlink true" << std::endl;
00076 out << " <rsync-options>" << std::endl;
00077 out << " -a -v --progress --stats" << std::endl;
00078 out << " --exclude '/.svn/'" << std::endl;
00079 out << " --exclude '/.deps/'" << std::endl;
00080 out << " --exclude '/autom4te.cache/'" << std::endl;
00081 out << " --exclude '/test-rvm.dir/'" << std::endl;
00082 out << " </rsync-options>" << std::endl;
00083 out << " rsync-retry-count 3" << std::endl;
00084 out << "</job>" << std::endl;
00085 out.close();
00086 }
00087
00088 void cleanup(void)
00089 {
00090 assert(system("rm -fr ./test-rvm.dir") == 0);
00091 }
00092
00093 bool test_inodes(
00094 const std::string& path1,
00095 const std::string& path2,
00096 const std::string& file
00097 )
00098 {
00099 estring p1, p2;
00100 filestatus f1, f2;
00101 bool r;
00102
00103 p1 = path1;
00104 p1 += "/";
00105 p1 += file;
00106 p1 = reform_path(p1);
00107 f1.path(p1);
00108
00109 p2 = path2;
00110 p2 += "/";
00111 p2 += file;
00112 p2 = reform_path(p2);
00113 f2.path(p2);
00114
00115 r = (f1.inode() == f2.inode());
00116
00117 return(r);
00118 }
00119
00120 void test_rvm(void)
00121 {
00122 std::string local_rsync;
00123 estring adir[4];
00124 int adirc = 0;
00125
00126 local_rsync = LOCAL_RSYNC;
00127 if (local_rsync.size() == 0) {
00128 char const * text[] = {
00129 "",
00130 "NOTICE: Skipping this test",
00131 "",
00132 "This test cannot be run because no local rsync binary was found during",
00133 "configuration. This also means that RVM will be compiled with no",
00134 "default value for the rsync-local-path command.",
00135 "",
00136 "To change this, run the configure script with --with-rsync=<path>,",
00137 "where <path> is the absolute path to the rsync binary.",
00138 "",
00139 0
00140 };
00141 int c;
00142
00143 for (c = 0; text[c] != 0; ++c) {
00144 std::cerr << text[c] << std::endl;
00145 }
00146 return;
00147 }
00148
00149 {
00150 char const * argv[256] = { 0 };
00151 int argc = 0;
00152 bool thrown = false;
00153 subdirectory subdir;
00154 estring dir;
00155
00156 argv[argc++] = "<program>";
00157 argv[argc++] = "--archive";
00158
00159 cataloger.clear();
00160 archiver.clear();
00161 reporter.clear();
00162 vaulter.clear();
00163 logger.clear();
00164 config.clear();
00165
00166 config.default_file("./test-rvm.dir/file.conf");
00167 try {
00168 timer t;
00169
00170 t.start();
00171
00172 config.init(argc, argv);
00173 logger.init();
00174 vaulter.init();
00175 reporter.init();
00176 archiver.init();
00177 archiver.archive();
00178 cataloger.init();
00179 cataloger.catalog();
00180
00181 t.stop();
00182 reporter.set_total_time(t);
00183
00184
00185 reporter.file_report();
00186 logger.clear();
00187
00188
00189 assert(vaulter.vault() == "./test-rvm.dir/vault");
00190
00191 dir = vaulter.vault();
00192 dir += "/";
00193 dir += config.timestamp().str();
00194 dir += "/";
00195 dir += config.jobs()[0].generate_archive_path(check_cwd);
00196 adir[adirc] = dir;
00197
00198 adirc++;
00199
00200
00201
00202 assert(
00203 exists(
00204 config.log_dir()
00205 + static_cast<std::string>("/")
00206 + config.timestamp().str()
00207 + static_cast<std::string>(".log")
00208 )
00209 );
00210 assert(
00211 exists(
00212 config.log_dir()
00213 + static_cast<std::string>("/")
00214 + config.timestamp().str()
00215 + static_cast<std::string>(".report")
00216 )
00217 );
00218
00219 subdir.path(dir);
00220 assert(find(subdir.begin(), subdir.end(), "AUTHORS") != subdir.end());
00221 assert(find(subdir.begin(), subdir.end(), "COPYING") != subdir.end());
00222 assert(find(subdir.begin(), subdir.end(), "INSTALL") != subdir.end());
00223 assert(find(subdir.begin(), subdir.end(), "Makefile") != subdir.end());
00224 assert(find(subdir.begin(), subdir.end(), "Makefile.in") != subdir.end());
00225 assert(find(subdir.begin(), subdir.end(), "README") != subdir.end());
00226 assert(find(subdir.begin(), subdir.end(), "archiver.cc") != subdir.end());
00227 assert(find(subdir.begin(), subdir.end(), "archiver.h") != subdir.end());
00228 assert(find(subdir.begin(), subdir.end(), "config.h") != subdir.end());
00229 assert(find(subdir.begin(), subdir.end(), "config.h.in") != subdir.end());
00230 assert(find(subdir.begin(), subdir.end(), "configure") != subdir.end());
00231 assert(find(subdir.begin(), subdir.end(), "error.cc") != subdir.end());
00232 assert(find(subdir.begin(), subdir.end(), "error.h") != subdir.end());
00233 assert(find(subdir.begin(), subdir.end(), "estring.cc") != subdir.end());
00234 assert(find(subdir.begin(), subdir.end(), "estring.h") != subdir.end());
00235 assert(find(subdir.begin(), subdir.end(), "exec.cc") != subdir.end());
00236 assert(find(subdir.begin(), subdir.end(), "exec.h") != subdir.end());
00237 assert(find(subdir.begin(), subdir.end(), "fs.cc") != subdir.end());
00238 assert(find(subdir.begin(), subdir.end(), "fs.h") != subdir.end());
00239 assert(find(subdir.begin(), subdir.end(), "help.cc") != subdir.end());
00240 assert(find(subdir.begin(), subdir.end(), "help.h") != subdir.end());
00241 assert(find(subdir.begin(), subdir.end(), "logger.cc") != subdir.end());
00242 assert(find(subdir.begin(), subdir.end(), "logger.h") != subdir.end());
00243 assert(find(subdir.begin(), subdir.end(), "make-test-fs-cc") != subdir.end());
00244 assert(find(subdir.begin(), subdir.end(), "rconfig.cc") != subdir.end());
00245 assert(find(subdir.begin(), subdir.end(), "rconfig.h") != subdir.end());
00246 assert(find(subdir.begin(), subdir.end(), "rmath.h") != subdir.end());
00247 assert(find(subdir.begin(), subdir.end(), "rvm.cc") != subdir.end());
00248 assert(find(subdir.begin(), subdir.end(), "rvm.1") != subdir.end());
00249 assert(find(subdir.begin(), subdir.end(), "rvm.1.in") != subdir.end());
00250 assert(find(subdir.begin(), subdir.end(), "test-rvm-001.cc") != subdir.end());
00251 assert(find(subdir.begin(), subdir.end(), "test-error.cc") != subdir.end());
00252 assert(find(subdir.begin(), subdir.end(), "test-estring.cc") != subdir.end());
00253 assert(find(subdir.begin(), subdir.end(), "test-exec.cc") != subdir.end());
00254 assert(find(subdir.begin(), subdir.end(), "test-fs-cwd.cc") != subdir.end());
00255 assert(find(subdir.begin(), subdir.end(), "test-fs.cc") != subdir.end());
00256
00257 assert(find(subdir.begin(), subdir.end(), "test-logger.cc") != subdir.end());
00258
00259 assert(find(subdir.begin(), subdir.end(), "test-rmath.cc") != subdir.end());
00260 assert(find(subdir.begin(), subdir.end(), "test-strfmt.cc") != subdir.end());
00261 assert(find(subdir.begin(), subdir.end(), "test-timer.cc") != subdir.end());
00262 assert(find(subdir.begin(), subdir.end(), "test-tstamp.cc") != subdir.end());
00263 assert(find(subdir.begin(), subdir.end(), "test-types.cc") != subdir.end());
00264 assert(find(subdir.begin(), subdir.end(), "timer.cc") != subdir.end());
00265 assert(find(subdir.begin(), subdir.end(), "timer.h") != subdir.end());
00266 assert(find(subdir.begin(), subdir.end(), "tstamp.cc") != subdir.end());
00267 assert(find(subdir.begin(), subdir.end(), "tstamp.h") != subdir.end());
00268 assert(find(subdir.begin(), subdir.end(), "types.h") != subdir.end());
00269 assert(find(subdir.begin(), subdir.end(), "vaulter.cc") != subdir.end());
00270 assert(find(subdir.begin(), subdir.end(), "vaulter.h") != subdir.end());
00271 }
00272 catch(error e) {
00273 ERR_OUT(e);
00274 thrown = true;
00275 }
00276 catch(...) {
00277 ERR_OUT(err_unknown);
00278 assert(0);
00279 }
00280 assert(!thrown);
00281 }
00282
00283 sleep(2);
00284
00285 {
00286 char const * argv[256] = { 0 };
00287 int argc = 0;
00288 bool thrown = false;
00289 subdirectory subdir;
00290 estring dir;
00291
00292 argv[argc++] = "<program>";
00293 argv[argc++] = "--archive";
00294
00295 cataloger.clear();
00296 archiver.clear();
00297 reporter.clear();
00298 vaulter.clear();
00299 logger.clear();
00300 config.clear();
00301
00302 config.default_file("./test-rvm.dir/file.conf");
00303 try {
00304 timer t;
00305
00306 t.start();
00307
00308 config.init(argc, argv);
00309 logger.init();
00310 vaulter.init();
00311 reporter.init();
00312 archiver.init();
00313 archiver.archive();
00314 estring path;
00315 filestatus fstat1, fstat2;
00316 cataloger.init();
00317 cataloger.catalog();
00318
00319 t.stop();
00320 reporter.set_total_time(t);
00321
00322
00323 reporter.file_report();
00324 logger.clear();
00325
00326
00327 assert(vaulter.vault() == "./test-rvm.dir/vault");
00328
00329 dir = vaulter.vault();
00330 dir += "/";
00331 dir += config.timestamp().str();
00332 dir += "/";
00333 dir += config.jobs()[0].generate_archive_path(check_cwd);
00334 adir[adirc] = dir;
00335
00336 adirc++;
00337
00338
00339
00340 subdir.path(dir);
00341 if (subdir.size() == 0) {
00342 std::string filename;
00343 std::string line;
00344 std::ifstream in;
00345 bool found_usage_error = false;
00346 char line_cstr[2048] = { 0 };
00347 int c;
00348
00349 filename = "./test-rvm.dir/log.dir/";
00350 filename += config.timestamp().str();
00351 filename += ".log";
00352 in.open(filename.c_str());
00353 assert(in.is_open());
00354 while (in.getline(line_cstr,2048)) {
00355 line = line_cstr;
00356 if (line.find("Rsync exit code: [1]") != std::string::npos)
00357 found_usage_error = true;
00358 for (c = 0; c < 2048; line_cstr[c++] = 0);
00359 }
00360 in.close();
00361
00362 if (found_usage_error) {
00363 std::cerr
00364 << "*** NOTICE: One test has failed, the test that uses rsync with"
00365 << std::endl
00366 << " the --hard-links and --link-dest command line"
00367 << std::endl
00368 << " options. Rsync reported a syntax or usage error,"
00369 << std::endl
00370 << " which may indicate that this version of rsync is"
00371 << std::endl
00372 << " old enough to not have these options."
00373 << std::endl
00374 << std::endl
00375 << " In order to be able to hard-link files that have"
00376 << std::endl
00377 << " not changed from one archive to the next, you"
00378 << std::endl
00379 << " will have to upgrade rsync."
00380 << std::endl
00381 ;
00382 }
00383 assert(found_usage_error);
00384 }
00385 else {
00386 assert(find(subdir.begin(), subdir.end(), "AUTHORS") != subdir.end());
00387 assert(find(subdir.begin(), subdir.end(), "COPYING") != subdir.end());
00388 assert(find(subdir.begin(), subdir.end(), "INSTALL") != subdir.end());
00389 assert(find(subdir.begin(), subdir.end(), "Makefile") != subdir.end());
00390 assert(find(subdir.begin(), subdir.end(), "Makefile.in") != subdir.end());
00391 assert(find(subdir.begin(), subdir.end(), "README") != subdir.end());
00392 assert(find(subdir.begin(), subdir.end(), "archiver.cc") != subdir.end());
00393 assert(find(subdir.begin(), subdir.end(), "archiver.h") != subdir.end());
00394 assert(find(subdir.begin(), subdir.end(), "config.h") != subdir.end());
00395 assert(find(subdir.begin(), subdir.end(), "config.h.in") != subdir.end());
00396 assert(find(subdir.begin(), subdir.end(), "configure") != subdir.end());
00397 assert(find(subdir.begin(), subdir.end(), "error.cc") != subdir.end());
00398 assert(find(subdir.begin(), subdir.end(), "error.h") != subdir.end());
00399 assert(find(subdir.begin(), subdir.end(), "estring.cc") != subdir.end());
00400 assert(find(subdir.begin(), subdir.end(), "estring.h") != subdir.end());
00401 assert(find(subdir.begin(), subdir.end(), "exec.cc") != subdir.end());
00402 assert(find(subdir.begin(), subdir.end(), "exec.h") != subdir.end());
00403 assert(find(subdir.begin(), subdir.end(), "fs.cc") != subdir.end());
00404 assert(find(subdir.begin(), subdir.end(), "fs.h") != subdir.end());
00405 assert(find(subdir.begin(), subdir.end(), "help.cc") != subdir.end());
00406 assert(find(subdir.begin(), subdir.end(), "help.h") != subdir.end());
00407 assert(find(subdir.begin(), subdir.end(), "logger.cc") != subdir.end());
00408 assert(find(subdir.begin(), subdir.end(), "logger.h") != subdir.end());
00409 assert(find(subdir.begin(), subdir.end(), "make-test-fs-cc") != subdir.end());
00410 assert(find(subdir.begin(), subdir.end(), "rconfig.cc") != subdir.end());
00411 assert(find(subdir.begin(), subdir.end(), "rconfig.h") != subdir.end());
00412 assert(find(subdir.begin(), subdir.end(), "rmath.h") != subdir.end());
00413 assert(find(subdir.begin(), subdir.end(), "rvm.cc") != subdir.end());
00414 assert(find(subdir.begin(), subdir.end(), "rvm.1") != subdir.end());
00415 assert(find(subdir.begin(), subdir.end(), "rvm.1.in") != subdir.end());
00416 assert(find(subdir.begin(), subdir.end(), "test-rvm-001.cc") != subdir.end());
00417 assert(find(subdir.begin(), subdir.end(), "test-error.cc") != subdir.end());
00418 assert(find(subdir.begin(), subdir.end(), "test-estring.cc") != subdir.end());
00419 assert(find(subdir.begin(), subdir.end(), "test-exec.cc") != subdir.end());
00420 assert(find(subdir.begin(), subdir.end(), "test-fs-cwd.cc") != subdir.end());
00421 assert(find(subdir.begin(), subdir.end(), "test-fs.cc") != subdir.end());
00422
00423 assert(find(subdir.begin(), subdir.end(), "test-logger.cc") != subdir.end());
00424
00425 assert(find(subdir.begin(), subdir.end(), "test-rmath.cc") != subdir.end());
00426 assert(find(subdir.begin(), subdir.end(), "test-strfmt.cc") != subdir.end());
00427 assert(find(subdir.begin(), subdir.end(), "test-timer.cc") != subdir.end());
00428 assert(find(subdir.begin(), subdir.end(), "test-tstamp.cc") != subdir.end());
00429 assert(find(subdir.begin(), subdir.end(), "test-types.cc") != subdir.end());
00430 assert(find(subdir.begin(), subdir.end(), "timer.cc") != subdir.end());
00431 assert(find(subdir.begin(), subdir.end(), "timer.h") != subdir.end());
00432 assert(find(subdir.begin(), subdir.end(), "tstamp.cc") != subdir.end());
00433 assert(find(subdir.begin(), subdir.end(), "tstamp.h") != subdir.end());
00434 assert(find(subdir.begin(), subdir.end(), "types.h") != subdir.end());
00435 assert(find(subdir.begin(), subdir.end(), "vaulter.cc") != subdir.end());
00436 assert(find(subdir.begin(), subdir.end(), "vaulter.h") != subdir.end());
00437
00438 assert(test_inodes(adir[0], adir[1], "AUTHORS"));
00439 }
00440
00441
00442 assert(
00443 exists(
00444 static_cast<std::string>("./test-rvm.dir/catalog.dir/")
00445 + config.timestamp().str()
00446 )
00447 );
00448 }
00449 catch(error e) {
00450 ERR_OUT(e);
00451 thrown = true;
00452 }
00453 catch(...) {
00454 ERR_OUT(err_unknown);
00455 assert(0);
00456 }
00457 assert(!thrown);
00458 }
00459
00460 sleep(2);
00461
00462 {
00463 char const * argv[256] = { 0 };
00464 int argc = 0;
00465 bool thrown = false;
00466 subdirectory subdir;
00467 estring dir;
00468
00469 argv[argc++] = "<program>";
00470 argv[argc++] = "--archive";
00471
00472 cataloger.clear();
00473 archiver.clear();
00474 reporter.clear();
00475 vaulter.clear();
00476 logger.clear();
00477 config.clear();
00478
00479 estring file;
00480 file = adir[1].c_str();
00481 file += "/";
00482 file += "COPYING";
00483 unlink(file.c_str());
00484
00485 config.default_file("./test-rvm.dir/file.conf");
00486 try {
00487 timer t;
00488
00489 t.start();
00490
00491 config.init(argc, argv);
00492 logger.init();
00493 vaulter.init();
00494 reporter.init();
00495 archiver.init();
00496 archiver.archive();
00497 estring path;
00498 filestatus fstat1, fstat2;
00499 cataloger.init();
00500 cataloger.catalog();
00501
00502 t.stop();
00503 reporter.set_total_time(t);
00504
00505
00506 reporter.file_report();
00507 logger.clear();
00508
00509
00510 assert(vaulter.vault() == "./test-rvm.dir/vault");
00511
00512 dir = vaulter.vault();
00513 dir += "/";
00514 dir += config.timestamp().str();
00515 dir += "/";
00516 dir += config.jobs()[0].generate_archive_path(check_cwd);
00517 adir[adirc] = dir;
00518
00519 adirc++;
00520
00521
00522
00523 subdir.path(dir);
00524 if (subdir.size() == 0) {
00525 std::string filename;
00526 std::string line;
00527 std::ifstream in;
00528 bool found_usage_error = false;
00529 char line_cstr[2048] = { 0 };
00530 int c;
00531
00532 filename = "./test-rvm.dir/log.dir/";
00533 filename += config.timestamp().str();
00534 filename += ".log";
00535 in.open(filename.c_str());
00536 assert(in.is_open());
00537 while (in.getline(line_cstr,2048)) {
00538 line = line_cstr;
00539 if (line.find("Rsync exit code: [1]") != std::string::npos)
00540 found_usage_error = true;
00541 for (c = 0; c < 2048; line_cstr[c++] = 0);
00542 }
00543 in.close();
00544
00545 if (found_usage_error) {
00546 std::cerr
00547 << "*** NOTICE: One test has failed, the test that uses rsync with"
00548 << std::endl
00549 << " the --hard-links and --link-dest command line"
00550 << std::endl
00551 << " options. Rsync reported a syntax or usage error,"
00552 << std::endl
00553 << " which may indicate that this version of rsync is"
00554 << std::endl
00555 << " old enough to not have these options."
00556 << std::endl
00557 << std::endl
00558 << " In order to be able to hard-link files that have"
00559 << std::endl
00560 << " not changed from one archive to the next, you"
00561 << std::endl
00562 << " will have to upgrade rsync."
00563 << std::endl
00564 ;
00565 }
00566 assert(found_usage_error);
00567 }
00568 else {
00569 assert(find(subdir.begin(), subdir.end(), "AUTHORS") != subdir.end());
00570 assert(find(subdir.begin(), subdir.end(), "COPYING") != subdir.end());
00571 assert(find(subdir.begin(), subdir.end(), "INSTALL") != subdir.end());
00572 assert(find(subdir.begin(), subdir.end(), "Makefile") != subdir.end());
00573 assert(find(subdir.begin(), subdir.end(), "Makefile.in") != subdir.end());
00574 assert(find(subdir.begin(), subdir.end(), "README") != subdir.end());
00575 assert(find(subdir.begin(), subdir.end(), "archiver.cc") != subdir.end());
00576 assert(find(subdir.begin(), subdir.end(), "archiver.h") != subdir.end());
00577 assert(find(subdir.begin(), subdir.end(), "config.h") != subdir.end());
00578 assert(find(subdir.begin(), subdir.end(), "config.h.in") != subdir.end());
00579 assert(find(subdir.begin(), subdir.end(), "configure") != subdir.end());
00580 assert(find(subdir.begin(), subdir.end(), "error.cc") != subdir.end());
00581 assert(find(subdir.begin(), subdir.end(), "error.h") != subdir.end());
00582 assert(find(subdir.begin(), subdir.end(), "estring.cc") != subdir.end());
00583 assert(find(subdir.begin(), subdir.end(), "estring.h") != subdir.end());
00584 assert(find(subdir.begin(), subdir.end(), "exec.cc") != subdir.end());
00585 assert(find(subdir.begin(), subdir.end(), "exec.h") != subdir.end());
00586 assert(find(subdir.begin(), subdir.end(), "fs.cc") != subdir.end());
00587 assert(find(subdir.begin(), subdir.end(), "fs.h") != subdir.end());
00588 assert(find(subdir.begin(), subdir.end(), "help.cc") != subdir.end());
00589 assert(find(subdir.begin(), subdir.end(), "help.h") != subdir.end());
00590 assert(find(subdir.begin(), subdir.end(), "logger.cc") != subdir.end());
00591 assert(find(subdir.begin(), subdir.end(), "logger.h") != subdir.end());
00592 assert(find(subdir.begin(), subdir.end(), "make-test-fs-cc") != subdir.end());
00593 assert(find(subdir.begin(), subdir.end(), "rconfig.cc") != subdir.end());
00594 assert(find(subdir.begin(), subdir.end(), "rconfig.h") != subdir.end());
00595 assert(find(subdir.begin(), subdir.end(), "rmath.h") != subdir.end());
00596 assert(find(subdir.begin(), subdir.end(), "rvm.cc") != subdir.end());
00597 assert(find(subdir.begin(), subdir.end(), "rvm.1") != subdir.end());
00598 assert(find(subdir.begin(), subdir.end(), "rvm.1.in") != subdir.end());
00599 assert(find(subdir.begin(), subdir.end(), "test-rvm-001.cc") != subdir.end());
00600 assert(find(subdir.begin(), subdir.end(), "test-error.cc") != subdir.end());
00601 assert(find(subdir.begin(), subdir.end(), "test-estring.cc") != subdir.end());
00602 assert(find(subdir.begin(), subdir.end(), "test-exec.cc") != subdir.end());
00603 assert(find(subdir.begin(), subdir.end(), "test-fs-cwd.cc") != subdir.end());
00604 assert(find(subdir.begin(), subdir.end(), "test-fs.cc") != subdir.end());
00605
00606 assert(find(subdir.begin(), subdir.end(), "test-logger.cc") != subdir.end());
00607
00608 assert(find(subdir.begin(), subdir.end(), "test-rmath.cc") != subdir.end());
00609 assert(find(subdir.begin(), subdir.end(), "test-strfmt.cc") != subdir.end());
00610 assert(find(subdir.begin(), subdir.end(), "test-timer.cc") != subdir.end());
00611 assert(find(subdir.begin(), subdir.end(), "test-tstamp.cc") != subdir.end());
00612 assert(find(subdir.begin(), subdir.end(), "test-types.cc") != subdir.end());
00613 assert(find(subdir.begin(), subdir.end(), "timer.cc") != subdir.end());
00614 assert(find(subdir.begin(), subdir.end(), "timer.h") != subdir.end());
00615 assert(find(subdir.begin(), subdir.end(), "tstamp.cc") != subdir.end());
00616 assert(find(subdir.begin(), subdir.end(), "tstamp.h") != subdir.end());
00617 assert(find(subdir.begin(), subdir.end(), "types.h") != subdir.end());
00618 assert(find(subdir.begin(), subdir.end(), "vaulter.cc") != subdir.end());
00619 assert(find(subdir.begin(), subdir.end(), "vaulter.h") != subdir.end());
00620
00621 assert(test_inodes(adir[0], adir[1], "AUTHORS"));
00622 assert(test_inodes(adir[0], adir[2], "AUTHORS"));
00623 assert(test_inodes(adir[0], adir[2], "COPYING"));
00624 }
00625
00626
00627 assert(
00628 exists(
00629 static_cast<std::string>("./test-rvm.dir/catalog.dir/")
00630 + config.timestamp().str()
00631 )
00632 );
00633 }
00634 catch(error e) {
00635 ERR_OUT(e);
00636 thrown = true;
00637 }
00638 catch(...) {
00639 ERR_OUT(err_unknown);
00640 assert(0);
00641 }
00642 assert(!thrown);
00643 }
00644 }
00645
00646 int main(int argc, char const * argv[])
00647 {
00648 cleanup();
00649 setup();
00650 try {
00651 test_rvm();
00652 }
00653 catch(error e) {
00654 std::cerr << e;
00655 assert(0);
00656 }
00657 catch(...) {
00658 std::cerr << err_unknown;
00659 assert(0);
00660 }
00661 cleanup();
00662 return(0);
00663 }
00664