@@ -61,6 +61,7 @@ const (
61
61
seedContainer2 = 5000
62
62
seedSandbox2 = 6000
63
63
seedContainer3 = 7000
64
+ seedSandbox3 = 8000
64
65
)
65
66
66
67
const (
@@ -112,12 +113,13 @@ func TestCRIListPodStats(t *testing.T) {
112
113
113
114
// Running pod with a terminated container and a running container
114
115
sandbox3 = makeFakePodSandbox ("sandbox3-name" , "sandbox3-uid" , "sandbox3-ns" , false )
115
- sandbox3Cgroup = "/" + cm .GetPodCgroupNameSuffix (types .UID (sandbox2 .PodSandboxStatus .Metadata .Uid ))
116
+ sandbox3Cgroup = "/" + cm .GetPodCgroupNameSuffix (types .UID (sandbox3 .PodSandboxStatus .Metadata .Uid ))
116
117
container5 = makeFakeContainer (sandbox3 , cName5 , 0 , true )
117
118
containerStats5 = makeFakeContainerStats (container5 , imageFsMountpoint )
118
119
containerLogStats5 = makeFakeLogStats (5000 )
119
120
container8 = makeFakeContainer (sandbox3 , cName8 , 0 , false )
120
121
containerStats8 = makeFakeContainerStats (container8 , imageFsMountpoint )
122
+ containerLogStats8 = makeFakeLogStats (6000 )
121
123
122
124
// Terminated pod sandbox
123
125
sandbox4 = makeFakePodSandbox ("sandbox1-name" , "sandbox1-uid" , "sandbox1-ns" , true )
@@ -179,7 +181,7 @@ func TestCRIListPodStats(t *testing.T) {
179
181
container0 , container1 , container2 , container3 , container4 , container5 , container6 , container7 , container8 ,
180
182
})
181
183
fakeRuntimeService .SetFakeContainerStats ([]* runtimeapi.ContainerStats {
182
- containerStats0 , containerStats1 , containerStats2 , containerStats3 , containerStats4 , containerStats5 , containerStats6 , containerStats7 , containerStats8
184
+ containerStats0 , containerStats1 , containerStats2 , containerStats3 , containerStats4 , containerStats5 , containerStats6 , containerStats7 , containerStats8 ,
183
185
})
184
186
185
187
ephemeralVolumes := makeFakeVolumeStats ([]string {"ephVolume1, ephVolumes2" })
@@ -195,6 +197,7 @@ func TestCRIListPodStats(t *testing.T) {
195
197
kuberuntime .BuildContainerLogsDirectory ("sandbox1-ns" , "sandbox1-name" , types .UID ("sandbox1-uid" ), cName2 ): containerLogStats2 ,
196
198
kuberuntime .BuildContainerLogsDirectory ("sandbox2-ns" , "sandbox2-name" , types .UID ("sandbox2-uid" ), cName3 ): containerLogStats4 ,
197
199
kuberuntime .BuildContainerLogsDirectory ("sandbox3-ns" , "sandbox3-name" , types .UID ("sandbox3-uid" ), cName5 ): containerLogStats5 ,
200
+ kuberuntime .BuildContainerLogsDirectory ("sandbox3-ns" , "sandbox3-name" , types .UID ("sandbox3-uid" ), cName8 ): containerLogStats8 ,
198
201
filepath .Join (kuberuntime .BuildPodLogsDirectory ("sandbox0-ns" , "sandbox0-name" , types .UID ("sandbox0-uid" )), podLogName0 ): podLogStats0 ,
199
202
filepath .Join (kuberuntime .BuildPodLogsDirectory ("sandbox1-ns" , "sandbox1-name" , types .UID ("sandbox1-uid" )), podLogName1 ): podLogStats1 ,
200
203
}
@@ -339,7 +342,7 @@ func TestCRIListPodCPUAndMemoryStats(t *testing.T) {
339
342
340
343
// Running pod with a terminated container and a running container
341
344
sandbox3 = makeFakePodSandbox ("sandbox3-name" , "sandbox3-uid" , "sandbox3-ns" , false )
342
- sandbox3Cgroup = "/" + cm .GetPodCgroupNameSuffix (types .UID (sandbox2 .PodSandboxStatus .Metadata .Uid ))
345
+ sandbox3Cgroup = "/" + cm .GetPodCgroupNameSuffix (types .UID (sandbox3 .PodSandboxStatus .Metadata .Uid ))
343
346
container5 = makeFakeContainer (sandbox3 , cName5 , 0 , true )
344
347
containerStats5 = makeFakeContainerStats (container5 , imageFsMountpoint )
345
348
container8 = makeFakeContainer (sandbox3 , cName8 , 0 , false )
0 commit comments