Files
docker-cli/components/cli/command/container/stats_unit_test.go
Boaz Shuster a8c10a8cb0 Add the format switch to the stats command
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: a4f3442403
Component: cli
2016-09-18 14:16:13 +03:00

21 lines
483 B
Go

package container
import (
"testing"
"github.com/docker/docker/api/types"
)
func TestCalculBlockIO(t *testing.T) {
blkio := types.BlkioStats{
IoServiceBytesRecursive: []types.BlkioStatEntry{{8, 0, "read", 1234}, {8, 1, "read", 4567}, {8, 0, "write", 123}, {8, 1, "write", 456}},
}
blkRead, blkWrite := calculateBlockIO(blkio)
if blkRead != 5801 {
t.Fatalf("blkRead = %d, want 5801", blkRead)
}
if blkWrite != 579 {
t.Fatalf("blkWrite = %d, want 579", blkWrite)
}
}