Commit 011347e6 by 钱炳权

项目分离成功,可以成功跑通所有测试

parent 71336f1f
......@@ -4,13 +4,13 @@ import com.example.fuzzControll.conf.SpringContextUtil;
import com.example.fuzzControll.conf.KittyProperties;
public class CmdConstent {
static KittyProperties kittyProperties = (KittyProperties)SpringContextUtil.getBean("kittyProperties");
static KittyProperties kittyProperties = (KittyProperties) SpringContextUtil.getBean("kittyProperties");
public static final String GET_FILE_NAME = "ls -h ";
public static final String DELETE_FILE = "rm -r ";
public static final String COUNT_FILE = "ls -l | grep \"^-\" | wc -l";
public static final String COUNT_DIR = "ls -l | grep \"^d\" | wc -l";
public static final String RUN_AFLNET = "afl-fuzz -d -i "+kittyProperties.getAflnetPath()+"aflnet/tutorials/live555/in-rtsp -o out-live8 " +
"-x "+kittyProperties.getAflnetPath()+"aflnet/tutorials/live555/rtsp.dict ";
public static final String RUN_AFLNET_BEFORE = "afl-fuzz -d -i " + kittyProperties.getAflnetPath() + "aflnet/tutorials/live555/in-rtsp -o ";
public static final String RUN_AFLNET_AFTER = " -x " + kittyProperties.getAflnetPath() + "aflnet/tutorials/live555/rtsp.dict ";
public static final String RUN_PING = "ping www.baidu.com";
......
......@@ -12,6 +12,9 @@ import com.example.fuzzControll.tools.TestControlTools;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.CountDownLatch;
@Service("testService")
......@@ -23,10 +26,14 @@ public class TestServiceImpl implements TestService {
//todo 不同服务不同端口
@Override
public void testStart(CmdStartParams cmdStartParams) throws AflnetException,CmdException {
public void testStart(CmdStartParams cmdStartParams) throws AflnetException, CmdException {
TestControlTools.setIsRunning(true);
String cmd = cmdTools.parse(cmdStartParams);
String finalCmd = CmdConstent.RUN_AFLNET + cmd + kittyProperties.getAflnetPath()+"live555/testProgs/testOnDemandRTSPServer 8554";
Date date = new Date();
DateFormat df = new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss-");
String outputPathName = df.format(date)+cmdStartParams.getProtopcol()+"-output";
String finalCmd = CmdConstent.RUN_AFLNET_BEFORE + outputPathName + CmdConstent.RUN_AFLNET_AFTER + cmd + kittyProperties.getAflnetPath() + "live555/testProgs/testOnDemandRTSPServer 8554";
log.info("The cmd is [{}]",finalCmd);
cmdTools.runProgramCmd(finalCmd);
}
......
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