mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
Add uptime to ServiceStatus (#3690)
This commit is contained in:
committed by
Harshavardhana
parent
7547f3c8a3
commit
ce9aa2f2b2
@@ -25,6 +25,7 @@ import (
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
router "github.com/gorilla/mux"
|
||||
)
|
||||
@@ -55,6 +56,9 @@ func prepareAdminXLTestBed() (*adminXLTestBed, error) {
|
||||
return nil, xlErr
|
||||
}
|
||||
|
||||
// Initialize boot time
|
||||
globalBootTime = time.Now().UTC()
|
||||
|
||||
// Set globalEndpoints for a single node XL setup.
|
||||
for _, xlDir := range xlDirs {
|
||||
globalEndpoints = append(globalEndpoints, &url.URL{
|
||||
@@ -225,14 +229,13 @@ func testServicesCmdHandler(cmd cmdType, t *testing.T) {
|
||||
|
||||
if cmd == statusCmd {
|
||||
expectedInfo := ServerStatus{
|
||||
StorageInfo: newObjectLayerFn().StorageInfo(),
|
||||
ServerVersion: ServerVersion{Version: Version, CommitID: CommitID},
|
||||
}
|
||||
receivedInfo := ServerStatus{}
|
||||
if jsonErr := json.Unmarshal(rec.Body.Bytes(), &receivedInfo); jsonErr != nil {
|
||||
t.Errorf("Failed to unmarshal StorageInfo - %v", jsonErr)
|
||||
}
|
||||
if expectedInfo != receivedInfo {
|
||||
if expectedInfo.ServerVersion != receivedInfo.ServerVersion {
|
||||
t.Errorf("Expected storage info and received storage info differ, %v %v", expectedInfo, receivedInfo)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user