You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2017/08/01 22:12:05 UTC

[incubator-openwhisk-cli] 06/06: Add rule status to CLI rule list (#2474)

This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git

commit e78e76128e19b72bdeeec2e2b405f6e17c8bf521
Author: Jesus Alva <ja...@us.ibm.com>
AuthorDate: Mon Jul 31 13:50:31 2017 -0500

    Add rule status to CLI rule list  (#2474)
---
 tests/src/test/scala/system/basic/WskRuleTests.scala | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/src/test/scala/system/basic/WskRuleTests.scala b/tests/src/test/scala/system/basic/WskRuleTests.scala
index 3bfacd2..ae8768d 100644
--- a/tests/src/test/scala/system/basic/WskRuleTests.scala
+++ b/tests/src/test/scala/system/basic/WskRuleTests.scala
@@ -19,7 +19,6 @@ package system.basic
 
 import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner
-
 import common.TestHelpers
 import common.TestCLIUtils
 import common.Wsk
@@ -371,4 +370,23 @@ class WskRuleTests
             }
     }
 
+    it should "disable a rule and check its status is displayed when listed" in withAssetCleaner(wskprops) {
+        (wp, assetHelper) =>
+            val ruleName = withTimestamp("ruleDisable")
+            val ruleName2 = withTimestamp("ruleEnable")
+            val triggerName = withTimestamp("ruleDisableTrigger")
+            val actionName = withTimestamp("ruleDisableAction")
+
+            ruleSetup(Seq(
+                (ruleName, triggerName, (actionName, actionName, defaultAction)),
+                (ruleName2, triggerName, (actionName, actionName, defaultAction))),
+                assetHelper)
+
+            wsk.rule.disable(ruleName)
+            val listOutput = wsk.rule.list().stdout.lines
+            listOutput.find(_.contains(ruleName2)).get should (include(ruleName2) and include("active"))
+            listOutput.find(_.contains(ruleName)).get should (include(ruleName) and include("inactive"))
+            wsk.rule.list().stdout should not include ("Unknown")
+    }
+
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>.