forked from rexray/rexray
/
tests_volume.go
50 lines (40 loc) · 1.38 KB
/
tests_volume.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
45
46
47
48
49
50
package tests
func (t *testRunner) justBeforeEachVolumeSpec() {
t.vol, t.err = t.client.Storage().VolumeCreate(
t.ctx, t.volName, t.volCreateOpts())
t.Θ(t.vol, t.err)
}
func (t *testRunner) afterEachVolumeSpec() {
if t.vol == nil {
return
}
t.Ε(t.client.Storage().VolumeRemove(t.ctx, t.vol.ID, t.volRemoveOpts()))
t.vol = nil
}
func (t *testRunner) itVolumeSpecInspect() {
t.Θ(t.client.Storage().VolumeInspect(t.ctx, t.vol.ID, t.volInsOpts()))
}
func (t *testRunner) itVolumeSpecDelete() {
t.Ε(t.client.Storage().VolumeRemove(t.ctx, t.vol.ID, t.volRemoveOpts()))
t.vol = nil
}
func (t *testRunner) itVolumeSpecAttach() {
t.Α(t.client.Storage().VolumeAttach(t.ctx, t.vol.ID, t.volAttOpts()))
}
func (t *testRunner) justBeforeEachAttVolumeSpec() {
t.vol, t.nextDev, t.err = t.client.Storage().VolumeAttach(
t.ctx, t.vol.ID, t.volAttOpts())
t.Α(t.vol, t.nextDev, t.err)
}
func (t *testRunner) itAttVolumeSpecInspect() {
t.ΘΑ(t.client.Storage().VolumeInspect(t.ctx, t.vol.ID, t.volInsOpts(1)))
}
func (t *testRunner) itAttVolumeSpecInspectAvai() {
t.Ξ(t.client.Storage().VolumeInspect(t.ctx, t.vol.ID, t.volInsOpts(17)))
}
func (t *testRunner) itAttVolumeSpecInspectAttOrAvai() {
t.ΘΑ(t.client.Storage().VolumeInspect(t.ctx, t.vol.ID, t.volInsOpts(27)))
}
func (t *testRunner) itAttVolumeSpecDetach() {
t.Θ(t.client.Storage().VolumeDetach(t.ctx, t.vol.ID, t.volDetOpts()))
}