From a719a7d7e75ec52d25db3454999a7ecf04cca22c Mon Sep 17 00:00:00 2001 From: Random-Liu Date: Wed, 21 Dec 2016 16:28:33 -0800 Subject: [PATCH] Do not use sudo when untar node e2e tar ball. --- test/e2e_node/remote/remote.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/e2e_node/remote/remote.go b/test/e2e_node/remote/remote.go index 1e162cb5b86..cc6a6225c43 100644 --- a/test/e2e_node/remote/remote.go +++ b/test/e2e_node/remote/remote.go @@ -93,7 +93,9 @@ func RunRemote(suite TestSuite, archive string, host string, cleanup bool, junit fmt.Sprintf("tar -xzvf ./%s", archiveName), ) glog.V(2).Infof("Extracting tar on %q", host) - if output, err := SSH(host, "sh", "-c", cmd); err != nil { + // Do not use sudo here, because `sudo tar -x` will recover the file ownership inside the tar ball, but + // we want the extracted files to be owned by the current user. + if output, err := SSHNoSudo(host, "sh", "-c", cmd); err != nil { // Exit failure with the error return "", false, fmt.Errorf("failed to extract test archive: %v, output: %q", err, output) }