Add test: delete functionality
This commit is contained in:
parent
6ec57c0bde
commit
a59ce2003c
1 changed files with 29 additions and 0 deletions
29
imag-store/tests/003-delete_test.sh
Normal file
29
imag-store/tests/003-delete_test.sh
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source $(dirname ${BASH_SOURCE[0]})/utils.sh
|
||||||
|
|
||||||
|
create() {
|
||||||
|
imag-store create $*
|
||||||
|
}
|
||||||
|
|
||||||
|
delete() {
|
||||||
|
imag-store delete $*
|
||||||
|
}
|
||||||
|
|
||||||
|
test_delete_simple() {
|
||||||
|
local name="test~0.1.0"
|
||||||
|
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in a new issue