summaryrefslogtreecommitdiff
path: root/dryad/rusalka_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'dryad/rusalka_test.go')
-rw-r--r--dryad/rusalka_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/dryad/rusalka_test.go b/dryad/rusalka_test.go
index f3799af..69136ed 100644
--- a/dryad/rusalka_test.go
+++ b/dryad/rusalka_test.go
@@ -23,6 +23,7 @@ import (
"crypto/rsa"
"crypto/x509"
"encoding/pem"
+ "errors"
"os"
"os/user"
"time"
@@ -32,6 +33,7 @@ import (
gomock "github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
+ "golang.org/x/crypto/ssh"
)
var _ = Describe("Rusalka", func() {
@@ -84,9 +86,13 @@ var _ = Describe("Rusalka", func() {
Skip("must be run as root")
}
+ err = d.Prepare(nil)
+ Expect(err).To(Equal(errors.New("empty public key")))
key, err := rsa.GenerateKey(rand.Reader, 1024)
Expect(err).ToNot(HaveOccurred())
- err = d.Prepare(&key.PublicKey)
+ pubKey, err := ssh.NewPublicKey(&key.PublicKey)
+ Expect(err).ToNot(HaveOccurred())
+ err = d.Prepare(&pubKey)
Expect(err).ToNot(HaveOccurred())
Expect(sshDir).To(BeADirectory())
Expect(authorizedKeysFile).To(BeARegularFile())