MCPcopy
hub / github.com/kubernetes/node-problem-detector / RunCommandOrFail

Method RunCommandOrFail

test/e2e/lib/gce/instance.go:150–155  ·  view source on GitHub ↗

RunCommand runs a command on the GCE instance and returns the command result, and fails the test when the command failed.

(cmd string)

Source from the content-addressed store, hash-verified

148
149// RunCommand runs a command on the GCE instance and returns the command result, and fails the test when the command failed.
150func (ins *Instance) RunCommandOrFail(cmd string) ssh.Result {
151 result := ins.RunCommand(cmd)
152 Expect(result.SSHError).ToNot(HaveOccurred(), "SSH-ing to the instance failed: %v\n", result)
153 Expect(result.Code).To(Equal(0), "Running command failed: %v\n", result)
154 return result
155}
156
157// PushFile pushes a local file to a GCE instance.
158func (ins *Instance) PushFile(srcPath, destPath string) error {

Callers 1

metrics_test.goFile · 0.80

Calls 1

RunCommandMethod · 0.95

Tested by

no test coverage detected