diff options
-rw-r--r-- | tests/refdata/test1.ref | 29 | ||||
-rw-r--r-- | tests/run.sh | 24 |
2 files changed, 43 insertions, 10 deletions
diff --git a/tests/refdata/test1.ref b/tests/refdata/test1.ref new file mode 100644 index 0000000..2f3b328 --- /dev/null +++ b/tests/refdata/test1.ref @@ -0,0 +1,29 @@ +Domino Client Starting... +1 Sending Registration +Registration Response: Response Code: 1 +CLI Service is starting +RPC service for CLI is starting... +Received CLI ['heartbeat'] +12467 Sending heartbeat +heart beat received from: 0 ,sequence number: 1 +Received CLI ['subscribe', '-t', 'hot', '-l', 'tosca.policies.Placement:properties:region:nova-1'] +subscribing labels ['tosca.policies.Placement:properties:region:nova-1'] and templates ['hot'] +Subscribe Response is received from: 0 ,sequence number: 2 +Received CLI ['subscribe', '-t', 'dummy1,dummy2', '--top', 'OVERWRITE'] +subscribing labels [] and templates ['dummy1', 'dummy2'] +Subscribe Response is received from: 0 ,sequence number: 3 +Received CLI ['subscribe', '-t', 'dummy1,dummy2', '--top', 'DELETE'] +subscribing labels [] and templates ['dummy1', 'dummy2'] +Subscribe Response is received from: 0 ,sequence number: 4 +Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-2', 'sleep', '1'] +subscribing labels ['tosca.policies.Placement:properties:region:nova-2'] and templates [] +Subscribe Response is received from: 0 ,sequence number: 5 +Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-3', '--lop', 'OVERWRITE'] +subscribing labels ['tosca.policies.Placement:properties:region:nova-3'] and templates [] +Subscribe Response is received from: 0 ,sequence number: 6 +Received CLI ['subscribe', '-l', 'tosca.policies.Placement:properties:region:nova-3', '--lop', 'DELETE'] +subscribing labels ['tosca.policies.Placement:properties:region:nova-3'] and templates [] +Subscribe Response is received from: 0 ,sequence number: 7 +Received CLI ['publish', '-t', './tosca-templates/tosca_helloworld_nfv.yaml'] +Publishing the template file: ./tosca-templates/tosca_helloworld_nfv.yaml +Publish Response is received from: 0 ,sequence number: 8 Op. Status: 1 diff --git a/tests/run.sh b/tests/run.sh index fffa6ce..b9ec9ae 100644 --- a/tests/run.sh +++ b/tests/run.sh @@ -18,10 +18,13 @@ CLIENT2_CLIPORT=9200 LOGLEVEL=DEBUG toscafile_test1=./tosca-templates/tosca_helloworld_nfv.yaml +test1_reffile=./tests/refdata/test1.ref +client1_log=./tests/logdata/client1.log +server_log=./tests/logdata/server.log start_server() { pgrep -f "python DominoServer.py" && return 0 - python DominoServer.py --log "$LOGLEVEL" > server.log 2>&1 & + python DominoServer.py --log "$LOGLEVEL" > "$server_log" 2>&1 & } stop_server() { @@ -33,7 +36,7 @@ stop_server() { start_client1() { pgrep -f "python DominoClient.py" && return 0 python DominoClient.py -p $CLIENT1_PORT --cliport $CLIENT1_CLIPORT \ - --log "$LOGLEVEL" > client1.log 2>&1 & + --log "$LOGLEVEL" > "$client1_log" 2>&1 & } stop_client1() { @@ -48,7 +51,7 @@ clean_directories() { fi if [ -d toscafiles ]; then - rm rf toscafiles + rm -rf toscafiles fi } @@ -100,14 +103,15 @@ stop_client1 echo "Stopping Domino Server..." stop_server +cut -d " " -f 4- "$client1_log" > file1 #will use the form below to declare success or failure -#diff -q file1 file2 1>/dev/null -#if [[ $? == "0" ]] -#then -# echo "The same" -#else -# echo "Not the same" -#fi +diff -q file1 "$test1_reffile" 1>/dev/null +if [[ $? == "0" ]] +then + echo "SUCCESS" +else + echo "FAILURE" +fi echo "done" |