From 8e52fc72668ede721518c87c762ec304bc070b49 Mon Sep 17 00:00:00 2001 From: Sai Ramesh Vanka Date: Tue, 31 Oct 2023 15:36:39 +0530 Subject: [PATCH] Minor fix to copy the required kubelet, service logs after the execution of the node e2e tests * It is observed in some of the periodic job results that the kubelet along with few other logs are not getting copied to the artifacts directory once the node e2e tests are executed * Following is the sample error log that is displayed once the tests are run ``` I1031 13:15:49.056897 40204 ssh.go:146] Running the command ssh, with args: [-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o CheckHostIP=no -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o LogLevel=ERROR -i /home/svanka/.ssh/google_compute_engine core@35.185.108.51 -- sudo ls core@35.185.108.51:/tmp/node-e2e-20231031T125637/results/*.log] E1031 13:16:15.346641 40204 ssh.go:149] failed to run SSH command: out: ls: cannot access 'core@35.185.108.51:/tmp/node-e2e-20231031T125637/results/*.log': No such file or directory , err: exit status 2 ``` * This change fixes the above issue and helps in gathering the required test artifacts once the tests execution is completed Signed-off-by: Sai Ramesh Vanka --- test/e2e_node/remote/remote.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e_node/remote/remote.go b/test/e2e_node/remote/remote.go index 2b55b02edd3..08fc2693ed9 100644 --- a/test/e2e_node/remote/remote.go +++ b/test/e2e_node/remote/remote.go @@ -208,7 +208,7 @@ func getTestArtifacts(host, testDir string) error { return fmt.Errorf("failed to create log directory %q: %w", logPath, err) } // Copy logs (if any) to artifacts/hostname - if _, err := SSH(host, "ls", fmt.Sprintf("%s:%s/results/*.log", GetHostnameOrIP(host), testDir)); err == nil { + if _, err := SSH(host, "ls", fmt.Sprintf("%s/results/*.log", testDir)); err == nil { if _, err := runSSHCommand(host, "scp", "-r", fmt.Sprintf("%s:%s/results/*.log", GetHostnameOrIP(host), testDir), logPath); err != nil { return err }