3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # Run a simple backup of the Bacula build directory then create some
7 # new files, do an Incremental and restore those two files.
8 # test the bvfs interface
10 TestName="bvfs-cmds-test"
15 ${rscripts}/copy-test-confs
16 echo "${tmpsrc}" >${tmp}/file-list
19 cp -p $src/src/dird/*.c $tmpsrc
21 change_jobname CompressedTest $JobName
24 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "ClientRunBeforeJob", "sleep 2", "Job")'
26 cat <<END_OF_DATA >$tmp/bconcmds
30 label storage=File volume=TestVolume001
33 @exec "touch $tmpsrc/dird.c"
36 @exec "touch $tmpsrc/ua_cmds.c"
39 @exec "touch $tmpsrc/ua_dotcmds.c"
47 check_for_zombie_jobs storage=File
49 cat <<EOF >$tmp/bconcmds
54 SELECT JobId, StartTime, EndTime FROM Job;
60 start=`perl -ne '/(\d)\s+\|\s+([0-9 :-]+?)\s*\|/ && ($1 == 2) && print $2' $tmp/log0.out`
62 cat <<EOF >$tmp/bconcmds
66 .bvfs_get_jobids client=$CLIENT
68 .bvfs_get_jobids client=$CLIENT count
70 .bvfs_get_jobids client=$CLIENT count limit=2
72 .bvfs_get_jobids client=$CLIENT count start="$start"
74 .bvfs_get_jobids client=$CLIENT count end="$start"
80 grep '^1,2,3,4$' $tmp/log3.out >/dev/null # All jobids
81 estat=`expr $estat + $?`
82 grep '^4$' $tmp/log4.out >/dev/null # Number of jobs
83 estat=`expr $estat + $?`
84 grep '^2$' $tmp/log5.out >/dev/null # with a limit
85 estat=`expr $estat + $?`
86 grep '^3$' $tmp/log6.out >/dev/null # with a filter on the date
87 estat=`expr $estat + $?`
88 grep '^2$' $tmp/log7.out >/dev/null # with a filter on the date
89 estat=`expr $estat + $?`