gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-schemafuzz] branch master updated: ...


From: gnunet
Subject: [GNUnet-SVN] [taler-schemafuzz] branch master updated: ...
Date: Sun, 17 Jun 2018 16:47:25 +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 94e457e  ...
94e457e is described below

commit 94e457e9945b74e88d276ae07010c7ea64454735
Author: Feideus <address@hidden>
AuthorDate: Sun Jun 17 16:47:16 2018 +0200

    ...
---
 .gitignore                                         |  4 --
 Documentation.tex                                  | 74 ++++------------------
 aLittleBitLessDumbEvaluator.sh                     | 10 +--
 evaluator.sh                                       |  2 +-
 schemaspy.iml                                      |  6 +-
 src/main/java/org/schemaspy/DBFuzzer.java          |  9 +--
 .../java/org/schemaspy/model/GenericTreeNode.java  | 16 +++--
 .../org/schemaspy/model/GenericTreeNodeTest.java   |  7 +-
 .../java/org/schemaspy/model/GenericTreeTest.java  |  1 +
 9 files changed, 43 insertions(+), 86 deletions(-)

diff --git a/.gitignore b/.gitignore
index 33b2a4c..1d8edeb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,7 +10,3 @@ target/schemaspy-6.0.0-rc2.jar.original
 .idea/
 target/failsafe-reports
 target/maven-status/maven-compiler-plugin
-Documentation.aux
-Documentation.log
-Documentation.pdf
-Documentation.synctex.gz
diff --git a/Documentation.tex b/Documentation.tex
index 472fc7f..6a28d8b 100644
--- a/Documentation.tex
+++ b/Documentation.tex
@@ -1,78 +1,28 @@
 \documentclass{article}
 \usepackage[utf8]{inputenc}
 \usepackage[document]{ragged2e}
-\usepackage{titlesec}
-\usepackage{xcolor}
-\newcommand{\sectionbreak}{\clearpage}
-\titleformat{\section}{\Large\bfseries\filcenter}{}{1em}{}
 
 \title{Documentation for schemaFuzz}
-\author{Erwan "Feideus" Ulrich}
+\author{Ulrich "Feideus" Erwan}
 
 \begin{document}
 
+       
 \maketitle Documentation For SchemaFuzz
-
-       \section{Summary}       
-               \begin{itemize} 
-               \item \subsection*{Introduction} 
-               \item \subsection*{Usage}
-               \item \subsection*{Design}
-               \begin{itemize} 
-                       \item a) Idea and philosophy
-                       \item b) SchemaSpy legacy
-                       \item c) SchemaFuzz Core
-               \end{itemize}
-               \item \subsection*{Conclusion}
-                       
-               \end{itemize}
-                               
+       \section{Summary?}
+               This document actually needs a front page.
        \section{Introduction}
-       
-SchemaFuzz is an analitic tool that provides intresting data on the robustness 
of a                    software's handling of its database.It is being 
developped primarely as part of the (wonderfull) GNU Taler project .The general 
idea is to inject malformed or corrupted-like data into the database that is 
used by the target software to stress it. The process will (hopefully) pop 
new/intresting/weird-looking buggs, helping the developpers handle unpredicted 
behavior.
-This tool falls under the category of "Fuzzers" as it is the "database" 
adaptation of the classical vision of program fuzzing. License used ????
-               
-       
+               this is the first section of the documentation.
+       \section{Usage}
+               How to set up, invoke, and more genericly use schemaFuzz.
        \section{How it is Designed}
                \subsection{Idea behind the tool}
-               
-As mentionned in the introduction, this project is conducted as part of the 
Gnu Taler project. However, it is ultimately meant for the wild world which 
means it shall be usable on any kind of database with any kind of database type 
and inputs you can possibly think of.
-Please refer to the "Future features" section for more detail on that matter.
-                       
+                       Analyse shit
                \subsection{SchemaSpy legacy}
