Add two tests for ufw-docker--delete

This commit is contained in:
Chai Feng 2019-10-19 12:34:50 +02:00
parent bcfca79758
commit b701f6baee

View File

@ -430,3 +430,29 @@ test-ufw-docker--list-number() {
test-ufw-docker--list-number-assert() {
sed -e 's/^\[[[:blank:]]*\([[:digit:]]\+\)\].*/\1/'
}
test-ufw-docker--delete-empty-result() {
@mock ufw-docker--list-number webapp 80 tcp === @stdout ""
@mock sort -rn
load-ufw-docker-function ufw-docker--delete
ufw-docker--delete webapp 80 tcp
}
test-ufw-docker--delete-empty-result-assert() {
@do-nothing
}
test-ufw-docker--delete-all() {
@mock ufw-docker--list-number webapp 80 tcp === @stdout 5 8 9
@mock sort -rn
load-ufw-docker-function ufw-docker--delete
ufw-docker--delete webapp 80 tcp
}
test-ufw-docker--delete-all-assert() {
ufw delete 5
ufw delete 8
ufw delete 9
}