(self, fileContent, tmpPath, randDestFile)
| 125 | threadData.disableStdOut = popValue() |
| 126 | |
| 127 | def xpCmdshellWriteFile(self, fileContent, tmpPath, randDestFile): |
| 128 | echoedLines = [] |
| 129 | cmd = "" |
| 130 | charCounter = 0 |
| 131 | maxLen = 512 |
| 132 | |
| 133 | if isinstance(fileContent, (set, list, tuple)): |
| 134 | lines = fileContent |
| 135 | else: |
| 136 | lines = fileContent.split("\n") |
| 137 | |
| 138 | for line in lines: |
| 139 | echoedLine = "echo %s " % line |
| 140 | echoedLine += ">> \"%s\\%s\"" % (tmpPath, randDestFile) |
| 141 | echoedLines.append(echoedLine) |
| 142 | |
| 143 | for echoedLine in echoedLines: |
| 144 | cmd += "%s & " % echoedLine |
| 145 | charCounter += len(echoedLine) |
| 146 | |
| 147 | if charCounter >= maxLen: |
| 148 | self.xpCmdshellExecCmd(cmd.rstrip(" & ")) |
| 149 | |
| 150 | cmd = "" |
| 151 | charCounter = 0 |
| 152 | |
| 153 | if cmd: |
| 154 | self.xpCmdshellExecCmd(cmd.rstrip(" & ")) |
| 155 | |
| 156 | def xpCmdshellForgeCmd(self, cmd, insertIntoTable=None): |
| 157 | # When user provides DBMS credentials (with --dbms-cred) we need to |
no test coverage detected