Integrate mg_client test with Apollo

Reviewers: teon.banek, buda, mculinovic

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1685
This commit is contained in:
Matej Ferencevic 2018-10-19 14:47:43 +02:00
parent 8c2e87b8a2
commit 7f2ad99ce7
9 changed files with 142 additions and 120 deletions

View File

@ -0,0 +1,9 @@
- name: tools__test_mg_client
commands: |
./test_mg_client
./test_mg_client --use-ssl
infiles:
- test_mg_client # test_mg_client script
- client # test files
- ../../build_release/memgraph # memgraph binary
- ../../build_release/tools/src/mg_client # mg_client binary

View File

@ -1,5 +1,5 @@
+------------------------+
| n |
+------------------------+
|(:Node {tmp: "\"\\;\\"})|
+------------------------+
+--------------------------+
| n |
+--------------------------+
| (:Node {tmp: "\"\\;\\"}) |
+--------------------------+

View File

@ -1,30 +1,30 @@
+---------------------------------------------+
| n |
+---------------------------------------------+
|(:Constantine {quote: "In hoc signo vinces"})|
+---------------------------------------------+
+---------------------------------------------+
| n |
+---------------------------------------------+
|(:Constantine {quote: "In hoc signo vinces"})|
+---------------------------------------------+
+-------------------------------------------------------+
| n |
+-------------------------------------------------------+
|(:Erdody {quote: "Regnum regno non praescribit leges"})|
+-------------------------------------------------------+
+-------------------------------------------------------+
| n |
+-------------------------------------------------------+
|(:Erdody {quote: "Regnum regno non praescribit leges"})|
+-------------------------------------------------------+
+-----------------------------------+
| n |
+-----------------------------------+
|(:Caesar {quote: "Alea iacta est"})|
+-----------------------------------+
+-----------------------------------+
| n |
+-----------------------------------+
|(:Caesar {quote: "Alea iacta est"})|
+-----------------------------------+
+-----------------------------------------------+
| n |
+-----------------------------------------------+
| (:Constantine {quote: "In hoc signo vinces"}) |
+-----------------------------------------------+
+-----------------------------------------------+
| n |
+-----------------------------------------------+
| (:Constantine {quote: "In hoc signo vinces"}) |
+-----------------------------------------------+
+---------------------------------------------------------+
| n |
+---------------------------------------------------------+
| (:Erdody {quote: "Regnum regno non praescribit leges"}) |
+---------------------------------------------------------+
+---------------------------------------------------------+
| n |
+---------------------------------------------------------+
| (:Erdody {quote: "Regnum regno non praescribit leges"}) |
+---------------------------------------------------------+
+-------------------------------------+
| n |
+-------------------------------------+
| (:Caesar {quote: "Alea iacta est"}) |
+-------------------------------------+
+-------------------------------------+
| n |
+-------------------------------------+
| (:Caesar {quote: "Alea iacta est"}) |
+-------------------------------------+

View File

@ -1,5 +1,5 @@
+---------+---------+---------+
| n | e | m |
+---------+---------+---------+
|(:Node) |[Edge] |(:Vertex)|
+---------+---------+---------+
+-----------+-----------+-----------+
| n | e | m |
+-----------+-----------+-----------+
| (:Node) | [Edge] | (:Vertex) |
+-----------+-----------+-----------+

View File

@ -1,15 +1,15 @@
+-------+
| n |
+-------+
|(:Node)|
+-------+
+---------+
| n |
+---------+
|(:Vertex)|
+---------+
+---------+
| n |
+---------+
|(:Vertex)|
| (:Node) |
+---------+
+-----------+
| n |
+-----------+
| (:Vertex) |
+-----------+
+-----------+
| n |
+-----------+
| (:Vertex) |
+-----------+

View File

@ -1,20 +1,20 @@
+-------+
| n |
+-------+
|(:Node)|
+-------+
+-------+
| n |
+-------+
|(:Node)|
+-------+
+---------+
| n |
+---------+
|(:Vertex)|
| (:Node) |
+---------+
+---------+
| n |
+---------+
|(:Vertex)|
| (:Node) |
+---------+
+-----------+
| n |
+-----------+
| (:Vertex) |
+-----------+
+-----------+
| n |
+-----------+
| (:Vertex) |
+-----------+

View File

