@@ -954,13 +954,31 @@ var _ = Describe("[sriov] operator", Ordered, func() {
954954 pod .DefineWithNetworks ([]string {sriovNetworkName , sriovNetworkName , sriovNetworkName , sriovNetworkName , sriovNetworkName }),
955955 node ,
956956 )
957+ By ("Checking the sriov resource does not exist in resource request and limit spec" )
958+ _ , exist := testPodA .Spec .Containers [0 ].Resources .Requests [corev1 .ResourceName (fmt .Sprintf ("openshift.io/%s" , resourceName ))]
959+ Expect (exist ).To (BeFalse ())
960+ _ , exist = testPodA .Spec .Containers [0 ].Resources .Limits [corev1 .ResourceName (fmt .Sprintf ("openshift.io/%s" , resourceName ))]
961+ Expect (exist ).To (BeFalse ())
962+
957963 runningPodA , err := clients .Pods (testPodA .Namespace ).Create (context .Background (), testPodA , metav1.CreateOptions {})
958964 Expect (err ).ToNot (HaveOccurred (), fmt .Sprintf ("Error to create pod %s" , testPodA .Name ))
959965 By ("Checking that first Pod is in Running state" )
960966 runningPodA = waitForPodRunning (runningPodA )
961967
962- By ("Create second Pod which consumes one more VF" )
968+ By ("Checking the sriov resource has the right number of devices has been injected to resource request and limit spec" )
969+ Expect (len (runningPodA .Spec .Containers )).To (Equal (1 ))
970+ resource , exist := runningPodA .Spec .Containers [0 ].Resources .Requests [corev1 .ResourceName (fmt .Sprintf ("openshift.io/%s" , resourceName ))]
971+ Expect (exist ).To (BeTrue ())
972+ amount , valid := resource .AsInt64 ()
973+ Expect (valid ).To (BeTrue ())
974+ Expect (amount ).To (Equal (int64 (5 )))
975+ resource , exist = runningPodA .Spec .Containers [0 ].Resources .Limits [corev1 .ResourceName (fmt .Sprintf ("openshift.io/%s" , resourceName ))]
976+ Expect (exist ).To (BeTrue ())
977+ amount , valid = resource .AsInt64 ()
978+ Expect (valid ).To (BeTrue ())
979+ Expect (amount ).To (Equal (int64 (5 )))
963980
981+ By ("Create second Pod which consumes one more VF" )
964982 testPodB := pod .RedefineWithNodeSelector (
965983 pod .DefineWithNetworks ([]string {sriovNetworkName }),
966984 node ,
0 commit comments