1#!/bin/sh
2#
3# Attempt to backup from a fifo and restore to a fifo
4#
5TestName="fifo-test"
6JobName=FIFOTest
7. scripts/functions
8
9scripts/cleanup
10scripts/copy-test-confs
11echo "${cwd}/tmp/bfifo" >${cwd}/tmp/file-list
12
13rm -f ${cwd}/tmp/bfifo
14mkfifo ${cwd}/tmp/bfifo
15# send a file into the fifo
16file=encrypt-bug.jpg
17cat ${file} >${cwd}/tmp/bfifo&
18
19start_test
20
21cat <<END_OF_DATA >${cwd}/tmp/bconcmds
22@$out /dev/null
23messages
24@$out ${cwd}/tmp/log1.out
25label storage=File1 volume=TestVolume001
26run job=$JobName storage=File1 yes
27wait
28messages
29quit
30END_OF_DATA
31
32
33run_bareos
34
35cat <<END_OF_DATA >${cwd}/tmp/bconcmds
36@$out /dev/null
37messages
38@#
39@# now do a restore
40@#
41@$out ${cwd}/tmp/log2.out
42@#setdebug level=50 client=$CLIENT
43restore where=/  select all storage=File1 done
44yes
45wait
46messages
47quit
48END_OF_DATA
49
50cat <${cwd}/tmp/bfifo >${cwd}/tmp/${file}&
51
52run_bconsole
53
54check_for_zombie_jobs storage=File1
55stop_bareos
56
57check_two_logs
58diff ${file} ${cwd}/tmp/${file}
59dstat=$?
60end_test
61