Skip to content

Commit

Permalink
add test for broken exclude pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
florianjacob committed Dec 27, 2016
1 parent 1d4d5cd commit 95c7180
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/data/exclude.patterns.error
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/var/cache
/var/lib/docker/*
*/.snapshots
/tmp
foo
*backup*
*secret*
7 changes: 7 additions & 0 deletions tests/snazzer.bats
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ expected_snapshots_raw() {
diff -u $(expected_file) $(actual_file)
}

@test "snazzer --all check excludefile syntax" {
SNAZZER_SUBVOLS_EXCLUDE_FILE=$BATS_TEST_DIRNAME/data/exclude.patterns.error
run snazzer --all --dry-run "$MNT"
# 12 means that snazzer detected the errors in the file
[ "$status" = "12" ]
}

@test "snazzer --all [mountpoint]" {
run snazzer --all "$MNT"
expected_snapshots | sort > $(expected_file)
Expand Down

0 comments on commit 95c7180

Please sign in to comment.