Commit 6c96d5bf by 钱炳权

aflnet全流程无问题

parent f60354b1
......@@ -7,7 +7,6 @@ import java.util.Date;
@Data
public class MissionInfo {
@JsonIgnore
private int id;
@JsonIgnore
private int tableId;//返回数据忽略字段;aflnet 为1 kitty为2
......
......@@ -79,9 +79,9 @@ public class FuzzLogServiceImpl implements FuzzLogService {
@Transactional(rollbackFor = MysqlException.class)
public List<FuzzLogTransEntity> downloadAflnetFile(MissionInfo missionInfo) {
List<FuzzLogTransEntity> fuzzLogList = new ArrayList<FuzzLogTransEntity>();
// AflnetResult aflnetResult = aflnetMapper.selectResultById(missionInfo.getMissionId());
// FuzzLogTransEntity fuzzLogTransEntity = new FuzzLogTransEntity(aflnetResult.getFile(), aflnetResult.getFileName());
// fuzzLogList.add(fuzzLogTransEntity);
AflnetResult aflnetResult = aflnetMapper.selectResultById(missionInfo.getId());
FuzzLogTransEntity fuzzLogTransEntity = new FuzzLogTransEntity(aflnetResult.getFile(), aflnetResult.getFileName());
fuzzLogList.add(fuzzLogTransEntity);
return fuzzLogList;
}
}
......@@ -15,6 +15,7 @@ import com.example.fuzzControll.tools.system.SystemRunningParams;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.io.*;
......@@ -275,12 +276,12 @@ public class TestCmdTools {
* @return
*/
private TestReturnEntity makeReturnEntity(String line, TestReturnEntity returnEntity) {
// if (line.contains("All set and ready to roll!") || line.contains("american fuzzy") || line.contains("process timing overall results")) {
// show = false;
// } else if (line.contains("PROGRAM ABORT")) {
// log.error("Aflnet run failed !");
// throw new AflnetException("");
// }
if (line.contains("All set and ready to roll!") || line.contains("american fuzzy") || line.contains("process timing overall results")) {
show = false;
} else if (line.contains("PROGRAM ABORT")) {
log.error("Aflnet run failed !");
throw new AflnetException("");
}
if (show) {
log.info(line);
}
......@@ -397,7 +398,7 @@ public class TestCmdTools {
if (cmdStartParams.getWaiting() != 0) {
cmd.append(" -D " + cmdStartParams.getWaiting() + " ");
}
if (cmdStartParams.getNsname() != "") {
if (!StringUtils.isEmpty(cmdStartParams.getNsname())) {
cmd.append(" -e " + cmdStartParams.getNsname() + " ");
}
if (cmdStartParams.getKill()) {
......@@ -412,7 +413,7 @@ public class TestCmdTools {
if (cmdStartParams.getFalseNegativeMode()) {
cmd.append(" -F " + " ");
}
if (cmdStartParams.getScript() != "") {
if (!StringUtils.isEmpty(cmdStartParams.getScript())) {
cmd.append(" -c " + cmdStartParams.getScript() + " ");
}
if (cmdStartParams.getStateSelectionAlgo() != 0) {
......
......@@ -20,6 +20,8 @@ public class TestMissionController {
*/
@RequestMapping(value = "/startmission", method = RequestMethod.GET)
public AjaxResult getAll(@RequestParam int id) {
//todo 这个在kitty启动时并不需要
fuzzIntegrationFileApi.connect();
return fuzzIntegrationFileApi.startmission(id);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment