openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk-cli] 06/06: Add rule status to CLI rule list (#2474)
Date Tue, 01 Aug 2017 22:12:05 GMT
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 <jalva@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" <commits@openwhisk.apache.org>.

Mime
View raw message