forked from oracle/oci-cloud-controller-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblock_volume_creation.go
53 lines (45 loc) · 2.66 KB
/
block_volume_creation.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
51
52
53
// Copyright 2018 Oracle and/or its affiliates. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package e2e
import (
. "github.com/onsi/ginkgo"
"github.com/oracle/oci-cloud-controller-manager/pkg/volume/provisioner/block"
"github.com/oracle/oci-cloud-controller-manager/pkg/volume/provisioner/core"
"github.com/oracle/oci-cloud-controller-manager/test/e2e/framework"
)
var _ = Describe("Block Volume Creation", func() {
f := framework.NewDefaultFramework("block-basic")
Context("[cloudprovider][storage][fvp]", func() {
It("Should be possible to create a persistent volume claim for a block storage (PVC)", func() {
pvcJig := framework.NewPVCTestJig(f.ClientSet, "volume-provisioner-e2e-tests-pvc")
scName := f.CreateStorageClassOrFail(framework.ClassOCI, core.ProvisionerNameDefault, nil, pvcJig.Labels, "", false, "Delete", nil)
pvc := pvcJig.CreateAndAwaitPVCOrFail(f.Namespace.Name, framework.MinVolumeBlock, scName, setupF.AdLabel, nil)
f.VolumeIds = append(f.VolumeIds, pvc.Spec.VolumeName)
})
It("Should be possible to create a persistent volume claim (PVC) for a block storage of Ext3 file system ", func() {
pvcJig := framework.NewPVCTestJig(f.ClientSet, "volume-provisioner-e2e-tests-pvc")
scName := f.CreateStorageClassOrFail(f.Namespace.Name, core.ProvisionerNameDefault, map[string]string{block.FSType: "ext3"}, pvcJig.Labels, "", false, "Delete", nil)
f.StorageClasses = append(f.StorageClasses, scName)
pvc := pvcJig.CreateAndAwaitPVCOrFail(f.Namespace.Name, framework.MinVolumeBlock, scName, setupF.AdLabel, nil)
f.VolumeIds = append(f.VolumeIds, pvc.Spec.VolumeName)
_ = f.DeleteStorageClass(f.Namespace.Name)
})
It("Should be possible to create a persistent volume claim (PVC) for a block storage with no AD specified ", func() {
pvcJig := framework.NewPVCTestJig(f.ClientSet, "volume-provisioner-e2e-tests-pvc")
scName := f.CreateStorageClassOrFail(framework.ClassOCI, core.ProvisionerNameDefault, nil, pvcJig.Labels, "", false, "Delete", nil)
pvc := pvcJig.CreateAndAwaitPVCOrFail(f.Namespace.Name, framework.MinVolumeBlock, scName, "", nil)
f.VolumeIds = append(f.VolumeIds, pvc.Spec.VolumeName)
})
})
})