From 5c5f6e8fe2f8c4186ac4a06ba60f541293ea6849 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Thu, 8 Jun 2023 12:00:06 +0300 Subject: [PATCH] DRA Node E2E: add NodePrepareResourceCalled API --- test/e2e/dra/test-driver/app/gomega.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/e2e/dra/test-driver/app/gomega.go b/test/e2e/dra/test-driver/app/gomega.go index 4caa7805041..7bb70984652 100644 --- a/test/e2e/dra/test-driver/app/gomega.go +++ b/test/e2e/dra/test-driver/app/gomega.go @@ -17,6 +17,8 @@ limitations under the License. package app import ( + "strings" + "github.com/onsi/gomega/gcustom" ) @@ -30,3 +32,13 @@ var BeRegistered = gcustom.MakeMatcher(func(actualCalls []GRPCCall) (bool, error } return false, nil }).WithMessage("contain successful NotifyRegistrationStatus call") + +// NodePrepareResouceCalled checks that NodePrepareResource API has been called +var NodePrepareResourceCalled = gcustom.MakeMatcher(func(actualCalls []GRPCCall) (bool, error) { + for _, call := range actualCalls { + if strings.HasSuffix(call.FullMethod, "/NodePrepareResource") && call.Err == nil { + return true, nil + } + } + return false, nil +}).WithMessage("contain NodePrepareResource call")