@ -1,25 +1,25 @@
+---------------------------------------+
| n |
+---------------------------------------+
|(:Ciceron {quote: "o tempora o mores"})|
+---------------------------------------+
+----------------------------------------+
| n |
+----------------------------------------+
|(:Ciceron {quote: "o tempora o mores!"})|
+----------------------------------------+
+-------------------------------------------+
| n |
+-------------------------------------------+
|(:Ciceron {quote: "o tempora \'o mores\'"})|
+-------------------------------------------+
+-------------------------------------------+
| n |
+-------------------------------------------+
|(:Ciceron {quote: "o tempora \"o mores\""})|
+-------------------------------------------+
+-------------------------------------------+
| n |
+-------------------------------------------+
|(:Ciceron {quote: "o tempora \"o mores\""})|
+-------------------------------------------+
+-----------------------------------------+
| n |
+-----------------------------------------+
| (:Ciceron {quote: "o tempora o mores"}) |
+-----------------------------------------+
+------------------------------------------+
| n |
+------------------------------------------+
| (:Ciceron {quote: "o tempora o mores!"}) |
+------------------------------------------+
+---------------------------------------------+
| n |
+---------------------------------------------+
| (:Ciceron {quote: "o tempora \'o mores\'"}) |
+---------------------------------------------+
+---------------------------------------------+
| n |
+---------------------------------------------+
| (:Ciceron {quote: "o tempora \"o mores\""}) |
+---------------------------------------------+
+---------------------------------------------+
| n |
+---------------------------------------------+
| (:Ciceron {quote: "o tempora \"o mores\""}) |
+---------------------------------------------+

View File

@ -1,30 +1,30 @@
+-------------------------------------+
| n |
+-------------------------------------+
|(:Ovid {quote: "Exitus Acta Probat"})|
+-------------------------------------+
+-------------------------------------+
| n |
+-------------------------------------+
|(:Ovid {quote: "Exitus Acta Probat"})|
+-------------------------------------+
+-------------------------------------+
| n |
+-------------------------------------+
|(:Ovid {quote: "Exitus Acta Probat"})|
+-------------------------------------+
+----------------------------+
| n |
+----------------------------+
|(:Bible {quote: "Fiat Lux"})|
+----------------------------+
+-------------------------------------+
| n |
+-------------------------------------+
|(:Plinius {quote: "In vino veritas"})|
+-------------------------------------+
+-------------------------------------+
| n |
+-------------------------------------+
|(:Plinius {quote: "In vino veritas"})|
+-------------------------------------+
+---------------------------------------+
| n |
+---------------------------------------+
| (:Ovid {quote: "Exitus Acta Probat"}) |
+---------------------------------------+
+---------------------------------------+
| n |
+---------------------------------------+
| (:Ovid {quote: "Exitus Acta Probat"}) |
+---------------------------------------+
+---------------------------------------+
| n |
+---------------------------------------+
| (:Ovid {quote: "Exitus Acta Probat"}) |
+---------------------------------------+
+------------------------------+
| n |
+------------------------------+
| (:Bible {quote: "Fiat Lux"}) |
+------------------------------+
+---------------------------------------+
| n |
+---------------------------------------+
| (:Plinius {quote: "In vino veritas"}) |
+---------------------------------------+
+---------------------------------------+
| n |
+---------------------------------------+
| (:Plinius {quote: "In vino veritas"}) |
+---------------------------------------+

View File

@ -54,12 +54,25 @@ if [ ! -d $input_dir ]; then
exit 1
fi
# Check and generate SSL certificates
use_ssl=false
key_file=""
cert_file=""
if [ "$1" == "--use-ssl" ]; then
use_ssl=true
key_file=".key.pem"
cert_file=".cert.pem"
openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \
-subj "/C=HR/ST=Zagreb/L=Zagreb/O=Memgraph/CN=db.memgraph.com" \
-keyout $key_file -out $cert_file || exit 1
fi
## Startup
# Start the memgraph process and wait for it to start.
echo_info "Starting memgraph"
$memgraph_dir/memgraph &> /dev/null &
$memgraph_dir/memgraph --cert-file=$cert_file --key-file=$key_file &
pid=$!
wait_for_server 7687
echo_success "Started memgraph"
@ -70,7 +83,7 @@ echo_success "Started memgraph"
echo_info "Running tests"
echo # Blank line
client_flags="--use-ssl=false"
client_flags="--use-ssl=$use_ssl"
test_code=0
for output_dir in $tests_dir/output_*; do
for filename in $input_dir/*; do