markusthoemmes commented on a change in pull request #2530: Add a database flag 
to completely block a given subject.
URL: 
https://github.com/apache/incubator-openwhisk/pull/2530#discussion_r129759957
 
 

 ##########
 File path: tests/src/test/scala/whisk/core/admin/WskAdminTests.scala
 ##########
 @@ -91,4 +91,37 @@ class WskAdminTests
         val ns = wsk.namespace.whois()
         wskadmin.cli(Seq("user", "get", ns)).stdout.trim should 
be(wskprops.authKey)
     }
+
+    it should "block and unblock a user respectively" in {
+        val wskadmin = new RunWskAdminCmd {}
+        val auth = AuthKey()
+        val subject = Subject().asString
+        try {
+            println(s"CRD subject: $subject")
+            wskadmin.cli(Seq("user", "create", subject, "-u", auth.compact))
+
+            whisk.utils.retry({
+                // reverse lookup by namespace
+                wskadmin.cli(Seq("user", "list", "-k", subject)).stdout.trim 
should be(auth.compact)
+            }, 10, Some(1.second))
+
+            // block the user
+            wskadmin.cli(Seq("user", "block", subject))
+
+            // wait until the user can no longer be found
+            whisk.utils.retry({
+                wskadmin.cli(Seq("user", "list", subject)).stdout.trim should 
startWith("no identities")
 
 Review comment:
   Hmm. The `list` utitility is to lookup namespaces in the first place. I 
could though alter the test to add a second subject in the same namespace and 
check that only one of them disappear from the namespace list. Would that make 
more sense?
   
   We don't have a "list namespaces per subject" command.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to