-               
-SchemaFuzz Core code is placed on top of some of the SchemaSpy project code. 
More precisely, the metadata extraction process is being performed by one of 
SchemaSpy routines. 
-
-               \subsection{SchemaFuzz Core. Need subsections}
-So far, SchemaFuzz is able to inject "mutations" into a specified database. 
These mutations
-are stored up as "sequences" in a tree structure which means that a sequence 
of mutation is typically composed of several individual mutations performed one 
after the other, on the same piece of data.
-SchemaFuzz relies on a do/undo mechanism to navigate between several sequences 
inside the tree which gives it a decent adaptative power.
-The tree itself contains an arbitrary number of sequences, depending of the 
"scoring" of the sequence. This score will be calculated by an evaluator (not 
yet functionnal) that analyses the response from the target software after each 
mutation.
-The score is an essential component of the project as it represents the 
effectiveness of the mutation is it attached to. Its precision is therefore 
vital as well highly depedent on the criterias concidered. 
-Severals approches and enhancements are being discussed.
-               \subsection{Future features}
-               \begin{itemize}
-                       \item use code coverage as a determining factor for the 
evalutator
-                       \item user report to enhance the evaluator's precision 
(gives back best mutation paterns).
-               \end{itemize}
-                       
-       \section{Installation and Usage}        
-As SchemaFuzz is based on some of SchemaSpy's mechanics. it requires some/all 
of its           dependencies (to be precisely determined). 
-               
-\begin{quote}
-Building =  =  "./mvn package"
-\end{quote}
-
-
-\begin{quote}
-       Running = java -jar target/schemaspy-6.0.0-rc2.jar -t (Database-Type) 
-db (Database-Name) -hostOptionalPort 127.0.0.1 -o (Output-Folder) -dp 
(MydriverFolderPath/(MyDriver.jar)) -u (Database-UserName) -p (User-Password)
-\end{quote}
-
-It usualy is a good idea to script that.
-       
-       \section{Contributing.Where should this be ?}
+                       "stole" some shit
+               \subsection{SchemaFuzz Core}
+                       Developped some shit
        
+       \section{Contributing}
        \section{Conclusion}
-       Thanks for reading so far down !        
-       
 \end{document} 
diff --git a/aLittleBitLessDumbEvaluator.sh b/aLittleBitLessDumbEvaluator.sh
index ed3d362..5ec1a32 100644
--- a/aLittleBitLessDumbEvaluator.sh
+++ b/aLittleBitLessDumbEvaluator.sh
@@ -1,11 +1,11 @@
 #!/bin/bash
 
-RESULT="$(psql -d sample_database2 -c 'SELECT * FROM test_table2')";
+#RESULT="$(psql -d sample_database2 -U feideus -c 'SELECT * FROM 
test_table2')" ;
 
-RESULT=$( echo $RESULT | grep -P -o "\- .*" )
-RESULT=$( echo $RESULT | cut -d "-" -f 2 )
-RESULT=$( echo $RESULT | cut -d "(" -f1 )
-IFS=' | ' read -ra array <<< "$RESULT"
+#RESULT=$( echo $RESULT | grep -P -o "\- .*" )
+#RESULT=$( echo $RESULT | cut -d "-" -f 2 )
+#RESULT=$( echo $RESULT | cut -d "(" -f1 )
+#IFS=' | ' read -ra array <<< "$RESULT"
 
 SCORE=10
 
diff --git a/evaluator.sh b/evaluator.sh
index c7f17a2..049a698 100644
--- a/evaluator.sh
+++ b/evaluator.sh
@@ -1,7 +1,7 @@
 
 #!/bin/bash
 
-RESULT="$(psql -d sample_database2 -c 'SELECT * FROM TEST_TABLE')";
+RESULT="$(psql -d sample_database2 -U feideus -c 'SELECT * FROM TEST_TABLE')";
 RESULT=$( echo $RESULT | grep -P -o "\- .*" )
 RESULT=$( echo $RESULT | cut -d "-" -f 2 )
 RESULT=$( echo $RESULT | cut -d "(" -f1 )
diff --git a/schemaspy.iml b/schemaspy.iml
index 8c97a45..c348815 100644
--- a/schemaspy.iml
+++ b/schemaspy.iml
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module 
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" 
type="JAVA_MODULE" version="4">
+
+dule 
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" 
type="JAVA_MODULE" version="4">
   <component name="EclipseModuleManager">
     <conelement value="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" />
     <src_description expected_position="0">
