35 return(thrown ==
false);
40 assert(system(
"rm -fr ./test-rconfig.dir") == 0);
47 assert(
make_dir(
"./test-rconfig.dir"));
48 assert(
make_dir(
"./test-rconfig.dir/catalog.dir"));
49 assert(
make_dir(
"./test-rconfig.dir/log.dir"));
50 assert(
make_dir(
"./test-rconfig.dir/vaults"));
51 assert(
make_dir(
"./test-rconfig.dir/vaults/vault-1"));
52 assert(
make_dir(
"./test-rconfig.dir/vaults/vault-2"));
53 assert(
make_dir(
"./test-rconfig.dir/vaults/vault-3"));
54 assert(
make_dir(
"./test-rconfig.dir/excludes.dir"));
56 out.open(
"./test-rconfig.dir/excludes.dir/excludes.group-A.file-1");
57 assert(out.is_open());
59 out.open(
"./test-rconfig.dir/excludes.dir/excludes.group-A.file-2");
60 assert(out.is_open());
62 out.open(
"./test-rconfig.dir/excludes.dir/excludes.group-A.file-3");
63 assert(out.is_open());
65 out.open(
"./test-rconfig.dir/excludes.dir/excludes.group-B.file-1");
66 assert(out.is_open());
68 out.open(
"./test-rconfig.dir/excludes.dir/excludes.group-B.file-2");
69 assert(out.is_open());
75 assert(
make_dir(
"./test-rconfig.dir/nonexistent"));
76 out.open(
"./test-rconfig.dir/nonexistent/default.conf");
77 out <<
"include nonexistent-file.conf" << std::endl;
78 assert(out.is_open());
84 assert(
make_dir(
"./test-rconfig.dir/global-include.dir"));
86 out.open(
"./test-rconfig.dir/global-include.dir/file-1.conf");
87 assert(out.is_open());
88 out <<
"include nonexistent-file.conf" << std::endl;
91 out.open(
"./test-rconfig.dir/global-include.dir/file-2.conf");
92 assert(out.is_open());
93 out <<
"include file-2.1.conf" << std::endl;
96 out.open(
"./test-rconfig.dir/global-include.dir/file-2.1.conf");
97 assert(out.is_open());
98 out <<
"include file-2.2.conf" << std::endl;
101 out.open(
"./test-rconfig.dir/global-include.dir/file-3.conf");
102 assert(out.is_open());
103 out <<
"include file-3.1.conf" << std::endl;
104 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
105 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
108 out.open(
"./test-rconfig.dir/global-include.dir/file-3.1.conf");
109 assert(out.is_open());
110 out <<
"include file-3.2.conf";
113 out.open(
"./test-rconfig.dir/global-include.dir/file-3.2.conf");
114 assert(out.is_open());
117 out.open(
"./test-rconfig.dir/global-include.dir/file-4.conf");
118 assert(out.is_open());
119 out <<
"include file-4.1.conf" << std::endl;
122 out.open(
"./test-rconfig.dir/global-include.dir/file-4.1.conf");
123 assert(out.is_open());
126 out <<
"include file-4.2.conf" << std::endl;
129 out.open(
"./test-rconfig.dir/global-include.dir/file-4.2.conf");
130 assert(out.is_open());
132 out <<
"include " << std::endl;
135 out.open(
"./test-rconfig.dir/global-include.dir/file-5.conf");
136 assert(out.is_open());
137 out <<
"include file-5.1.conf" << std::endl;
140 out.open(
"./test-rconfig.dir/global-include.dir/file-5.1.conf");
141 assert(out.is_open());
144 out <<
"include file-5.2.conf" << std::endl;
147 out.open(
"./test-rconfig.dir/global-include.dir/file-5.2.conf");
148 assert(out.is_open());
150 out <<
"include file-5.conf" << std::endl;
153 out.open(
"./test-rconfig.dir/global-include.dir/file-6.conf");
154 assert(out.is_open());
155 out <<
"# This is a comment" << std::endl;
156 out <<
"# include" << std::endl;
157 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
158 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
161 out.open(
"./test-rconfig.dir/global-include.dir/file-7.conf");
162 assert(out.is_open());
163 out <<
"include file-7.dir/file-7.1.conf" << std::endl;
166 assert(
make_dir(
"./test-rconfig.dir/global-include.dir/file-7.dir"));
168 out.open(
"./test-rconfig.dir/global-include.dir/file-7.dir/file-7.1.conf");
169 assert(out.is_open());
170 out <<
"include ../file-7.2.conf" << std::endl;
173 out.open(
"./test-rconfig.dir/global-include.dir/file-7.2.conf");
174 assert(out.is_open());
175 out <<
"include file-7.dir/dir.2/*" << std::endl;
178 assert(
make_dir(
"./test-rconfig.dir/global-include.dir/file-7.dir/dir.2"));
180 out.open(
"./test-rconfig.dir/global-include.dir/file-7.dir/dir.2/file-7.3.1.conf");
181 assert(out.is_open());
184 out.open(
"./test-rconfig.dir/global-include.dir/file-7.dir/dir.2/file-7.3.2.conf");
185 assert(out.is_open());
188 out.open(
"./test-rconfig.dir/global-include.dir/file-7.dir/dir.2/file-7.3.3.conf");
189 assert(out.is_open());
192 out.open(
"./test-rconfig.dir/global-include.dir/file-7.dir/dir.2/file-7.3.4.conf");
193 assert(out.is_open());
194 out <<
"include ../../nonexistent-file.conf" << std::endl;
202 assert(
make_dir(
"./test-rconfig.dir/job-include.dir"));
204 out.open(
"./test-rconfig.dir/job-include.dir/file-1.conf");
205 assert(out.is_open());
206 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
207 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
208 out <<
"<default>" << std::endl;
209 out <<
" path /var/spool" << std::endl;
210 out <<
"</default>" << std::endl;
212 out <<
"<job>" << std::endl;
213 out <<
" hostname host-A" << std::endl;
214 out <<
"</job>" << std::endl;
215 out <<
"include file-1.job-1.job" << std::endl;
216 out <<
"include-job file-1.job-2.job" << std::endl;
219 out.open(
"./test-rconfig.dir/job-include.dir/file-1.job-1.job");
220 assert(out.is_open());
221 out <<
"<job>" << std::endl;
222 out <<
" include file-1.job-1.2.job" << std::endl;
223 out <<
"</job>" << std::endl;
226 out.open(
"./test-rconfig.dir/job-include.dir/file-1.job-1.2.job");
227 assert(out.is_open());
228 out <<
"hostname host-B" << std::endl;
231 out.open(
"./test-rconfig.dir/job-include.dir/file-1.job-2.job");
232 assert(out.is_open());
233 out <<
"hostname host-C" << std::endl;
239 assert(
make_dir(
"./test-rconfig.dir/global-link-catalog-dir.dir"));
241 out.open(
"./test-rconfig.dir/global-link-catalog-dir.dir/file-1.conf");
242 assert(out.is_open());
243 out <<
"link-catalog-dir ./test-rconfig.dir/dne-catalog.dir" << std::endl;
246 out.open(
"./test-rconfig.dir/global-link-catalog-dir.dir/file-2.conf");
247 assert(out.is_open());
248 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
249 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
250 out <<
"link-catalog-dir ./test-rconfig.dir/catalog.dir" << std::endl;
253 out.open(
"./test-rconfig.dir/global-link-catalog-dir.dir/file-3.conf");
254 assert(out.is_open());
255 out <<
"link-catalog-dir ./test-rconfig.dir/global-link-catalog-dir.dir/file-1.conf" << std::endl;
261 assert(
make_dir(
"./test-rconfig.dir/global-log-dir.dir"));
263 out.open(
"./test-rconfig.dir/global-log-dir.dir/file-1.conf");
264 assert(out.is_open());
265 out <<
"log-dir ./test-rconfig.dir/dne-log.dir" << std::endl;
268 out.open(
"./test-rconfig.dir/global-log-dir.dir/file-2.conf");
269 assert(out.is_open());
270 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
271 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
274 out.open(
"./test-rconfig.dir/global-log-dir.dir/file-3.conf");
275 assert(out.is_open());
276 out <<
"log-dir ./test-rconfig.dir/global-log-dir.dir/file-1.conf" << std::endl;
282 assert(
make_dir(
"./test-rconfig.dir/global-rsync-local-path.dir"));
284 out.open(
"./test-rconfig.dir/global-rsync-local-path.dir/file-1.conf");
285 assert(out.is_open());
287 <<
"rsync-local-path ./test-rconfig.dir/global-rsync-local-path.dir/nonexistent-path"
291 out.open(
"./test-rconfig.dir/global-rsync-local-path.dir/file-2.conf");
292 assert(out.is_open());
293 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
294 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
296 <<
"rsync-local-path "
297 <<
"./test-rconfig.dir/global-rsync-local-path.dir/file-1.conf"
304 assert(
make_dir(
"./test-rconfig.dir/global-rsync-parallel.dir"));
306 out.open(
"./test-rconfig.dir/global-rsync-parallel.dir/file-1.conf");
307 assert(out.is_open());
308 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
309 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
310 out <<
"rsync-parallel 0" << std::endl;
313 out.open(
"./test-rconfig.dir/global-rsync-parallel.dir/file-2.conf");
314 assert(out.is_open());
315 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
316 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
317 out <<
"rsync-parallel 2" << std::endl;
320 out.open(
"./test-rconfig.dir/global-rsync-parallel.dir/file-3.conf");
321 assert(out.is_open());
322 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
323 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
324 out <<
"rsync-parallel 100" << std::endl;
327 out.open(
"./test-rconfig.dir/global-rsync-parallel.dir/file-4.conf");
328 assert(out.is_open());
329 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
330 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
331 out <<
"rsync-parallel abc" << std::endl;
337 assert(
make_dir(
"./test-rconfig.dir/global-timestamp-resolution.dir"));
339 out.open(
"./test-rconfig.dir/global-timestamp-resolution.dir/file-1.conf");
340 assert(out.is_open());
341 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
342 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
343 out <<
"timestamp-resolution month" << std::endl;
346 out.open(
"./test-rconfig.dir/global-timestamp-resolution.dir/file-2.conf");
347 assert(out.is_open());
348 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
349 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
350 out <<
"timestamp-resolution leap-year" << std::endl;
356 assert(
make_dir(
"./test-rconfig.dir/global-vault.dir"));
358 out.open(
"./test-rconfig.dir/global-vault.dir/file-1.conf");
359 assert(out.is_open());
360 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
362 <<
"vault ./test-rconfig.dir/global-vault.dir/nonexistent-vault.dir"
366 out.open(
"./test-rconfig.dir/global-vault.dir/file-2.conf");
367 assert(out.is_open());
368 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
370 <<
"vault ./test-rconfig.dir/global-vault.dir/file-1.conf"
374 assert(
make_dir(
"./test-rconfig.dir/global-vault.dir/00-vault.dir"));
376 out.open(
"./test-rconfig.dir/global-vault.dir/file-3.conf");
377 assert(out.is_open());
378 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
380 <<
"vault ./test-rconfig.dir/global-vault.dir/*"
384 out.open(
"./test-rconfig.dir/global-vault.dir/file-4.conf");
385 assert(out.is_open());
386 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
388 <<
"vault ./test-rconfig.dir/vaults/*"
392 assert(
make_dir(
"./test-rconfig.dir/global-vault-2.dir/"));
393 assert(
make_dir(
"./test-rconfig.dir/global-vault-2.dir/vaults"));
394 assert(
make_dir(
"./test-rconfig.dir/global-vault-2.dir/vaults/1"));
395 assert(
make_dir(
"./test-rconfig.dir/global-vault-2.dir/vaults/3"));
396 assert(
make_dir(
"./test-rconfig.dir/global-vault-2.dir/vaults/4"));
398 out.open(
"./test-rconfig.dir/global-vault-2.dir/vaults/2");
399 assert(out.is_open());
400 out <<
"Hello World" << std::endl;
403 out.open(
"./test-rconfig.dir/global-vault-2.dir/file-1.conf");
404 assert(out.is_open());
406 <<
"log-dir ./test-rconfig.dir/log.dir"
409 <<
"vault ./test-rconfig.dir/global-vault-2.dir/vaults/*"
416 assert(
make_dir(
"./test-rconfig.dir/global-vault-overflow-behavior.dir"));
418 out.open(
"./test-rconfig.dir/global-vault-overflow-behavior.dir/file-1.conf");
419 assert(out.is_open());
420 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
421 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
422 out <<
"vault-overflow-behavior lksdjflkj" << std::endl;
425 out.open(
"./test-rconfig.dir/global-vault-overflow-behavior.dir/file-2.conf");
426 assert(out.is_open());
427 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
428 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
429 out <<
"vault-overflow-behavior delete-oldest" << std::endl;
435 assert(
make_dir(
"./test-rconfig.dir/global-vault-overflow-blocks.dir"));
437 out.open(
"./test-rconfig.dir/global-vault-overflow-blocks.dir/file-1.conf");
438 assert(out.is_open());
439 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
440 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
441 out <<
"vault-overflow-blocks 0" << std::endl;
444 out.open(
"./test-rconfig.dir/global-vault-overflow-blocks.dir/file-2.conf");
445 assert(out.is_open());
446 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
447 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
448 out <<
"vault-overflow-blocks 51" << std::endl;
451 out.open(
"./test-rconfig.dir/global-vault-overflow-blocks.dir/file-3.conf");
452 assert(out.is_open());
453 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
454 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
455 out <<
"vault-overflow-blocks 50" << std::endl;
461 assert(
make_dir(
"./test-rconfig.dir/global-vault-overflow-inodes.dir"));
463 out.open(
"./test-rconfig.dir/global-vault-overflow-inodes.dir/file-1.conf");
464 assert(out.is_open());
465 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
466 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
467 out <<
"vault-overflow-inodes 0" << std::endl;
470 out.open(
"./test-rconfig.dir/global-vault-overflow-inodes.dir/file-2.conf");
471 assert(out.is_open());
472 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
473 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
474 out <<
"vault-overflow-inodes 51" << std::endl;
477 out.open(
"./test-rconfig.dir/global-vault-overflow-inodes.dir/file-3.conf");
478 assert(out.is_open());
479 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
480 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
481 out <<
"vault-overflow-inodes 25" << std::endl;
487 assert(
make_dir(
"./test-rconfig.dir/global-vault-selection-behavior.dir"));
489 out.open(
"./test-rconfig.dir/global-vault-selection-behavior.dir/file-1.conf");
490 assert(out.is_open());
491 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
492 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
493 out <<
"vault-selection-behavior lolksjdf" << std::endl;
496 out.open(
"./test-rconfig.dir/global-vault-selection-behavior.dir/file-2.conf");
497 assert(out.is_open());
498 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
499 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
500 out <<
"vault-selection-behavior max-free" << std::endl;
506 assert(
make_dir(
"./test-rconfig.dir/global-vault-locking.dir"));
508 out.open(
"./test-rconfig.dir/global-vault-locking.dir/file-1.conf");
509 assert(out.is_open());
510 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
511 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
514 out.open(
"./test-rconfig.dir/global-vault-locking.dir/file-2.conf");
515 assert(out.is_open());
516 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
517 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
518 out <<
"vault-locking no" << std::endl;
521 out.open(
"./test-rconfig.dir/global-vault-locking.dir/file-3.conf");
522 assert(out.is_open());
523 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
524 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
525 out <<
"vault-locking yes" << std::endl;
531 assert(
make_dir(
"./test-rconfig.dir/job.dir"));
533 out.open(
"./test-rconfig.dir/job.dir/exclude-file-1");
534 assert(out.is_open());
537 out.open(
"./test-rconfig.dir/job.dir/exclude-file-2");
538 assert(out.is_open());
541 out.open(
"./test-rconfig.dir/job.dir/exclude-file-3");
542 assert(out.is_open());
545 out.open(
"./test-rconfig.dir/job.dir/file-1.conf");
546 assert(out.is_open());
547 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
548 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
549 out <<
"<default>" << std::endl;
550 out << std::endl << std::endl;
551 out <<
" booga-booga!" << std::endl;
552 out <<
"</default>" << std::endl;
555 out.open(
"./test-rconfig.dir/job.dir/file-2.conf");
556 assert(out.is_open());
557 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
558 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
560 out <<
"include-job file-2.1.conf" << std::endl;
563 out.open(
"./test-rconfig.dir/job.dir/file-2.1.conf");
564 out << std::endl << std::endl << std::endl;
565 assert(out.is_open());
566 out <<
"booga-booga again!" << std::endl;
569 out.open(
"./test-rconfig.dir/job.dir/file-3.conf");
570 assert(out.is_open());
571 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
572 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
573 out <<
"<default>" << std::endl << std::endl;
574 out <<
" include file-3.1.conf" << std::endl;
575 out <<
"</default>" << std::endl;
578 out.open(
"./test-rconfig.dir/job.dir/file-3.1.conf");
579 assert(out.is_open());
580 out <<
"booga?" << std::endl;
583 out.open(
"./test-rconfig.dir/job.dir/file-4.conf");
584 assert(out.is_open());
585 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
586 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
587 out <<
"<default>" << std::endl;
588 out <<
" archive-path groupname/\"literal-text\"/jobname" << std::endl;
589 out <<
"</default>" << std::endl;
592 out.open(
"./test-rconfig.dir/job.dir/file-5.conf");
593 assert(out.is_open());
594 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
595 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
596 out <<
"<default>" << std::endl;
597 out <<
" exclude-from ../excludes.dir/excludes.group-A.file-1" << std::endl;
598 out <<
"</default>" << std::endl;
601 out.open(
"./test-rconfig.dir/job.dir/file-6.conf");
602 assert(out.is_open());
603 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
604 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
605 out <<
"<default>" << std::endl;
606 out <<
" exclude-from ../excludes.dir/excludes.group-A.*" << std::endl;
607 out <<
" rsync-connection-type local" << std::endl;
608 out <<
" path /var/spool" << std::endl;
609 out <<
"</default>" << std::endl;
610 out <<
"<job>" << std::endl;
611 out <<
" exclude-from ../excludes.dir/excludes.group-B.file-2" << std::endl;
612 out <<
" hostname gus-A" << std::endl;
613 out <<
"</job>" << std::endl;
614 out <<
"<default>" << std::endl;
615 out <<
" exclude-from ../excludes.dir/excludes.group-B.file-1" << std::endl;
616 out <<
" rsync-connection-type local" << std::endl;
617 out <<
" path /var/spool" << std::endl;
618 out <<
"</default>" << std::endl;
619 out <<
"<job>" << std::endl;
620 out <<
" exclude-from ../excludes.dir/excludes.group-A.file-3" << std::endl;
621 out <<
" hostname gus-B" << std::endl;
622 out <<
"</job>" << std::endl;
625 out.open(
"./test-rconfig.dir/job.dir/file-7.conf");
626 assert(out.is_open());
627 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
628 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
629 out <<
"<default>" << std::endl;
630 out <<
" groupname group-A" << std::endl;
631 out <<
" hostname host-A" << std::endl;
632 out <<
" rsync-behavior clear" << std::endl;
633 out <<
" rsync-behavior * = fail" << std::endl;
634 out <<
" rsync-behavior 5 = ok" << std::endl;
635 out <<
" rsync-connection-type server" << std::endl;
636 out <<
" rsync-hardlink off" << std::endl;
637 out <<
" rsync-options --some -options for-rsync" << std::endl;
638 out <<
" rsync-remote-user alice" << std::endl;
639 out <<
" rsync-remote-port 4338" << std::endl;
640 out <<
" path /var/spool" << std::endl;
641 out <<
"</default>" << std::endl;
642 out <<
"<job>" << std::endl;
643 out <<
" jobname job-A" << std::endl;
644 out <<
" rsync-behavior reset" << std::endl;
645 out <<
" rsync-connection-type local" << std::endl;
646 out <<
" rsync-hardlink on" << std::endl;
647 out <<
" <rsync-options>" << std::endl;
648 out <<
" some more" << std::endl;
649 out <<
" \"options for\"" << std::endl;
650 out <<
" the\\trsync\\ program" << std::endl;
651 out <<
" </rsync-options>" << std::endl;
652 out <<
" rsync-remote-user" << std::endl;
653 out <<
" rsync-remote-port" << std::endl;
654 out <<
"</job>" << std::endl;
655 out <<
"<job>" << std::endl;
656 out <<
" hostname host-B" << std::endl;
657 out <<
"</job>" << std::endl;
658 out <<
"<job>" << std::endl;
659 out <<
" hostname host-C" << std::endl;
660 out <<
" rsync-hardlink on" << std::endl;
661 out <<
" rsync-multi-hardlink on" << std::endl;
662 out <<
" rsync-multi-hardlink-max 7" << std::endl;
663 out <<
"</job>" << std::endl;
664 out <<
"<job>" << std::endl;
665 out <<
" jobname job-D" << std::endl;
666 out <<
" hostname host-D" << std::endl;
667 out <<
" rsync-behavior reset" << std::endl;
668 out <<
" rsync-connection-type remote" << std::endl;
669 out <<
" rsync-hardlink on" << std::endl;
670 out <<
" <rsync-options>" << std::endl;
671 out <<
" -e \"-i foo\"" << std::endl;
672 out <<
" </rsync-options>" << std::endl;
673 out <<
" rsync-remote-user" << std::endl;
674 out <<
" rsync-remote-port" << std::endl;
675 out <<
"</job>" << std::endl;
676 out <<
"<job>" << std::endl;
677 out <<
" jobname job-E" << std::endl;
678 out <<
" hostname host-E" << std::endl;
679 out <<
" rsync-behavior reset" << std::endl;
680 out <<
" rsync-connection-type remote" << std::endl;
681 out <<
" rsync-hardlink on" << std::endl;
682 out <<
" <rsync-options>" << std::endl;
683 out <<
" --rsh=\"/usr/bin/rsh -i foo\"" << std::endl;
684 out <<
" </rsync-options>" << std::endl;
685 out <<
" rsync-remote-user" << std::endl;
686 out <<
" rsync-remote-port" << std::endl;
687 out <<
"</job>" << std::endl;
690 out.open(
"./test-rconfig.dir/job.dir/file-8.conf");
691 assert(out.is_open());
692 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
693 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
694 out <<
"<default>" << std::endl;
695 out <<
" jobname job-A" << std::endl;
696 out <<
"</default>" << std::endl;
699 out.open(
"./test-rconfig.dir/job.dir/file-9.conf");
700 assert(out.is_open());
701 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
702 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
703 out <<
"<job>" << std::endl;
704 out <<
" rsync-connection-type local" << std::endl;
705 out <<
" archive-path jobname" << std::endl;
706 out <<
" path /var/spool" << std::endl;
707 out <<
"</job>" << std::endl;
710 out.open(
"./test-rconfig.dir/job.dir/file-10.conf");
711 assert(out.is_open());
712 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
713 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
714 out <<
"<job>" << std::endl;
715 out <<
" rsync-connection-type local" << std::endl;
716 out <<
" archive-path groupname" << std::endl;
717 out <<
" path /var/spool" << std::endl;
718 out <<
"</job>" << std::endl;
721 out.open(
"./test-rconfig.dir/job.dir/file-11.conf");
722 assert(out.is_open());
723 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
724 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
725 out <<
"<job>" << std::endl;
726 out <<
" rsync-connection-type local" << std::endl;
727 out <<
" archive-path hostname" << std::endl;
728 out <<
" path /var/spool" << std::endl;
729 out <<
"</job>" << std::endl;
732 out.open(
"./test-rconfig.dir/job.dir/file-12.conf");
733 assert(out.is_open());
734 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
735 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
736 out <<
"<default>" << std::endl;
737 out <<
" rsync-connection-type local" << std::endl;
738 out <<
" path /var/spool" << std::endl;
739 out <<
"</default>" << std::endl;
740 out <<
"<job>" << std::endl;
741 out <<
" archive-path permutation" << std::endl;
742 out <<
"</job>" << std::endl;
743 out <<
"<job>" << std::endl;
744 out <<
" jobname job-A" << std::endl;
745 out <<
" archive-path permutation/jobname" << std::endl;
746 out <<
"</job>" << std::endl;
749 out.open(
"./test-rconfig.dir/job.dir/file-13.conf");
750 assert(out.is_open());
751 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
752 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
753 out <<
"<default>" << std::endl;
754 out <<
" rsync-connection-type local" << std::endl;
755 out <<
" path /var/spool" << std::endl;
756 out <<
" clear rsync-behavior" << std::endl;
757 out <<
" clear archive-path" << std::endl;
758 out <<
" archive-path pathname" << std::endl;
759 out <<
"</default>" << std::endl;
760 out <<
"<job>" << std::endl;
761 out <<
"</job>" << std::endl;
762 out <<
"<job>" << std::endl;
763 out <<
" clear paths" << std::endl;
764 out <<
" path /etc" << std::endl;
765 out <<
"</job>" << std::endl;
768 out.open(
"./test-rconfig.dir/job.dir/file-14.conf");
769 assert(out.is_open());
770 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
771 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
772 out <<
"<default>" << std::endl;
773 out <<
" path /var/spool" << std::endl;
774 out <<
"</default>" << std::endl;
775 out <<
"<job>" << std::endl;
776 out <<
" hostname local-default" << std::endl;
777 out <<
" rsync-connection-type local" << std::endl;
778 out <<
"</job>" << std::endl;
779 out <<
"<job>" << std::endl;
780 out <<
" hostname local-port" << std::endl;
781 out <<
" rsync-connection-type local" << std::endl;
782 out <<
" rsync-remote-port 1234" << std::endl;
783 out <<
"</job>" << std::endl;
784 out <<
"<job>" << std::endl;
785 out <<
" hostname remote-default" << std::endl;
786 out <<
" rsync-connection-type remote" << std::endl;
787 out <<
"</job>" << std::endl;
788 out <<
"<job>" << std::endl;
789 out <<
" hostname remote-port" << std::endl;
790 out <<
" rsync-connection-type remote" << std::endl;
791 out <<
" rsync-remote-port 1234" << std::endl;
792 out <<
"</job>" << std::endl;
793 out <<
"<job>" << std::endl;
794 out <<
" hostname server-default" << std::endl;
795 out <<
" rsync-connection-type server" << std::endl;
796 out <<
"</job>" << std::endl;
797 out <<
"<job>" << std::endl;
798 out <<
" hostname server-port" << std::endl;
799 out <<
" rsync-connection-type server" << std::endl;
800 out <<
" rsync-remote-port 1234" << std::endl;
801 out <<
"</job>" << std::endl;
804 out.open(
"./test-rconfig.dir/job.dir/file-15.conf");
805 assert(out.is_open());
806 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
807 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
808 out <<
"<default>" << std::endl;
809 out <<
" path /var/spool" << std::endl;
810 out <<
"</default>" << std::endl;
811 out <<
"<job>" << std::endl;
812 out <<
" rsync-connection-type local" << std::endl;
813 out <<
" rsync-hardlink yes" << std::endl;
814 out <<
" rsync-timeout 600" << std::endl;
815 out <<
" rsync-retry-count 6" << std::endl;
816 out <<
" <rsync-options>" << std::endl;
817 out <<
" -a" << std::endl;
818 out <<
" --delete" << std::endl;
819 out <<
" --delete-excluded" << std::endl;
820 out <<
" --force" << std::endl;
821 out <<
" --ignore-errors" << std::endl;
822 out <<
" --one-file-system" << std::endl;
823 out <<
" --progress" << std::endl;
824 out <<
" </rsync-options>" << std::endl;
825 out <<
" archive-path pathname" << std::endl;
826 out <<
" path /net/host-name.domain.name/home/" << std::endl;
827 out <<
" path /net/host-name.domain.name/root/" << std::endl;
828 out <<
" path /net/host-name.domain.name/etc/" << std::endl;
829 out <<
" path /net/host-name.domain.name/boot/" << std::endl;
830 out <<
"</job>" << std::endl;
833 out.open(
"./test-rconfig.dir/job.dir/file-16.conf");
834 assert(out.is_open());
835 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
836 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
837 out <<
"<job>" << std::endl;
838 out <<
" rsync-connection-type local" << std::endl;
839 out <<
" rsync-hardlink yes" << std::endl;
840 out <<
" rsync-timeout 600" << std::endl;
841 out <<
" rsync-retry-count 6" << std::endl;
842 out <<
" <rsync-options>" << std::endl;
843 out <<
" -a" << std::endl;
844 out <<
" --delete" << std::endl;
845 out <<
" --delete-excluded" << std::endl;
846 out <<
" --force" << std::endl;
847 out <<
" --ignore-errors" << std::endl;
848 out <<
" --one-file-system" << std::endl;
849 out <<
" --progress" << std::endl;
850 out <<
" </rsync-options>" << std::endl;
851 out <<
" archive-path pathname" << std::endl;
852 out <<
" path /net/host-name.domain.name/home/" << std::endl;
853 out <<
" path /net/host-name.domain.name/root/" << std::endl;
854 out <<
" path /net/host-name.domain.name/etc/" << std::endl;
855 out <<
" path /net/host-name.domain.name/boot/" << std::endl;
856 out <<
"</job>" << std::endl;
859 assert(
make_dir(
"./test-rconfig.dir/old-log-files.dir"));
861 out.open(
"./test-rconfig.dir/old-log-files.dir/file-1.conf");
862 assert(out.is_open());
863 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
864 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
865 out <<
"<job>" << std::endl;
866 out <<
" rsync-connection-type local" << std::endl;
867 out <<
" rsync-hardlink yes" << std::endl;
868 out <<
" rsync-timeout 600" << std::endl;
869 out <<
" rsync-retry-count 6" << std::endl;
870 out <<
" <rsync-options>" << std::endl;
871 out <<
" -a" << std::endl;
872 out <<
" --delete" << std::endl;
873 out <<
" --delete-excluded" << std::endl;
874 out <<
" --force" << std::endl;
875 out <<
" --ignore-errors" << std::endl;
876 out <<
" --one-file-system" << std::endl;
877 out <<
" --progress" << std::endl;
878 out <<
" </rsync-options>" << std::endl;
879 out <<
" archive-path pathname" << std::endl;
880 out <<
" path /net/host-name.domain.name/home/" << std::endl;
881 out <<
" path /net/host-name.domain.name/root/" << std::endl;
882 out <<
" path /net/host-name.domain.name/etc/" << std::endl;
883 out <<
" path /net/host-name.domain.name/boot/" << std::endl;
884 out <<
"</job>" << std::endl;
887 out.open(
"./test-rconfig.dir/old-log-files.dir/file-2.conf");
888 assert(out.is_open());
889 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
890 out <<
"delete-old-log-files yes" << std::endl;
891 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
892 out <<
"<job>" << std::endl;
893 out <<
" rsync-connection-type local" << std::endl;
894 out <<
" rsync-hardlink yes" << std::endl;
895 out <<
" rsync-timeout 600" << std::endl;
896 out <<
" rsync-retry-count 6" << std::endl;
897 out <<
" <rsync-options>" << std::endl;
898 out <<
" -a" << std::endl;
899 out <<
" --delete" << std::endl;
900 out <<
" --delete-excluded" << std::endl;
901 out <<
" --force" << std::endl;
902 out <<
" --ignore-errors" << std::endl;
903 out <<
" --one-file-system" << std::endl;
904 out <<
" --progress" << std::endl;
905 out <<
" </rsync-options>" << std::endl;
906 out <<
" archive-path pathname" << std::endl;
907 out <<
" path /net/host-name.domain.name/home/" << std::endl;
908 out <<
" path /net/host-name.domain.name/root/" << std::endl;
909 out <<
" path /net/host-name.domain.name/etc/" << std::endl;
910 out <<
" path /net/host-name.domain.name/boot/" << std::endl;
911 out <<
"</job>" << std::endl;
914 out.open(
"./test-rconfig.dir/old-log-files.dir/file-3.conf");
915 assert(out.is_open());
916 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
917 out <<
"delete-old-report-files yes" << std::endl;
918 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
919 out <<
"<job>" << std::endl;
920 out <<
" rsync-connection-type local" << std::endl;
921 out <<
" rsync-hardlink yes" << std::endl;
922 out <<
" rsync-timeout 600" << std::endl;
923 out <<
" rsync-retry-count 6" << std::endl;
924 out <<
" <rsync-options>" << std::endl;
925 out <<
" -a" << std::endl;
926 out <<
" --delete" << std::endl;
927 out <<
" --delete-excluded" << std::endl;
928 out <<
" --force" << std::endl;
929 out <<
" --ignore-errors" << std::endl;
930 out <<
" --one-file-system" << std::endl;
931 out <<
" --progress" << std::endl;
932 out <<
" </rsync-options>" << std::endl;
933 out <<
" archive-path pathname" << std::endl;
934 out <<
" path /net/host-name.domain.name/home/" << std::endl;
935 out <<
" path /net/host-name.domain.name/root/" << std::endl;
936 out <<
" path /net/host-name.domain.name/etc/" << std::endl;
937 out <<
" path /net/host-name.domain.name/boot/" << std::endl;
938 out <<
"</job>" << std::endl;
941 out.open(
"./test-rconfig.dir/old-log-files.dir/file-4.conf");
942 assert(out.is_open());
943 out <<
"log-dir ./test-rconfig.dir/log.dir" << std::endl;
944 out <<
"delete-old-log-files yes" << std::endl;
945 out <<
"delete-old-report-files yes" << std::endl;
946 out <<
"vault ./test-rconfig.dir/vaults/vault-1" << std::endl;
947 out <<
"<job>" << std::endl;
948 out <<
" rsync-connection-type local" << std::endl;
949 out <<
" rsync-hardlink yes" << std::endl;
950 out <<
" rsync-timeout 600" << std::endl;
951 out <<
" rsync-retry-count 6" << std::endl;
952 out <<
" <rsync-options>" << std::endl;
953 out <<
" -a" << std::endl;
954 out <<
" --delete" << std::endl;
955 out <<
" --delete-excluded" << std::endl;
956 out <<
" --force" << std::endl;
957 out <<
" --ignore-errors" << std::endl;
958 out <<
" --one-file-system" << std::endl;
959 out <<
" --progress" << std::endl;
960 out <<
" </rsync-options>" << std::endl;
961 out <<
" archive-path pathname" << std::endl;
962 out <<
" path /net/host-name.domain.name/home/" << std::endl;
963 out <<
" path /net/host-name.domain.name/root/" << std::endl;
964 out <<
" path /net/host-name.domain.name/etc/" << std::endl;
965 out <<
" path /net/host-name.domain.name/boot/" << std::endl;
966 out <<
"</job>" << std::endl;
void mk_dir(const std::string &a_path)
Create a directory.
Basic types definitions and templates.
bool make_dir(const std::string &path)