Skip to content

Commit 867cad8

Browse files
committed
fix(e2e): run signing verification inside --start-services SSH session
The helper script and git config are only available when the credentials server is running. Move verification checks into the same SSH session that has --start-services active instead of using bare DevPodSSH calls. Part of #645
1 parent b4f0e94 commit 867cad8

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

e2e/tests/ssh/ssh.go

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -144,29 +144,13 @@ var _ = ginkgo.Describe("devpod ssh test suite", ginkgo.Label("ssh"), ginkgo.Ord
144144
err = f.DevPodUp(ctx, tempDir, "--git-ssh-signing-key", keyPath+".pub")
145145
framework.ExpectNoError(err)
146146

147-
// Step 1: Verify the helper script was installed and executable
148-
out, err := f.DevPodSSH(ctx, tempDir,
149-
"test -x /usr/local/bin/devpod-ssh-signature && echo EXISTS",
150-
)
151-
framework.ExpectNoError(err)
152-
gomega.Expect(strings.TrimSpace(out)).To(
153-
gomega.Equal("EXISTS"),
154-
"devpod-ssh-signature helper script should be installed and executable",
155-
)
156-
157-
// Step 2: Verify git config was written correctly
158-
out, err = f.DevPodSSH(ctx, tempDir, "git config --global gpg.ssh.program")
159-
framework.ExpectNoError(err)
160-
gomega.Expect(strings.TrimSpace(out)).To(gomega.Equal("devpod-ssh-signature"))
161-
162-
out, err = f.DevPodSSH(ctx, tempDir, "git config --global gpg.format")
163-
framework.ExpectNoError(err)
164-
gomega.Expect(strings.TrimSpace(out)).To(gomega.Equal("ssh"))
165-
166-
// Step 3: Attempt a signed commit with the credentials server
167-
// tunnel active. The signing request is forwarded over the tunnel
168-
// to the host where ssh-keygen performs the actual signing.
147+
// Verify helper installation, git config, and a signed commit
148+
// in a single SSH session with --start-services so the
149+
// credentials server tunnel is active.
169150
commitCmd := strings.Join([]string{
151+
"test -x /usr/local/bin/devpod-ssh-signature",
152+
"test \"$(git config --global gpg.ssh.program)\" = devpod-ssh-signature",
153+
"test \"$(git config --global gpg.format)\" = ssh",
170154
"cd /tmp",
171155
"git init test-sign-repo",
172156
"cd test-sign-repo",

0 commit comments

Comments
 (0)