mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Allow volume test to run outside an actual OpenStack VM
This commit is contained in:
parent
f5299fe7e1
commit
076f4da28b
@ -526,9 +526,8 @@ func TestVolumes(t *testing.T) {
|
|||||||
|
|
||||||
id, err := os.InstanceID()
|
id, err := os.InstanceID()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Cannot find instance id: %v", err)
|
t.Logf("Cannot find instance id: %v - perhaps you are running this test outside a VM launched by OpenStack", err)
|
||||||
}
|
} else {
|
||||||
|
|
||||||
diskId, err := os.AttachDisk(id, vol)
|
diskId, err := os.AttachDisk(id, vol)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Cannot AttachDisk Cinder volume %s: %v", vol, err)
|
t.Fatalf("Cannot AttachDisk Cinder volume %s: %v", vol, err)
|
||||||
@ -550,6 +549,7 @@ func TestVolumes(t *testing.T) {
|
|||||||
t.Logf("Volume (%s) detached\n", vol)
|
t.Logf("Volume (%s) detached\n", vol)
|
||||||
|
|
||||||
WaitForVolumeStatus(t, os, vol, volumeAvailableStatus)
|
WaitForVolumeStatus(t, os, vol, volumeAvailableStatus)
|
||||||
|
}
|
||||||
|
|
||||||
err = os.DeleteVolume(vol)
|
err = os.DeleteVolume(vol)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user