[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-schemafuzz] branch master updated: implementing data
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-schemafuzz] branch master updated: implementing database state recovery |
Date: |
Mon, 30 Jul 2018 20:43:59 +0200 |
This is an automated email from the git hooks/post-receive script.
erwan-ulrich pushed a commit to branch master
in repository schemafuzz.
The following commit(s) were added to refs/heads/master by this push:
new 99d6adf implementing database state recovery
99d6adf is described below
commit 99d6adff0f959b4ddd3cbd964c75e13bcd1b5f74
Author: Feideus <address@hidden>
AuthorDate: Mon Jul 30 20:43:52 2018 +0200
implementing database state recovery
---
src/main/java/org/schemaspy/DBFuzzer.java | 9 ++-
src/main/java/org/schemaspy/Main.java | 31 ++++++++++
.../org/schemaspy/cli/CommandLineArguments.java | 13 +++++
.../java/org/schemaspy/model/GenericTreeNode.java | 12 ++++
stackTraceCParser.sh | 17 ++++++
tmp.txt | 66 ++++++++++++++++++++++
6 files changed, 147 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/schemaspy/DBFuzzer.java
b/src/main/java/org/schemaspy/DBFuzzer.java
index a73ddb9..e4071c1 100755
--- a/src/main/java/org/schemaspy/DBFuzzer.java
+++ b/src/main/java/org/schemaspy/DBFuzzer.java
@@ -211,7 +211,14 @@ public class DBFuzzer
//currentMutation.propagateWeight(); //update parents
weight according to this node new weight
LOGGER.info("Target is : " +
analyzer.getCommandLineArguments().getTarget());
- Process evaluatorProcess = new ProcessBuilder("/bin/bash",
"./stackTraceCParser.sh", analyzer.getCommandLineArguments().getTarget(),
Integer.toString(currentMutation.getId())).start();
+ ProcessBuilder ep = new ProcessBuilder("/bin/bash",
"./stackTraceCParser.sh", analyzer.getCommandLineArguments().getTarget(),
Integer.toString(currentMutation.getId()));
+ ArrayList<GenericTreeNode> pathToRoot =
currentMutation.pathToRoot();
+ Collections.reverse(pathToRoot);
+ for(int i=0; i< pathToRoot.size();i++)
+ {
+
ep.environment().put("mut_"+pathToRoot.get(i).getId(),pathToRoot.get(i).getChosenChange().toString());
+ }
+ Process evaluatorProcess = ep.start();
evaluatorProcess.waitFor();
ReportVector mutationReport = new
ReportVector(currentMutation);
mutationReport.parseFile("errorReports/parsedStackTrace_"
+ currentMutation.getId()); // initialises the reportVector stacktrace
diff --git a/src/main/java/org/schemaspy/Main.java
b/src/main/java/org/schemaspy/Main.java
index e18158d..52bbc8f 100755
--- a/src/main/java/org/schemaspy/Main.java
+++ b/src/main/java/org/schemaspy/Main.java
@@ -32,6 +32,9 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
import java.lang.invoke.MethodHandles;
import java.util.Arrays;
@@ -75,6 +78,15 @@ public class Main implements CommandLineRunner {
return;
}
+ /*if(arguments.getSetErrorState() != null)
+ {
+ File f = new File(arguments.getSetErrorState());
+ if(f.exists() && !f.isDirectory()) {
+ setErrorState(f);
+ }
+ return;
+ }*/
+
runAnalyzer(args);
runFuzzer(args);
System.out.println(Thread.getAllStackTraces());
@@ -125,5 +137,24 @@ public class Main implements CommandLineRunner {
}
}
+ private void setErrorState(File f)
+ {
+ try
+ {
+ BufferedReader br = new BufferedReader(new FileReader(f));
+ StringBuilder sb = new StringBuilder();
+ String line = br.readLine();
+
+ while(line != null)
+ {
+ System.out.println(line);
+ line = br.readLine();
+ }
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
}
diff --git a/src/main/java/org/schemaspy/cli/CommandLineArguments.java
b/src/main/java/org/schemaspy/cli/CommandLineArguments.java
index 973e0e5..a4c401d 100755
--- a/src/main/java/org/schemaspy/cli/CommandLineArguments.java
+++ b/src/main/java/org/schemaspy/cli/CommandLineArguments.java
@@ -132,6 +132,13 @@ public class CommandLineArguments {
@Parameter(
names = {
+ "-ses", "-setErrorState",
+ }
+ )
+ private String setErrorState;
+
+ @Parameter(
+ names = {
"-nr", "--no-report"
}
)
@@ -174,6 +181,8 @@ public class CommandLineArguments {
)
private Integer port;
+ public String getSetErrorState() {return setErrorState;}
+
public String getQuery() {
return query;
}
@@ -182,6 +191,10 @@ public class CommandLineArguments {
return helpRequired;
}
+ public boolean isSetErrorStateRequired() {
+ return helpRequired;
+ }
+
public boolean isDbHelpRequired() {
return dbHelpRequired;
}
diff --git a/src/main/java/org/schemaspy/model/GenericTreeNode.java
b/src/main/java/org/schemaspy/model/GenericTreeNode.java
index 7d3b2ba..bdf0b9f 100755
--- a/src/main/java/org/schemaspy/model/GenericTreeNode.java
+++ b/src/main/java/org/schemaspy/model/GenericTreeNode.java
@@ -911,4 +911,16 @@ public class GenericTreeNode {
}
return result;
}
+
+ public ArrayList<GenericTreeNode> pathToRoot()
+ {
+ ArrayList<GenericTreeNode> res = new ArrayList<GenericTreeNode>();
+ GenericTreeNode tmp = this;
+ do{
+ res.add(tmp);
+ tmp = tmp.getParent();
+
+ }while(tmp != null);
+ return res;
+ }
}
diff --git a/stackTraceCParser.sh b/stackTraceCParser.sh
index 090387b..ef79039 100755
--- a/stackTraceCParser.sh
+++ b/stackTraceCParser.sh
@@ -1,5 +1,22 @@
#!/bin/bash
+touch tmp.txt;
+compteur=1;
+tmpString="mut_"$compteur
+boolean=1
+
+while [ $boolean -eq 1 ]
+do
+ echo ${!tmpString} >> tmp.txt
+ compteur=$((compteur+1))
+ tmpString="mut_"$compteur
+ tmpString2=${!tmpString}
+ if [[ ! -n "$tmpString2" ]]
+ then
+ boolean=0
+ fi
+done
+
isBinaryInDir=`ls | grep $1`;
echo $isBinaryInDir
diff --git a/tmp.txt b/tmp.txt
new file mode 100644
index 0000000..1766771
--- /dev/null
+++ b/tmp.txt
@@ -0,0 +1,66 @@
+
+[SG - attachedToMutation : 1| OV :32767 | NV :26728 ]
+[SG - attachedToMutation : 2| OV :32767 | NV :19034 ]
+[SG - attachedToMutation : 1| OV :32767 | NV :26728 ]
+[SG - attachedToMutation : 2| OV :32767 | NV :19034 ]
+[SG - attachedToMutation : 3| OV :26728 | NV :32767 ]
+[SG - attachedToMutation : 1| OV :32767 | NV :26728 ]
+[SG - attachedToMutation : 2| OV :32767 | NV :19034 ]
+[SG - attachedToMutation : 3| OV :26728 | NV :32767 ]
+[SG - attachedToMutation : 4| OV :19034 | NV :1445 ]
+[SG - attachedToMutation : 1| OV :32767 | NV :26728 ]
+[SG - attachedToMutation : 2| OV :32767 | NV :19034 ]
+[SG - attachedToMutation : 3| OV :26728 | NV :32767 ]
+[SG - attachedToMutation : 4| OV :19034 | NV :1445 ]
+[SG - attachedToMutation : 5| OV :f | NV :t ]
+[SG - attachedToMutation : 1| OV :32767 | NV :26728 ]
+[SG - attachedToMutation : 2| OV :32767 | NV :19034 ]
+[SG - attachedToMutation : 3| OV :26728 | NV :32767 ]
+[SG - attachedToMutation : 4| OV :19034 | NV :1445 ]
+[SG - attachedToMutation : 5| OV :f | NV :t ]
+[SG - attachedToMutation : 6| OV :394 | NV :32767 ]
+[SG - attachedToMutation : 1| OV :32767 | NV :26728 ]
+[SG - attachedToMutation : 2| OV :32767 | NV :19034 ]
+[SG - attachedToMutation : 3| OV :26728 | NV :32767 ]
+[SG - attachedToMutation : 4| OV :19034 | NV :1445 ]
+[SG - attachedToMutation : 5| OV :f | NV :t ]
+[SG - attachedToMutation : 6| OV :394 | NV :32767 ]
+[SG - attachedToMutation : 7| OV :`cb2237c0679ca88db6464eac60da96345513964 |
NV :`cb2237c0679ca88db6464eac60da96345513:64 ]
+[SG - attachedToMutation : 1| OV :32767 | NV :26728 ]
+[SG - attachedToMutation : 2| OV :32767 | NV :19034 ]
+[SG - attachedToMutation : 3| OV :26728 | NV :32767 ]
+[SG - attachedToMutation : 4| OV :19034 | NV :1445 ]
+[SG - attachedToMutation : 5| OV :f | NV :t ]
+[SG - attachedToMutation : 6| OV :394 | NV :32767 ]
+[SG - attachedToMutation : 7| OV :`cb2237c0679ca88db6464eac60da96345513964 |
NV :`cb2237c0679ca88db6464eac60da96345513:64 ]
+[SG - attachedToMutation : 8| OV :Gom | NV :Gol ]
+[SG - attachedToMutation : 1| OV :32767 | NV :26728 ]
+[SG - attachedToMutation : 2| OV :32767 | NV :19034 ]
+[SG - attachedToMutation : 3| OV :26728 | NV :32767 ]
+[SG - attachedToMutation : 4| OV :19034 | NV :1445 ]
+[SG - attachedToMutation : 5| OV :f | NV :t ]
+[SG - attachedToMutation : 6| OV :394 | NV :32767 ]
+[SG - attachedToMutation : 7| OV :`cb2237c0679ca88db6464eac60da96345513964 |
NV :`cb2237c0679ca88db6464eac60da96345513:64 ]
+[SG - attachedToMutation : 8| OV :Gom | NV :Gol ]
+[SG - attachedToMutation : 9| OV :Lnm | NV :Lmm ]
+[SG - attachedToMutation : 1| OV :32767 | NV :26728 ]
+[SG - attachedToMutation : 2| OV :32767 | NV :19034 ]
+[SG - attachedToMutation : 3| OV :26728 | NV :32767 ]
+[SG - attachedToMutation : 4| OV :19034 | NV :1445 ]
+[SG - attachedToMutation : 5| OV :f | NV :t ]
+[SG - attachedToMutation : 6| OV :394 | NV :32767 ]
+[SG - attachedToMutation : 7| OV :`cb2237c0679ca88db6464eac60da96345513964 |
NV :`cb2237c0679ca88db6464eac60da96345513:64 ]
+[SG - attachedToMutation : 8| OV :Gom | NV :Gol ]
+[SG - attachedToMutation : 9| OV :Lnm | NV :Lmm ]
+[SG - attachedToMutation : 10| OV :Osaka | NV :Psaka ]
+[SG - attachedToMutation : 1| OV :32767 | NV :26728 ]
+[SG - attachedToMutation : 2| OV :32767 | NV :19034 ]
+[SG - attachedToMutation : 3| OV :26728 | NV :32767 ]
+[SG - attachedToMutation : 4| OV :19034 | NV :1445 ]
+[SG - attachedToMutation : 5| OV :f | NV :t ]
+[SG - attachedToMutation : 6| OV :394 | NV :32767 ]
+[SG - attachedToMutation : 7| OV :`cb2237c0679ca88db6464eac60da96345513964 |
NV :`cb2237c0679ca88db6464eac60da96345513:64 ]
+[SG - attachedToMutation : 8| OV :Gom | NV :Gol ]
+[SG - attachedToMutation : 9| OV :Lnm | NV :Lmm ]
+[SG - attachedToMutation : 10| OV :Osaka | NV :Psaka ]
+[SG - attachedToMutation : 11| OV :Tallahassee | NV :Taklahassee ]
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-schemafuzz] branch master updated: implementing database state recovery,
gnunet <=