Skip to content

Commit 4bbe55b

Browse files
committed
Add integration test for bink node ssh command execution
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 44ac23d commit 4bbe55b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/integration/cluster_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ var _ = Describe("Cluster Lifecycle", func() {
8686
_, hasCP := n1.Labels["node-role.kubernetes.io/control-plane"]
8787
Expect(hasCP).To(BeTrue(), "%s should have control-plane role", customNodeName)
8888

89+
By("Verifying bink node ssh can run a command on the node")
90+
sshCmd := helpers.BinkCmd("node", "ssh", customNodeName, "--cluster-name", clusterName, "--", "uname", "-n")
91+
sshSession := helpers.RunCommand(sshCmd)
92+
Expect(sshSession.ExitCode()).To(Equal(0))
93+
sshOutput := string(sshSession.Out.Contents())
94+
Expect(sshOutput).To(ContainSubstring(customNodeName), "SSH command output should contain the node hostname")
95+
96+
By("Verifying bink node ssh propagates non-zero exit codes")
97+
failCmd := helpers.BinkCmd("node", "ssh", customNodeName, "--cluster-name", clusterName, "--", "exit", "42")
98+
failSession := helpers.RunCommand(failCmd)
99+
Expect(failSession.ExitCode()).To(Equal(42), "SSH command should propagate the remote exit code")
100+
89101
By("Verifying Calico CNI is running")
90102
helpers.WaitForPodReady(kubeClient, "kube-system", "k8s-app=calico-node", 3*time.Minute)
91103

0 commit comments

Comments
 (0)