Documentation ¶
Index ¶
- Constants
- func RandString(n int) string
- type AppIDManager
- func (m *AppIDManager) DiscoveryURL() string
- func (m *AppIDManager) LoginToCloudDirectory(t *testing.T, root string, path string, output interface{}) error
- func (m *AppIDManager) OK() bool
- func (m *AppIDManager) PublicKeysURL() string
- func (m *AppIDManager) ROP(username string, password string) error
- func (m *AppIDManager) TokenURL() string
- type CRD
- type CRDManager
- type Context
- type Env
- type ModifierFn
- type Suite
- type Test
Constants ¶
const ( DefaultUsername = "username@ibm.com" DefaultPassword = "password" )
const ( JwtConfigTemplate = templatesDir + "/jwtconfig.yaml" OidcConfigTemplate = templatesDir + "/oidcconfig.yaml" PolicyTemplate = templatesDir + "/policy.yaml" )
Variables ¶
This section is empty.
Functions ¶
func RandString ¶
Types ¶
type AppIDManager ¶
type AppIDManager struct { ClientID string ClientSecret string OAuthServerURL string Tokens *authserver.TokenResponse // contains filtered or unexported fields }
AppIDManager models the authorization server
func NewAppIDManager ¶
func NewAppIDManager() *AppIDManager
NewAppIDManager creates a new manager from environment variables
func (*AppIDManager) DiscoveryURL ¶
func (m *AppIDManager) DiscoveryURL() string
DiscoveryURL returns the well known URL of the AppIDManager
func (*AppIDManager) LoginToCloudDirectory ¶
func (m *AppIDManager) LoginToCloudDirectory(t *testing.T, root string, path string, output interface{}) error
LoginToCloudDirectory logs in through an App ID cloud directory login widget returning the result from the login page
func (*AppIDManager) PublicKeysURL ¶
func (m *AppIDManager) PublicKeysURL() string
PublicKeysURL returns the public keys URL of the AppIDManager
func (*AppIDManager) ROP ¶
func (m *AppIDManager) ROP(username string, password string) error
ROP issues an ROP token flow again the authorization server instance
func (*AppIDManager) TokenURL ¶
func (m *AppIDManager) TokenURL() string
TokenURL returns the token URL of the AppIDManager
type CRDManager ¶
type CRDManager struct {
// contains filtered or unexported fields
}
CRD Manager maintains Kubernetes CRDs locally and provides helper methods create/update/delete them
func (*CRDManager) AddCRD ¶
func (m *CRDManager) AddCRD(pathToTemplate string, data CRD) error
AddCRD adds a custom resource definition from a given file
func (*CRDManager) CleanUp ¶
func (m *CRDManager) CleanUp() error
CleanUp delete stored CRDs from Kubernetes then purges the local store
func (*CRDManager) DeleteCRD ¶
func (m *CRDManager) DeleteCRD(savedCRD CRD) error
DeleteCRD deletes a custom resource definition using a given CRD
type Context ¶
type Context struct { CRDManager *CRDManager AppIDManager *AppIDManager Env *Env SessionCookie *http.Cookie // contains filtered or unexported fields }
Context models the test environment
func NewContext ¶
NewContext creates a new test suite context
func (*Context) EnableRedirects ¶
func (c *Context) EnableRedirects()
EnableRedirects configures the default client to follow HTTP redirects
func (*Context) SendRequest ¶
func (c *Context) SendRequest(method string, path string, headers map[string]string) (*http.Response, error)
SendRequest issues a new http request with an authorization header
func (*Context) StopHttpRedirects ¶
func (c *Context) StopHttpRedirects()
StopHttpRedirects configures the default client to ignore HTTP redirects
type ModifierFn ¶
type Suite ¶
type Suite struct {
// contains filtered or unexported fields
}
Suite allows the test author to specify suite-related metadata and do setup in a fluent-style, before commencing execution.
func (*Suite) Cleanup ¶
func (s *Suite) Cleanup(fn ModifierFn) *Suite
Cleanup runs enqueues the given cleanup function to run after test execution.
func (*Suite) Run ¶
func (s *Suite) Run()
Run the suite. This method calls os.Exit and does not return.
func (*Suite) Setup ¶
func (s *Suite) Setup(fn ModifierFn) *Suite
Setup runs enqueues the given setup function to run before test execution.