Skip to content

Commit

Permalink
connectivity: Add GetTest method
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Falzoi <[email protected]>
  • Loading branch information
pippolo84 committed May 9, 2023
1 parent 9d451a5 commit dc880c2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions connectivity/check/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,22 @@ func (ct *ConnectivityTest) NewTest(name string) *Test {
return t
}

// GetTest returns the test scope for test named "name" if found,
// a non-nil error otherwise.
func (ct *ConnectivityTest) GetTest(name string) (*Test, error) {
if _, ok := ct.testNames[name]; !ok {
return nil, fmt.Errorf("test %s not found", name)
}

for _, t := range ct.tests {
if t.name == name {
return t, nil
}
}

panic("missing test descriptor for a registered name")
}

// SetupAndValidate sets up and validates the connectivity test infrastructure
// such as the client pods and validates the deployment of them along with
// Cilium. This must be run before Run() is called.
Expand Down

0 comments on commit dc880c2

Please sign in to comment.