summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlas Kozat <ulas.kozat@gmail.com>2016-06-21 12:00:44 +0200
committerUlas Kozat <ulas.kozat@gmail.com>2016-06-21 12:00:44 +0200
commitd87e15b4b4483feef0bd96af54578f4a53002a85 (patch)
tree6b879629a99670d16dbcb20072afec63b12796c4 /tests
parent70fd1bfdba7268d950e59f0f2244cb4194c66cc1 (diff)
updated test script and folders
Change-Id: I9840371e558adc86c83b311afee337c8bb6fedbc Signed-off-by: Ulas Kozat <ulas.kozat@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/refdata/test1.ref29
-rw-r--r--tests/run.sh24
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"