From 5be7dfb3664fa5a008a5aaa14dca4a165beb02d1 Mon Sep 17 00:00:00 2001 From: Chai Feng Date: Sat, 19 Oct 2019 13:07:34 +0200 Subject: [PATCH] Add tests for ufw-docker--get-service-{id,name} --- test/ufw-docker-service.test.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/ufw-docker-service.test.sh b/test/ufw-docker-service.test.sh index cdfe5bc..837a4b6 100755 --- a/test/ufw-docker-service.test.sh +++ b/test/ufw-docker-service.test.sh @@ -101,3 +101,21 @@ test-ufw-docker--service-delete-allow-webapp() { test-ufw-docker--service-delete-allow-webapp-assert() { ufw-docker--service-delete webapp } + + +test-ufw-docker--get-service-id() { + load-ufw-docker-function ufw-docker--get-service-id + ufw-docker--get-service-id database +} +test-ufw-docker--get-service-id-assert() { + docker service inspect database --format "{{.ID}}" +} + + +test-ufw-docker--get-service-name() { + load-ufw-docker-function ufw-docker--get-service-name + ufw-docker--get-service-name database +} +test-ufw-docker--get-service-name-assert() { + docker service inspect database --format "{{.Spec.Name}}" +}