Skip to content

Commit 321a140

Browse files
author
Sam Stenvall
committed
Hopefully fix the CD-ROM integration tests for real by performing all operations while the server is stopped
1 parent 3c77609 commit 321a140

1 file changed

Lines changed: 0 additions & 35 deletions

File tree

upcloud/service/service_test.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,9 @@ func TestTemplatizeServerStorage(t *testing.T) {
354354
// - creates a server
355355
// - stops the server
356356
// - attaches a CD-ROM device
357-
// - starts the server
358357
// - loads a CD-ROM
359-
// - stops the server
360358
// - ejects the CD-ROM
361-
// - deletes the server
362359
func TestLoadEjectCDROM(t *testing.T) {
363-
//t.Skip("Skipping test because the API returns a lot of GENERAL_FAILURE and CDROM_EJECT_FAILED errors")
364360
if testing.Short() {
365361
t.Skip("Skipping test in short mode")
366362
}
@@ -385,24 +381,6 @@ func TestLoadEjectCDROM(t *testing.T) {
385381
handleError(err)
386382
t.Log("CD-ROM is now attached")
387383

388-
// Start the server
389-
t.Logf("Starting server with UUID %s", serverDetails.UUID)
390-
serverDetails, err = svc.StartServer(&request.StartServerRequest{
391-
UUID: serverDetails.UUID,
392-
Timeout: time.Minute * 5,
393-
})
394-
395-
handleError(err)
396-
397-
serverDetails, err = svc.WaitForServerState(&request.WaitForServerStateRequest{
398-
UUID: serverDetails.UUID,
399-
DesiredState: upcloud.ServerStateStarted,
400-
Timeout: time.Minute * 5,
401-
})
402-
403-
handleError(err)
404-
t.Log("Server is now started")
405-
406384
// Load the CD-ROM
407385
t.Log("Loading CD-ROM into CD-ROM device")
408386
serverDetails, err = svc.LoadCDROM(&request.LoadCDROMRequest{
@@ -413,19 +391,6 @@ func TestLoadEjectCDROM(t *testing.T) {
413391
handleError(err)
414392
t.Log("CD-ROM is now loaded")
415393

416-
// Wait for the server to leave maintenance state before stopping it
417-
t.Logf("Waiting for server with UUID %s to leave maintenance state ...", serverDetails.UUID)
418-
serverDetails, err = svc.WaitForServerState(&request.WaitForServerStateRequest{
419-
UUID: serverDetails.UUID,
420-
UndesiredState: upcloud.ServerStateMaintenance,
421-
Timeout: time.Minute * 5,
422-
})
423-
handleError(err)
424-
425-
// Stop the server (apparently the CD-ROM cannot be ejected while it's running)
426-
t.Logf("Waiting for the server with UUID %s to stop ...", serverDetails.UUID)
427-
stopServer(serverDetails.UUID)
428-
429394
// Eject the CD-ROM
430395
t.Log("Ejecting CD-ROM from CD-ROM device")
431396
serverDetails, err = svc.EjectCDROM(&request.EjectCDROMRequest{

0 commit comments

Comments
 (0)