Skip to content

Commit f0b08cc

Browse files
authored
tests: managed keys are not accumulated (#35)
1 parent 0fd1784 commit f0b08cc

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

internal/ssh/reader.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ func (r *reader) ReadKeys(filename string) (*set.Set[Key], error) {
4545
}
4646
key, err := ParseKey(line, managed)
4747
if err != nil {
48-
// log something
4948
continue
5049
}
5150
keys.Insert(key)

internal/ssh/reader_test.go

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ func compareToFile(t *testing.T, filename string, expected []Key) {
1010
reader := NewKeysReader()
1111
keys, err := reader.ReadKeys(filename)
1212
must.NoError(t, err)
13-
must.SliceContainsSubset(t, expected, keys.List()) // FIXME (should be 6)
13+
must.SliceContainsAll(t, expected, keys.List())
1414
}
1515

1616
func Test_read_1(t *testing.T) {
@@ -46,24 +46,6 @@ func Test_read_2(t *testing.T) {
4646
"h1",
4747
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAADJKlkjkfjlkjff==",
4848
),
49-
key(
50-
true,
51-
"alice",
52-
"h1",
53-
"ssh-rsa AAAAB3NzaD1yc2EAAAADAQABAAAAgQCoiewjflsdf==",
54-
),
55-
key(
56-
true,
57-
"alice",
58-
"h2",
59-
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDQ9Tf0lycls==",
60-
),
61-
key(
62-
true,
63-
"bob",
64-
"h2",
65-
"ssh-edsa AAAAB3NzaC1yc2EAdlksjflksdjflksdjflsdkdj==",
66-
),
6749
}
6850

6951
compareToFile(t, "../../hack/tests/authorized_keys.2", expected)

0 commit comments

Comments
 (0)