@@ -99,4 +99,4 @@
     <orderEntry type="library" scope="TEST" name="Maven: 
org.xmlunit:xmlunit-core:2.3.0" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: 
nl.jqno.equalsverifier:equalsverifier:2.4" level="project" />
   </component>
-</module>
\ No newline at end of file
+</module>
diff --git a/src/main/java/org/schemaspy/DBFuzzer.java 
b/src/main/java/org/schemaspy/DBFuzzer.java
index af97545..f23d238 100644
--- a/src/main/java/org/schemaspy/DBFuzzer.java
+++ b/src/main/java/org/schemaspy/DBFuzzer.java
@@ -57,7 +57,7 @@ public class DBFuzzer
         try
         {
             int mark;
-            Process evaluatorProcess = new ProcessBuilder("/bin/bash", 
"./evaluator.sh").start();
+            Process evaluatorProcess = new ProcessBuilder("/bin/bash", 
"./aLittleBitLessDumbEvaluator.sh").start();
             mark = Integer.parseInt(getEvaluatorResponse(evaluatorProcess));
             rootMutation.setInterest_mark(mark);
             rootMutation.setWeight(mark);
@@ -114,6 +114,7 @@ public class DBFuzzer
           }
 
           System.out.println("chosen mutation "+currentMutation);
+          System.out.println("parent mutation "+currentMutation.getParent());
 
             
if(!currentMutation.getParent().compare(mutationTree.getLastMutation()))
             {
@@ -194,7 +195,7 @@ public class DBFuzzer
           }
           catch (Exception e)
           {
-              LOGGER.info("This query threw an error" + e);
+              LOGGER.info("This query threw an error while looking for a row" 
+ e);
           }
         }
         while(res == null);
@@ -326,7 +327,7 @@ public class DBFuzzer
                 nextMut.initPostChangeRow();
                 return nextMut;
             }
