[ Cmii ] [ Octopus ] - reformat agent-go - 1
This commit is contained in:
33
agent-go/a_status/Disk_test.go
Normal file
33
agent-go/a_status/Disk_test.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package a_status
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"testing"
|
||||
"wdd.io/agent-common/utils"
|
||||
)
|
||||
|
||||
func TestGetDiskStatus(t *testing.T) {
|
||||
|
||||
ds := GetDiskStatus()
|
||||
fmt.Printf("Total: %v, Used: %v\n", ds.Total, ds.Used)
|
||||
|
||||
marshalIndent, err := json.MarshalIndent(ds, "", " ")
|
||||
if err != nil {
|
||||
fmt.Printf("error")
|
||||
}
|
||||
|
||||
fmt.Println(string(marshalIndent))
|
||||
|
||||
}
|
||||
|
||||
func TestGetDiskInfo(t *testing.T) {
|
||||
|
||||
diskInfo, err := GetDiskInfo()
|
||||
if err != nil {
|
||||
t.Errorf("get disk info error ! => %v", err)
|
||||
}
|
||||
|
||||
utils.BeautifulPrint(diskInfo)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user