exec remote host collectors in a daemonset (#1671)

Co-authored-by: Gerard Nguyen <gerard@replicated.com>
Co-authored-by: Dexter Yan <yanshaocong@gmail.com>
This commit is contained in:
Ash
2024-11-11 19:47:24 +00:00
committed by GitHub
parent 197f6de425
commit deeeea7cec
2 changed files with 382 additions and 118 deletions

View File

@@ -16,12 +16,14 @@ func TestHostRemoteCollector(t *testing.T) {
feature := features.New("Host OS Remote Collector Test").
Assess("run support bundle command successfully", func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
var out bytes.Buffer
var errOut bytes.Buffer
supportbundleName := "host-os-remote-collector"
cmd := exec.CommandContext(ctx, sbBinary(), "spec/remoteHostCollectors.yaml", "--interactive=false", fmt.Sprintf("-o=%s", supportbundleName))
cmd.Stdout = &out
cmd.Stderr = &errOut
err := cmd.Run()
if err != nil {
t.Fatalf("Failed to run the binary: %v", err)
t.Fatalf("Failed to run the binary: %v\n%s", err, errOut.String())
}
defer func() {