]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/fifo-test
Tweak another attempt to fix script in file-span-vol-test to be FreeBSD compatibile
[bacula/bacula] / regress / tests / fifo-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # Attempt to backup from a fifo and restore to a fifo
9 #
10 TestName="fifo-test"
11 JobName=FIFOTest
12 . scripts/functions
13
14 scripts/cleanup
15 scripts/copy-test-confs
16 echo "${cwd}/tmp/bfifo" >${cwd}/tmp/file-list
17
18 rm -f ${cwd}/tmp/bfifo
19 mkfifo ${cwd}/tmp/bfifo
20 # send a file into the fifo
21 file=encrypt-bug.jpg
22 cat ${file} >${cwd}/tmp/bfifo&
23
24 start_test
25
26 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
27 @output /dev/null
28 messages
29 @$out ${cwd}/tmp/log1.out
30 label storage=File1 volume=TestVolume001 slot=1 drive=0
31 setdebug level=10 storage=File1
32 run job=$JobName storage=File1 yes
33 wait
34 messages
35 list volumes
36 sql
37 select jobid,mediaid,startblock,endblock from JobMedia;
38
39 quit
40 END_OF_DATA
41
42
43 run_bacula
44
45 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
46 @output /dev/null
47 messages
48 @# 
49 @# now do a restore
50 @#
51 @$out ${cwd}/tmp/log2.out
52 @#setdebug level=50 client=$CLIENT
53 restore where=/  select all storage=File1 done
54 yes
55 wait
56 messages
57 quit
58 END_OF_DATA
59
60 cat <${cwd}/tmp/bfifo >${cwd}/tmp/${file}&
61
62 run_bconsole
63
64 check_for_zombie_jobs storage=File1
65 stop_bacula
66
67 if [ "$debug" = 1 ] ; then
68   $bin/bls -d 50 -v -c $conf/bacula-sd.conf -V 'TestVolume001' FileStorage1
69   ls -l ${cwd}/tmp/TestVolume*
70 fi
71
72 check_two_logs
73 diff ${file} ${cwd}/tmp/${file} >/dev/null 2>&1
74 dstat=$?
75 end_test