3 # Copyright (C) 2000-2016 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # Cleanup left over files -- both before and after test run
12 rm -rf ${tmp}/FileVolume*
13 rm -rf ${tmp}/TestVolume001 ${tmp}bacula-restores ${tmp}/Small*
14 rm -rf ${tmp}/sed_tmp ${tmp}/file-list
16 rm -rf ${working}/log ${tmp}/TEST-*
17 rm -rf ${working}/log ${tmp}/Backup-*
18 rm -rf ${working}/*.bsr ${working}/log*.sd
19 rm -rf ${working}/*.trace ${working}/*.traceback ${working}/*.state
22 rm -rf ${tmp}disk-changer
23 rm -f ${cwd}/bin/plugins/test-plugin-fd.so
25 find . -name "gigaslam.gif" -exec rm -f {} \;
28 # bin directory does not always exist
29 if [ -d ${bin} ] ; then
30 if [ -f ${bin}/bacula ] ; then
31 ${bin}/bacula stop -KILL 2>&1 >/dev/null
36 ./drop_bacula_tables >/dev/null 2>&1
37 ./make_bacula_tables >/dev/null 2>&1
38 ./grant_bacula_privileges >/dev/null 2>&1
41 if [ x$USE_VTAPE = xyes ]; then
45 if [ x$FORCE_DEDUP = xyes ]; then
47 rm -rf ${working}/ddefd
50 # Remove cloud test volumes
51 if [ x$FORCE_CLOUD = xyes ]; then
52 drv=`echo $CLOUD_DRIVER | tr 'A-Z' 'a-z'`
53 if [ "${drv}" = s3 -o "${drv}" = fakes3 ]; then
54 if [ x${CLOUD_HOSTNAME} != x ]; then
55 if [ x${CLOUD_PROTOCOL} = xHTTPS ]; then
58 endpoint="--endpoint-url=http://${CLOUD_HOSTNAME}"
61 if [ x${CLOUD_REGION} != x ]; then
62 region="--region ${CLOUD_REGION}"
66 aws configure set default.s3.signature_version s3v4
67 aws s3 rm s3://${CLOUD_BUCKETNAME} $endpoint --recursive --include 'TestVol*' --include 'Vol*' $region 2>/dev/null >/dev/null
69 if [ x${CLOUD_BUCKETNAME} != x ]; then
70 args="${args} -n ${CLOUD_BUCKETNAME}"
72 if [ x${CLOUD_ACCESSKEY} != x ]; then
73 args="${args} -a ${CLOUD_ACCESSKEY}"
75 if [ x${CLOUD_SECRETKEY} != x ]; then
76 args="${args} -s ${CLOUD_SECRETKEY}"
78 if [ x${CLOUD_PROTOCOL} != x ]; then
79 args="${args} -p ${CLOUD_PROTOCOL}"
81 if [ x${CLOUD_REGION} != x ]; then
82 args="${args} -r ${CLOUD_REGION}"
84 if [ x${CLOUD_DRIVER} != x ]; then
85 args="${args} -y ${CLOUD_DRIVER}"
87 if [ x${CLOUD_URISTYLE} != x ]; then
88 args="${args} -u ${CLOUD_URISTYLE}"
90 if [ x${CLOUD_BLOBENDPOINT} != x ]; then
91 args="${args} -b ${CLOUD_BLOBENDPOINT}"
93 if [ x${CLOUD_TABLEENDPOINT} != x ]; then
94 args="${args} -t ${CLOUD_TABLEENDPOINT}"
96 if [ x${CLOUD_QUEUEENDPOINT} != x ]; then
97 args="${args} -q ${CLOUD_QUEUEENDPOINT}"
99 ${bin}/bcloud ${args} -v 'Vol' clean
100 ${bin}/bcloud ${args} -v 'vol' clean
101 ${bin}/bcloud ${args} -v 'TestVol' clean
102 ${bin}/bcloud ${args} -v 'Small' clean
103 ${bin}/bcloud ${args} -v 'TEST' clean
104 ${bin}/bcloud ${args} -v 'Backup-' clean
105 # Might report incorrect error if not setup correctly