imag/imag-store/tests/003-delete_test.sh

31 lines
531 B
Bash
Raw Normal View History

2016-02-05 20:44:15 +00:00
#!/usr/bin/env bash
source $(dirname ${BASH_SOURCE[0]})/../../tests/utils.sh
2016-02-05 20:44:15 +00:00
source $(dirname ${BASH_SOURCE[0]})/utils.sh
create() {
imag-store create $*
}
delete() {
imag-store delete $*
}
test_delete_simple() {
local name="test~0.2.0"
2016-02-05 20:44:15 +00:00
create -p /$name
delete --id /$name
local n=$($(find ${STORE}/ -type f | wc -l))
if [[ $n -eq 0 ]]; then
success "Deleting worked"
else
err "There are still $n files in the store"
fi
}
invoke_tests \
test_delete_simple