rabbah commented on a change in pull request #3950: Extend system testsuite
URL:
https://github.com/apache/incubator-openwhisk/pull/3950#discussion_r209900210
##########
File path: tests/src/test/scala/whisk/core/cli/test/WskEntitlementTests.scala
##########
@@ -160,6 +160,46 @@ abstract class WskEntitlementTests extends TestHelpers
with WskTestHelpers with
}
}
+ it should "list shared packages when package is turned into public" in
withAssetCleaner(guestWskProps) {
+ (wp, assetHelper) =>
+ assetHelper.withCleaner(wsk.pkg, samplePackage) { (pkg, _) =>
+ pkg.create(samplePackage)(wp)
+ }
+
+ retry {
+ val packageList =
wsk.pkg.list(Some(s"/$guestNamespace"))(defaultWskProps)
+ verifyPackageNotSharedList(packageList, guestNamespace, samplePackage)
+ }
+
+ wsk.pkg.create(samplePackage, update = true, shared = Some(true))(wp)
+
+ retry {
+ val packageList =
wsk.pkg.list(Some(s"/$guestNamespace"))(defaultWskProps)
+ verifyPackageSharedList(packageList, guestNamespace, samplePackage)
+ }
+ }
+
+ it should "not list any packages from invalid namespace" in
withAssetCleaner(guestWskProps) { (wp, assetHelper) =>
+ val invalidNamespace = "whisk.systsdf"
+ retry {
+ val packageList = wsk.pkg.list(Some(s"/$invalidNamespace"))(wp)
+ packageList.stdout should be("[]") //empty list
+ }
+ }
+
+ it should "reject getting package from invalid namespace" in
withAssetCleaner(guestWskProps) { (wp, assetHelper) =>
+ val invalidNamespace = "whisk.systsdf"
+ wsk.pkg.get(s"/${invalidNamespace}/utils", expectedExitCode =
forbiddenCode)(wp).stderr should include(
+ "not authorized")
+ }
+
+ it should "reject getting invalid package from valid namespace" in
withAssetCleaner(guestWskProps) {
+ (wp, assetHelper) =>
+ val invalidPackage = "utilssss"
+ wsk.pkg.get(s"/whisk.system/${invalidPackage}", expectedExitCode =
forbiddenCode)(wp).stderr should include(
+ "not authorized")
+ }
Review comment:
👍👍
----------------------------------------------------------------
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