#!/usr/bin/perl -w # # Copyright (C) 2000-2017 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # # Small test to setup a backup with $nb_files*2 to backup, # then, we can run multiple full jobs over the directory # and create a "large" catalog. # use strict; # use bacula functions use scripts::functions; start_test(); # cleanup the previous conf cleanup(); # initialize the configuration system("scripts//copy-test-confs"); # initialize the fileset add_to_backup_list("$cwd/build/po"); start_bacula(); create_bconcmds( "$out $tmp/log1.out", "label volume=TestVolume001 storage=File pool=Scratch", "run job=NightlySave level=full yes", "wait", "messages", "$out $tmp/log2.out", "llist jobid=1", ); run_bconsole(); my $job = `awk '/[jJ]ob: / { print \$2 }' $tmp/log2.out`; chomp($job); p("Now try to cancel the previous job to see if the director will connect to FD/SD"); create_bconcmds( "$out $tmp/log3.out", "cancel inactive client=$CLIENT ujobid=$job", "$out $tmp/log4.out", "cancel inactive ujobid=$job", "$out $tmp/log5.out", "cancel inactive storage=File ujobid=$job" ); run_bconsole(); stop_bacula(); p("Should find FD code 2901 in cancel output"); if (!docmd("grep 2901 $tmp/log3.out") || !docmd("grep 2901 $tmp/log4.out") || !docmd("grep 2901 $tmp/log5.out")) { print "ERROR: Unable to find 2901 in log3,4,5.out\n"; $estat=1; } end_test();