]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/remote-console-test
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / remote-console-test
1 #!/bin/bash
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 # Test and setup the Client Initiated Backup
7 #
8 TestName="remote-console-test"
9 JobName=backup
10 . scripts/functions
11
12 scripts/cleanup
13 scripts/copy-confs
14
15 change_jobname BackupClient1 $JobName
16 start_test
17
18 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Address", "0.0.0.0", "Client")'
19 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "MaximumBandwidthPerJob", "1mb/s", "Client")'
20 $bperl -e 'extract_resource("$conf/bconsole.conf", "Director")' | sed 's/Director/Console/' > $tmp/1
21 cat $tmp/1 >> $conf/bacula-fd.conf
22 pass=`grep -i password $tmp/1`
23 name=`grep -i name $tmp/1`
24
25 cat <<EOF >> $conf/bacula-dir.conf
26 Console {
27  $name
28  $pass
29  CommandAcl = run, .api, restore, wait, status, .status, .jobs, .clients, .storages, .pools, .filesets, .defaults
30  jobacl = *all*
31  poolacl = *all*
32  clientacl = *all*
33  storageacl = *all*
34  catalogacl = *all*
35  filesetacl = *all*
36  directoryacl = *all*
37  useridacl = *all*
38  whereacl = *all*
39 }
40 EOF
41
42 cat <<EOF >> $conf/bacula-fd.conf
43 Director {
44   Name = remote-cons
45   Password = "oi3deith3peeGho4"
46   Remote = yes
47 }
48 EOF
49
50 FDPORT=`expr $BASEPORT + 1`
51
52 cat <<EOF > $tmp/bconsole-remote.conf
53 Director {
54   Name = remote-cons
55   DIRport = $FDPORT
56   address = localhost
57   Password = "noused"
58 }
59
60 Console {
61   Name = remote-cons
62   Director = remote-cons
63   Password = "oi3deith3peeGho4"
64 }
65 EOF
66
67 cat <<END_OF_DATA >$tmp/bconcmds
68 @$out /dev/null
69 messages
70 @$out $tmp/log1.out
71 label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0
72 quit
73 END_OF_DATA
74
75 run_bacula
76
77 echo -e "proxy\n.status dir header api=2 api_opts=" | $bin/bconsole -c $tmp/bconsole-remote.conf
78 echo -e ".status header api=2 api_opts=" | $bin/bconsole -c $tmp/bconsole-remote.conf
79 echo -e "proxy\nrun job=backup level=full yes" | $bin/bconsole -c $tmp/bconsole-remote.conf
80
81 cat <<END_OF_DATA >$tmp/bconcmds
82 @$out $tmp/log1.out
83 @sleep 10
84 status dir
85 @sleep 10
86 status dir
87 wait
88 messages
89 END_OF_DATA
90
91 run_bconsole
92
93 if test "$debug" -eq 1 ; then
94   echo -e "proxy\nrestore select all done yes" | $bin/bconsole -c $tmp/bconsole-remote.conf
95 else
96   echo -e "proxy\nrestore select all done yes" | $bin/bconsole -c $tmp/bconsole-remote.conf >/dev/null 2>&1
97 fi
98
99 sed -i 's/log1.out/log2.out/' $tmp/bconcmds
100
101 run_bconsole
102 check_for_zombie_jobs storage=File1
103
104 stop_bacula
105
106 check_two_logs
107 check_restore_diff
108 end_test