]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/cancel-inactive-test
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / cancel-inactive-test
1 #!/usr/bin/perl -w
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 # Small test to setup a backup with $nb_files*2 to backup,
7 # then, we can run multiple full jobs over the directory
8 # and create a "large" catalog.
9 #
10 use strict;
11
12 # use bacula functions
13 use scripts::functions;
14
15 start_test();
16
17 # cleanup the previous conf
18 cleanup();
19
20 # initialize the configuration
21 system("scripts//copy-test-confs");
22
23 # initialize the fileset
24 add_to_backup_list("$cwd/build/po");
25
26 start_bacula();
27
28 create_bconcmds(
29     "$out $tmp/log1.out",
30     "label volume=TestVolume001 storage=File pool=Scratch",
31     "run job=NightlySave level=full yes",
32     "wait",
33     "messages",
34     "$out $tmp/log2.out",
35     "llist jobid=1",
36     );
37
38 run_bconsole();
39
40 my $job = `awk '/[jJ]ob: / { print \$2 }' $tmp/log2.out`;
41 chomp($job);
42
43 p("Now try to cancel the previous job to see if the director will connect to FD/SD");
44
45 create_bconcmds(
46     "$out $tmp/log3.out",
47     "cancel inactive client=$CLIENT ujobid=$job",
48     "$out $tmp/log4.out",
49     "cancel inactive ujobid=$job",
50     "$out $tmp/log5.out",
51     "cancel inactive storage=File ujobid=$job"
52     );
53
54 run_bconsole();
55
56 stop_bacula();
57
58 p("Should find FD code 2901 in cancel output");
59
60 if (!docmd("grep 2901 $tmp/log3.out") ||
61     !docmd("grep 2901 $tmp/log4.out") ||
62     !docmd("grep 2901 $tmp/log5.out")) 
63 {
64     print "ERROR: Unable to find 2901 in log3,4,5.out\n";
65     $estat=1;
66 }
67
68 end_test();