Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
33e6054a58
@ -7,6 +7,10 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -37,11 +41,11 @@ public class SftpFileController {
|
||||
return CommonResult.success(uploadFilePath);
|
||||
}
|
||||
|
||||
@PostMapping("/download")
|
||||
@GetMapping("/download")
|
||||
public void downloadFile(
|
||||
@RequestParam String remoteFilePath,
|
||||
HttpServletResponse response) {
|
||||
|
||||
remoteFilePath = URLDecoder.decode(remoteFilePath,StandardCharsets.UTF_8);
|
||||
sftpFileService.downloadFile(
|
||||
remoteFilePath, response);
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ public class TestCaseGenerationWorker extends DockerWorker {
|
||||
sftp.connect();
|
||||
String workDir = (String)getGlobalVariable(context,AFL_DOCKER_WORK_DIR_KEY);
|
||||
append(context,"AI测试用例生成开始上传目标文件。。。");
|
||||
String filePath = AFL_DOCKER_BASE_DIR + File.separator + workDir+File.separator+getSourceName(fileName)+File.separator+binaryName;
|
||||
String filePath = AFL_VOLUME_WORK_DIR_PREFIX + File.separator + workDir+File.separator+getSourceName(fileName)+File.separator+binaryName;
|
||||
append(context,"读取到目标文件路径:"+filePath);
|
||||
InputStream inputStream = sftp.get(filePath);
|
||||
String targetUploadRes = aiGeneratorService.targetUpload("./" + binaryName, inputStream);
|
||||
@ -203,7 +203,7 @@ public class TestCaseGenerationWorker extends DockerWorker {
|
||||
String seedTarget = AFL_VOLUME_WORK_DIR_PREFIX+File.separator+seedPath+File.separator+tempFile.getName();
|
||||
String seedDir = AFL_VOLUME_WORK_DIR_PREFIX+File.separator+seedPath;
|
||||
append(context,"上传模糊测试种子压缩包到指定工作目录:"+seedDir);
|
||||
sftp.put(fis,seedDir);
|
||||
sftp.put(fis,seedTarget);
|
||||
sftp.disconnect();
|
||||
append(context,"解压种子到指定工作目录"+seedDir);
|
||||
String cmd = "unzip -o " + seedTarget + " -d " + seedDir;
|
||||
@ -213,6 +213,7 @@ public class TestCaseGenerationWorker extends DockerWorker {
|
||||
exec.setCommand(cmd);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("ai测试用例生成报错",e);
|
||||
append(context,"测试用例生成失败");
|
||||
}finally {
|
||||
if (exec!=null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user