-            else if (markingDiff == 0 || markingDiff < 0)
+            else if (markingDiff <= 0)
             {
                 Random changeOrDepthen = new Random(); // 1 is same row
 
@@ -387,7 +388,7 @@ public class DBFuzzer
 
     public int nextId()
     {
-      return mutationTree.getLastId()+1;
+        return mutationTree.getLastId()+1;
     }
 
     
diff --git a/src/main/java/org/schemaspy/model/GenericTreeNode.java 
b/src/main/java/org/schemaspy/model/GenericTreeNode.java
index 9d5fbff..f498608 100644
--- a/src/main/java/org/schemaspy/model/GenericTreeNode.java
+++ b/src/main/java/org/schemaspy/model/GenericTreeNode.java
@@ -244,12 +244,13 @@ public class GenericTreeNode {
             case "integer":
             case "int2":
             case "int8":
+            case "serial":
             case "bigserial":
                 Object tmp = 
rootForThisMutation.getInitial_state_row().getContent().get(tableColumn.getName());
                 if( tmp != null && tmp.toString() != "" )
                 {
                     int tmp2;
-                    if(typeName.equals("int2"))
+                    if(typeName.equals("int2") || typeName.equals("serial")  )
                     {
                         tmp2 = 
Integer.parseInt(rootForThisMutation.getInitial_state_row().getContent().get(tableColumn.getName()).toString());
                         oneChange.add(new SingleChange(tableColumn, this, 
column_value, Integer.toString(tmp2++)));
@@ -420,7 +421,8 @@ public class GenericTreeNode {
             {
                 if 
(!entry.getKey().equals(chosenChange.getParentTableColumn().getName()))
                 {
-                    
if(chosenChange.getParentTableColumn().getTable().getColumn(entry.getKey()) != 
null) {// not very good, check why the field is null in the first place
+                    
if(chosenChange.getParentTableColumn().getTable().getColumn(entry.getKey()) != 
null && 
!chosenChange.getParentTableColumn().getTable().getColumn(entry.getKey()).getTypeName().equals("timestamp"))
+                    {
                         if 
(requireQuotes(chosenChange.getParentTableColumn().getTable().getColumn(entry.getKey()))
 == 1)
                         {
                             if (entry.getValue() != null)
@@ -619,13 +621,14 @@ public class GenericTreeNode {
         ArrayList<GenericTreeNode> finalPath = new 
ArrayList<GenericTreeNode>();
         finalPath.addAll(this.findPathToMutation(rootMutation).get(0));
         finalPath.addAll(this.findPathToMutation(rootMutation).get(1));
+        finalPath.remove(this);
 
         for (GenericTreeNode mutOnPath : finalPath)
         {
             if (mutOnPath.getChosenChange().compare(this.getChosenChange()))
-                return false;
+                return true;
         }
-        return true;
+        return false;
     }
 
 
@@ -798,7 +801,7 @@ public class GenericTreeNode {
     {
         ArrayList<SingleChange> newPossibilities = possibilities;
 
-        for(SingleChange sg : possibilities)
+        for(SingleChange sg : newPossibilities)
         {
             
if(sg.getParentTableColumn().getTable().getPrimaryColumns().contains(sg.getParentTableColumn()))
 // unique OR PK constraints
             {
@@ -829,7 +832,8 @@ public class GenericTreeNode {
                 || column.getTypeName().equals("_text")
                 || column.getTypeName().equals("text")
                 || column.getTypeName().equals("email")
-                || column.getTypeName().equals("bytea"))
+                || column.getTypeName().equals("bytea")
+                || column.getTypeName().equals("bpchar"))
             return 1;
         else
             return 0;
diff --git a/src/test/java/org/schemaspy/model/GenericTreeNodeTest.java 
b/src/test/java/org/schemaspy/model/GenericTreeNodeTest.java
index fb77f06..8b06778 100644
--- a/src/test/java/org/schemaspy/model/GenericTreeNodeTest.java
+++ b/src/test/java/org/schemaspy/model/GenericTreeNodeTest.java
@@ -78,6 +78,7 @@ public class GenericTreeNodeTest extends 
AbstractTestExecutionListener {
         }
     }
 
+    @Ignore
     @Test
     public void WeightPropagationTest() throws Exception
     {
@@ -120,7 +121,7 @@ public class GenericTreeNodeTest extends 
AbstractTestExecutionListener {
 
     }
 
-
+    @Ignore
     @Test
     public void SingleChangeBasedOnWeightShouldNotReturnNull() throws Exception
     {
@@ -146,6 +147,7 @@ public class GenericTreeNodeTest extends 
AbstractTestExecutionListener {
         Assert.assertNotNull(tmpMutation3.singleChangeBasedOnWeight());
     }
 
+    @Ignore
     @Test
     public void singleChangeAttachedMutationShouldMatch() throws Exception// 
Not very Usefull
     {
@@ -165,6 +167,7 @@ public class GenericTreeNodeTest extends 
AbstractTestExecutionListener {
 
     }
 
+    @Ignore
     @Test
     public void NoNullMutationPossibilitiesTest() throws Exception
     {
@@ -180,6 +183,7 @@ public class GenericTreeNodeTest extends 
AbstractTestExecutionListener {
 
     }
 
+    @Ignore
     @Test
     public void injectAndUndoConsistencyTest() throws Exception
     {
@@ -213,6 +217,7 @@ public class GenericTreeNodeTest extends 
AbstractTestExecutionListener {
 
     }
 
+    @Ignore
     @Test
     public void compareTest() throws Exception
     {
diff --git a/src/test/java/org/schemaspy/model/GenericTreeTest.java 
b/src/test/java/org/schemaspy/model/GenericTreeTest.java
index e5ca9e4..5a8e692 100644
--- a/src/test/java/org/schemaspy/model/GenericTreeTest.java
+++ b/src/test/java/org/schemaspy/model/GenericTreeTest.java
@@ -40,6 +40,7 @@ public class GenericTreeTest {
     @MockBean
     private CommandLineRunner commandLineRunner;
 
+    @Ignore
     @Test
     public void checkMaxDepthTest() throws Exception
     {

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]