github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/integration/shared/isolated/create_quota_command_test.go (about)

     1  package isolated
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/integration/helpers"
     5  	. "github.com/onsi/ginkgo"
     6  	. "github.com/onsi/gomega"
     7  	. "github.com/onsi/gomega/gbytes"
     8  	. "github.com/onsi/gomega/gexec"
     9  )
    10  
    11  var _ = Describe("create-quota command", func() {
    12  	BeforeEach(func() {
    13  		helpers.LoginCF()
    14  		helpers.TargetOrgAndSpace(ReadOnlyOrg, ReadOnlySpace)
    15  	})
    16  
    17  	It("creates a quota", func() {
    18  		quotaName := helpers.QuotaName()
    19  		totalMemory := "24M"
    20  		instanceMemory := "6M"
    21  		routes := "8"
    22  		serviceInstances := "2"
    23  		appInstances := "3"
    24  		reservedRoutePorts := "1"
    25  		session := helpers.CF("create-quota", quotaName, "-m", totalMemory, "-i", instanceMemory, "-r", routes, "-s", serviceInstances, "-a", appInstances, "--allow-paid-service-plans", "--reserved-route-ports", reservedRoutePorts)
    26  		Eventually(session).Should(Say("Creating quota %s", quotaName))
    27  		Eventually(session).Should(Exit(0))
    28  
    29  		session = helpers.CF("quota", quotaName)
    30  		Eventually(session).Should(Say(`Total Memory\s+%s`, totalMemory))
    31  		Eventually(session).Should(Say(`Instance Memory\s+%s`, instanceMemory))
    32  		Eventually(session).Should(Say(`Routes\s+%s`, routes))
    33  		Eventually(session).Should(Say(`Services\s+%s`, serviceInstances))
    34  		Eventually(session).Should(Say(`Paid service plans\s+%s`, "allowed"))
    35  		Eventually(session).Should(Say(`App instance limit\s+%s`, appInstances))
    36  		Eventually(session).Should(Say(`Reserved Route Ports\s+%s`, reservedRoutePorts))
    37  		Eventually(session).Should(Exit(0))
    38  	})
    39  })