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 | | n |
+------------------------+ +--------------------------+
|(:Node {tmp: "\"\\;\\"})| | (:Node {tmp: "\"\\;\\"}) |
+------------------------+ +--------------------------+

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -54,12 +54,25 @@ if [ ! -d $input_dir ]; then
exit 1 exit 1
fi 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 ## Startup
# Start the memgraph process and wait for it to start. # Start the memgraph process and wait for it to start.
echo_info "Starting memgraph" echo_info "Starting memgraph"
$memgraph_dir/memgraph &> /dev/null & $memgraph_dir/memgraph --cert-file=$cert_file --key-file=$key_file &
pid=$! pid=$!
wait_for_server 7687 wait_for_server 7687
echo_success "Started memgraph" echo_success "Started memgraph"
@ -70,7 +83,7 @@ echo_success "Started memgraph"
echo_info "Running tests" echo_info "Running tests"
echo # Blank line echo # Blank line
client_flags="--use-ssl=false" client_flags="--use-ssl=$use_ssl"
test_code=0 test_code=0
for output_dir in $tests_dir/output_*; do for output_dir in $tests_dir/output_*; do
for filename in $input_dir/*; do for filename in $input_dir/*; do