type Result … // LogResult records result log func LogResult(result Result) { … } type HostExec … type hostExecutor … // NewHostExec returns a HostExec func NewHostExec(framework *framework.Framework) HostExec { … } // launchNodeExecPod launches a hostexec pod for local PV and waits // until it's Running. func (h *hostExecutor) launchNodeExecPod(ctx context.Context, node string) *v1.Pod { … } // Execute executes the command on the given node. If there is no error // performing the remote command execution, the stdout, stderr and exit code // are returned. // This works like ssh.SSH(...) utility. func (h *hostExecutor) Execute(ctx context.Context, cmd string, node *v1.Node) (Result, error) { … } func (h *hostExecutor) exec(ctx context.Context, cmd string, node *v1.Node) (Result, error) { … } // IssueCommandWithResult issues command on the given node and returns stdout as // result. It returns error if there are some issues executing the command or // the command exits non-zero. func (h *hostExecutor) IssueCommandWithResult(ctx context.Context, cmd string, node *v1.Node) (string, error) { … } // IssueCommand works like IssueCommandWithResult, but discards result. func (h *hostExecutor) IssueCommand(ctx context.Context, cmd string, node *v1.Node) error { … } // Cleanup cleanup resources it created during test. // Note that in most cases it is not necessary to call this because we create // pods under test namespace which will be destroyed in teardown phase. func (h *hostExecutor) Cleanup(ctx context.Context) { … }