Skip to content

Commit

Permalink
feat: make TestCreateBackup test full backup creation
Browse files Browse the repository at this point in the history
  • Loading branch information
stijzermans committed Aug 2, 2024
1 parent f381894 commit 32fa9ac
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/cinder/block_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func TestGetVolumeBackups(t *testing.T) {

func TestCreateBackup(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
defer th.TeardownHTTP()

backupID := "d32019d3-bc6e-4319-9c1d-6722fc136a22"
var createRequest *CreateIncrementalBackupRequest
Expand Down Expand Up @@ -380,10 +380,18 @@ func TestCreateBackup(t *testing.T) {

for _, tt := range tests {
handleGetVolume(t, tt.volumeID)
store.createBackup(tt.volumeID, "default", map[string]string{})
createdBackupID, err := store.createBackup(tt.volumeID, "default", map[string]string{})

if createRequest.Backup.Incremental != tt.expectedIncrementalValue {
t.Errorf("expected incremental backup to be set to %v, got %v", tt.expectedIncrementalValue, createRequest.Backup.Incremental)
}

if createdBackupID != backupID {
t.Errorf("expected created backup ID to be %v, got %v", backupID, createdBackupID)
}

if !assert.Nil(t, err) {
t.FailNow()
}
}
}

0 comments on commit 32fa9ac

Please sign in to comment.