Commit 980e2f41 authored by Zhu Yong's avatar Zhu Yong
Browse files

add test case for GetLog, tested OK

parent 1953abee
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -83,4 +83,5 @@ type GetLogCallback struct {

func (c *GetLogCallback) Success(resp *kproto.Command, value []byte) {
	c.GenericCallback.Success(resp, value)
	c.Logs = getLogFromProto(resp)
}
+17 −0
Original line number Diff line number Diff line
@@ -113,3 +113,20 @@ func TestNonBlockGetKeyRange(t *testing.T) {
		t.Logf("key[%d] = %s", k, string(key))
	}
}

func TestNonBlockGetLog(t *testing.T) {
	logs := []LogType{
		LOG_UTILIZATIONS,
		LOG_TEMPERATURES,
		LOG_CAPACITIES,
		LOG_CONFIGURATION,
		LOG_STATISTICS,
		LOG_MESSAGES,
		LOG_LIMITS,
	}
	klogs, status, err := blockConn.GetLog(logs)
	if err != nil || status.Code != OK {
		t.Fatal("Nonblocking GetLog Failure")
	}
	t.Logf("GetLog %+v", klogs)
}