Skip to content

Commit

Permalink
generate unique name for pv/pvc in storage and migration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Vladik Romanovsky <[email protected]>
  • Loading branch information
vladikr committed Dec 14, 2018
1 parent f10ec59 commit 25524ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tests/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/rand"

v1 "kubevirt.io/kubevirt/pkg/api/v1"
"kubevirt.io/kubevirt/pkg/kubecli"
Expand Down Expand Up @@ -148,9 +149,9 @@ var _ = Describe("Migrations", func() {
})
})
Context("with an Alpine shared ISCSI PVC", func() {
pvName := "test-iscsi-lun"

var pvName string
BeforeEach(func() {
pvName = "test-iscsi-lun" + rand.String(48)
// Start a ISCSI POD and service
By("Starting an iSCSI POD")
iscsiIP := tests.CreateISCSITargetPOD()
Expand Down Expand Up @@ -190,7 +191,7 @@ var _ = Describe("Migrations", func() {
vmi := tests.NewRandomVMIWithPVC(pvName)

By("Starting the VirtualMachineInstance")
vmi = runVMIAndExpectLaunch(vmi, 120)
vmi = runVMIAndExpectLaunch(vmi, 180)

By("Checking that the VirtualMachineInstance console has expected output")
expecter, err := tests.LoggedInAlpineExpecter(vmi)
Expand Down
2 changes: 1 addition & 1 deletion tests/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ var _ = Describe("Storage", func() {

Context("With Alpine ISCSI PVC", func() {

pvName := "test-iscsi-lun"
pvName := "test-iscsi-lun" + rand.String(48)

BeforeEach(func() {
// Start a ISCSI POD and service
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,7 @@ func newISCSIPV(name string, size string, iscsiTargetIP string) *k8sv1.Persisten
"storage": quantity,
},
ClaimRef: &k8sv1.ObjectReference{
Name: "test-iscsi-lun",
Name: name,
Namespace: NamespaceTestDefault,
},
StorageClassName: storageClass,
Expand Down

0 comments on commit 25524ea

Please sign in to comment.