Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
Signed-off-by: tombokombo <[email protected]>
  • Loading branch information
tombokombo committed Mar 12, 2022
1 parent cdd6f29 commit b316860
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cgroup/cgroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ func TestContainerByCgroup(t *testing.T) {
as.Equal("63425c4a8b4291744a79dd9011fddc7a1f8ffda61f65d72196aa01d00cae2e2e", id)
as.Nil(err)

typ, id, err = containerByCgroup("/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod3e61c214bc3ed9ff81e21474dd6cba17.slice/cri-containerd-c74b0f5062f0bc726cae1e9369ad4a95deed6b298d247f0407475adb23fa3190")
as.Equal(typ, ContainerTypeContainerd)
as.Equal("c74b0f5062f0bc726cae1e9369ad4a95deed6b298d247f0407475adb23fa3190", id)
as.Nil(err)

typ, id, err = containerByCgroup("/system.slice/system-serial\\x2dgetty.slice")
as.Equal(typ, ContainerTypeSystemdService)
as.Equal("/system.slice/system-serial\\x2dgetty.slice", id)
Expand Down

0 comments on commit b316860

Please sign in to comment.