Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #184 from lpabon/t165
Browse files Browse the repository at this point in the history
Test storage is returned to device
  • Loading branch information
Luis Pabón committed Sep 1, 2015
2 parents 7e0976b + 4ee70f2 commit cd13fd8
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions apps/glusterfs/volume_entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1076,16 +1076,27 @@ func TestVolumeEntryDestroy(t *testing.T) {
tests.Assert(t, err == nil)

// Check database volume does not exist
var bricks []string
err = app.db.View(func(tx *bolt.Tx) error {
bricks, err = BrickList(tx)
return err

// Check that all devices have no used data
devices, err := DeviceList(tx)
tests.Assert(t, err == nil)
for _, id := range devices {
device, err := NewDeviceEntryFromId(tx, id)
tests.Assert(t, err == nil)
tests.Assert(t, device.Info.Storage.Used == 0)
tests.Assert(t, device.Info.Storage.Total == device.Info.Storage.Free)
}

// Check there are no bricks
bricks, err := BrickList(tx)
tests.Assert(t, len(bricks) == 0)

return nil

})
tests.Assert(t, err == nil)

// Check that there are no bricks
tests.Assert(t, len(bricks) == 0)

// Check that the devices have no bricks
err = app.db.View(func(tx *bolt.Tx) error {
devices, err := DeviceList(tx)
Expand Down

0 comments on commit cd13fd8

Please sign in to comment.