Deprecate showing drive capacity and total free (#5976)

This addresses a situation that we shouldn't be
displaying Total/Free anymore, instead we should simply
show the total usage.
This commit is contained in:
Harshavardhana
2018-05-23 17:30:25 -07:00
committed by kannappanr
parent e6ec645035
commit 000e360196
15 changed files with 54 additions and 163 deletions

View File

@@ -25,20 +25,16 @@ import (
"strings"
"testing"
"time"
humanize "github.com/dustin/go-humanize"
)
// Tests if we generate storage info.
func TestStorageInfoMsg(t *testing.T) {
infoStorage := StorageInfo{}
infoStorage.Total = 10 * humanize.GiByte
infoStorage.Free = 2 * humanize.GiByte
infoStorage.Backend.Type = Erasure
infoStorage.Backend.OnlineDisks = 7
infoStorage.Backend.OfflineDisks = 1
if msg := getStorageInfoMsg(infoStorage); !strings.Contains(msg, "2.0 GiB Free, 10 GiB Total") || !strings.Contains(msg, "7 Online, 1 Offline") {
if msg := getStorageInfoMsg(infoStorage); !strings.Contains(msg, "7 Online, 1 Offline") {
t.Fatal("Unexpected storage info message, found:", msg)
}
}