Run SSH e2e test only if SSH keys are present
Not all CI systems support ssh keys to be present on the node. This supports the case where "local" provider is being used when running e2e test, but the environment does not have a SSH key.
This commit is contained in:
@@ -315,6 +315,12 @@ func SkipIfProviderIs(unsupportedProviders ...string) {
|
||||
}
|
||||
}
|
||||
|
||||
func SkipUnlessSSHKeyPresent() {
|
||||
if _, err := GetSigner(TestContext.Provider); err != nil {
|
||||
Skipf("No SSH Key for provider %s: '%v'", TestContext.Provider, err)
|
||||
}
|
||||
}
|
||||
|
||||
func SkipUnlessProviderIs(supportedProviders ...string) {
|
||||
if !ProviderIs(supportedProviders...) {
|
||||
Skipf("Only supported for providers %v (not %s)", supportedProviders, TestContext.Provider)
|
||||
|
||||
Reference in New Issue
Block a user