aboutsummaryrefslogtreecommitdiff
path: root/tests/100-cannot_open_files.sh
blob: 34cf3e021819f5fcd3563ab0c146a9dd98954767 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

source ./assert.sh

PROGRAM_EXEC="$1"

rm -f input base out
touch base out
assert "" "cannot get size of input file" 1 $PROGRAM_EXEC backup -i input -b base -o out

rm -f input base out
touch input out
assert "" "cannot get size of base file" 1 $PROGRAM_EXEC backup -i input -b base -o out

rm -f input base out
rmdir outdir 2>/dev/null
touch input base
mkdir outdir
chmod -w outdir
assert "" "cannot open output file" 1 $PROGRAM_EXEC backup -i input -b base -o outdir/out

rm -f input base out
rmdir outdir

exit 0