Skip to content

Commit b6b98b5

Browse files
committed
adaptation: test with populated initial resources.
The current tests for collecting container resource adjustments starts out with fully empty container memory and CPU resources. This allows unintended changes to sneak in to the semantics of collected adjustments. Let's make this less likely by starting with populated initial resources. Signed-off-by: Krisztian Litkey <[email protected]>
1 parent d3daead commit b6b98b5

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

pkg/adaptation/adaptation_suite_test.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,25 @@ var _ = Describe("Plugin container creation adjustments", func() {
628628
"argument",
629629
"list",
630630
},
631+
Linux: &api.LinuxContainer{
632+
Resources: &api.LinuxResources{
633+
Cpu: &api.LinuxCPU{
634+
Shares: api.UInt64(111),
635+
Quota: api.Int64(222),
636+
Period: api.UInt64(333),
637+
RealtimeRuntime: api.Int64(444),
638+
RealtimePeriod: api.UInt64(555),
639+
},
640+
Memory: &api.LinuxMemory{
641+
Limit: api.Int64(11111),
642+
Reservation: api.Int64(22222),
643+
Swap: api.Int64(33333),
644+
Swappiness: api.UInt64(44444),
645+
DisableOomKiller: api.Bool(false),
646+
UseHierarchy: api.Bool(false),
647+
},
648+
},
649+
},
631650
}
632651
)
633652

@@ -904,6 +923,25 @@ var _ = Describe("Plugin container creation adjustments", func() {
904923
"argument",
905924
"list",
906925
},
926+
Linux: &api.LinuxContainer{
927+
Resources: &api.LinuxResources{
928+
Cpu: &api.LinuxCPU{
929+
Shares: api.UInt64(111),
930+
Quota: api.Int64(222),
931+
Period: api.UInt64(333),
932+
RealtimeRuntime: api.Int64(444),
933+
RealtimePeriod: api.UInt64(555),
934+
},
935+
Memory: &api.LinuxMemory{
936+
Limit: api.Int64(11111),
937+
Reservation: api.Int64(22222),
938+
Swap: api.Int64(33333),
939+
Swappiness: api.UInt64(44444),
940+
DisableOomKiller: api.Bool(false),
941+
UseHierarchy: api.Bool(false),
942+
},
943+
},
944+
},
907945
}
908946
)
909947

0 commit comments

Comments
 (0)