Skip to content

Commit 7c12251

Browse files
committed
e2e: topomgr: add multi-container tests
Add tests to check alignment of pods which contains more than one container. Signed-off-by: Francesco Romani <[email protected]>
1 parent 8e9d76f commit 7c12251

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

test/e2e_node/topology_manager_test.go

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,69 @@ func runTopologyManagerNodeAlignmentSuiteTests(f *framework.Framework, configMap
778778
// testing more complex conditions require knowledge about the system cpu+bus topology
779779
}
780780

781+
// multi-container tests
782+
if sriovResourceAmount >= 4 {
783+
ginkgo.By(fmt.Sprintf("Successfully admit one guaranteed pods, each with two containers, each with 2 cores, 1 %s device", sriovResourceName))
784+
ctnAttrs = []tmCtnAttribute{
785+
{
786+
ctnName: "gu-container-0",
787+
cpuRequest: "2000m",
788+
cpuLimit: "2000m",
789+
deviceName: sriovResourceName,
790+
deviceRequest: "1",
791+
deviceLimit: "1",
792+
},
793+
{
794+
ctnName: "gu-container-1",
795+
cpuRequest: "2000m",
796+
cpuLimit: "2000m",
797+
deviceName: sriovResourceName,
798+
deviceRequest: "1",
799+
deviceLimit: "1",
800+
},
801+
}
802+
runTopologyManagerPositiveTest(f, 1, ctnAttrs, hwinfo)
803+
804+
ginkgo.By(fmt.Sprintf("Successfully admit two guaranteed pods, each with two containers, each with 1 core, 1 %s device", sriovResourceName))
805+
ctnAttrs = []tmCtnAttribute{
806+
{
807+
ctnName: "gu-container-0",
808+
cpuRequest: "1000m",
809+
cpuLimit: "1000m",
810+
deviceName: sriovResourceName,
811+
deviceRequest: "1",
812+
deviceLimit: "1",
813+
},
814+
{
815+
ctnName: "gu-container-1",
816+
cpuRequest: "1000m",
817+
cpuLimit: "1000m",
818+
deviceName: sriovResourceName,
819+
deviceRequest: "1",
820+
deviceLimit: "1",
821+
},
822+
}
823+
runTopologyManagerPositiveTest(f, 2, ctnAttrs, hwinfo)
824+
825+
ginkgo.By(fmt.Sprintf("Successfully admit two guaranteed pods, each with two containers, both with with 2 cores, one with 1 %s device", sriovResourceName))
826+
ctnAttrs = []tmCtnAttribute{
827+
{
828+
ctnName: "gu-container-dev",
829+
cpuRequest: "2000m",
830+
cpuLimit: "2000m",
831+
deviceName: sriovResourceName,
832+
deviceRequest: "1",
833+
deviceLimit: "1",
834+
},
835+
{
836+
ctnName: "gu-container-nodev",
837+
cpuRequest: "2000m",
838+
cpuLimit: "2000m",
839+
},
840+
}
841+
runTopologyManagerPositiveTest(f, 2, ctnAttrs, hwinfo)
842+
}
843+
781844
// overflow NUMA node capacity: cores
782845
numCores := 1 + (threadsPerCore * coreCount)
783846
excessCoresReq := fmt.Sprintf("%dm", numCores*1000)

0 commit comments

Comments
 (0)