-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: (BREAKING) Use map for Client.GetSSHKeys(...) response (#28)
* Use map for Client.GetSSHKeys(...) response * Add optional skip * Update test/integration/sshkeys_test.go Co-authored-by: Ye Chen <127243817+yec-akamai@users.noreply.github.com> --------- Co-authored-by: Ye Chen <127243817+yec-akamai@users.noreply.github.com>
- Loading branch information
1 parent
0c5e7be
commit 9093622
Showing
2 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package integration | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGetSSHKeys(t *testing.T) { | ||
t.Parallel() | ||
|
||
sshKeys, err := metadataClient.GetSSHKeys(context.Background()) | ||
assert.NoError(t, err) | ||
|
||
if len(sshKeys.Users) < 1 { | ||
t.Skip( | ||
"The current instance does not have any SSH keys configured, skipping...") | ||
} | ||
|
||
for _, v := range sshKeys.Users { | ||
assert.Greater(t, len(v), 0) | ||
} | ||
} |