-
Notifications
You must be signed in to change notification settings - Fork 5
/
capacity_test.go
44 lines (36 loc) · 1.01 KB
/
capacity_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package garden_integration_tests_test
import (
"code.cloudfoundry.org/garden"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("Capacity", func() {
JustBeforeEach(func() {
skipIfWoot("Groot does not support capacity yet")
})
It("returns the memory in bytes", func() {
Eventually(func() uint64 {
return capacity().MemoryInBytes
}).Should(BeNumerically(">", 0))
})
It("returns the disk size in bytes", func() {
Eventually(func() uint64 {
return capacity().DiskInBytes
}).Should(BeNumerically(">", 0))
})
It("returns the schedulable disk capacity in bytes", func() {
Eventually(func() uint64 {
return capacity().SchedulableDiskInBytes
}).Should(BeNumerically(">", 0))
})
It("returns the maximum number of containers", func() {
Eventually(func() uint64 {
return capacity().MaxContainers
}).Should(BeNumerically(">", 0))
})
})
func capacity() garden.Capacity {
capacity, err := gardenClient.Capacity()
Expect(err).NotTo(HaveOccurred())
return capacity
}