diff --git a/test/e2e/framework/volume/fixtures.go b/test/e2e/framework/volume/fixtures.go index 9af6d3cdd35..f13a5cb2fe9 100644 --- a/test/e2e/framework/volume/fixtures.go +++ b/test/e2e/framework/volume/fixtures.go @@ -568,47 +568,30 @@ func InjectContent(f *framework.Framework, config TestConfig, fsGroup *int64, fs // generateWriteCmd is used by generateWriteBlockCmd and generateWriteFileCmd func generateWriteCmd(content, path string) []string { var commands []string - if !framework.NodeOSDistroIs("windows") { - commands = []string{"/bin/sh", "-c", "echo '" + content + "' > " + path} - } else { - commands = []string{"powershell", "/c", "echo '" + content + "' > " + path} - } + commands = []string{"/bin/sh", "-c", "echo '" + content + "' > " + path} return commands } // generateReadBlockCmd generates the corresponding command lines to read from a block device with the given file path. -// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh func generateReadBlockCmd(fullPath string, numberOfCharacters int) []string { var commands []string - if !framework.NodeOSDistroIs("windows") { - commands = []string{"head", "-c", strconv.Itoa(numberOfCharacters), fullPath} - } else { - // TODO: is there a way on windows to get the first X bytes from a device? - commands = []string{"powershell", "/c", "type " + fullPath} - } + commands = []string{"head", "-c", strconv.Itoa(numberOfCharacters), fullPath} return commands } // generateWriteBlockCmd generates the corresponding command lines to write to a block device the given content. -// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh func generateWriteBlockCmd(content, fullPath string) []string { return generateWriteCmd(content, fullPath) } // GenerateReadFileCmd generates the corresponding command lines to read from a file with the given file path. -// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh func GenerateReadFileCmd(fullPath string) []string { var commands []string - if !framework.NodeOSDistroIs("windows") { - commands = []string{"cat", fullPath} - } else { - commands = []string{"powershell", "/c", "type " + fullPath} - } + commands = []string{"cat", fullPath} return commands } // generateWriteFileCmd generates the corresponding command lines to write a file with the given content and file path. -// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh func generateWriteFileCmd(content, fullPath string) []string { return generateWriteCmd(content, fullPath) }