3 #Copyright 2016 Open Platform for NFV Project, Inc. and its contributors
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
20 toscafile_test1=./tosca-templates/tosca_helloworld_nfv.yaml
21 test1_reffile=./tests/refdata/test1.ref
22 client1_log=./tests/logdata/client1.log
23 server_log=./tests/logdata/server.log
26 pgrep -f "python DominoServer.py" && return 0
27 python DominoServer.py --log "$LOGLEVEL" > "$server_log" 2>&1 &
31 pgrep -f "python DominoServer.py" || return 0
32 kill $(pgrep -f "python DominoServer.py")
37 pgrep -f "python DominoClient.py" && return 0
38 python DominoClient.py -p $CLIENT1_PORT --cliport $CLIENT1_CLIPORT \
39 --log "$LOGLEVEL" > "$client1_log" 2>&1 &
43 pgrep -f "python DominoClient.py" || return 0
44 kill $(pgrep -f "python DominoClient.py")
49 if [ -f dominoserver.db ]; then
53 if [ -d toscafiles ]; then
58 echo "domino/tests/run.sh has been executed."
60 echo "Cleaning residue files and folders from previous runs..."
63 echo "Launching Domino Server..."
67 echo "Launching Domino Client 1..."
72 python domino-cli.py $CLIENT1_CLIPORT heartbeat
75 echo "Test Subscribe API"
76 python domino-cli.py $CLIENT1_CLIPORT subscribe -t hot \
77 -l tosca.policies.Placement:properties:region:nova-1
79 python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top OVERWRITE
81 python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top DELETE
83 python domino-cli.py $CLIENT1_CLIPORT subscribe \
84 -l tosca.policies.Placement:properties:region:nova-2 \
86 python domino-cli.py $CLIENT1_CLIPORT subscribe \
87 -l tosca.policies.Placement:properties:region:nova-3 \
90 python domino-cli.py $CLIENT1_CLIPORT subscribe \
91 -l tosca.policies.Placement:properties:region:nova-3 \
95 echo "Test Publish API"
96 python domino-cli.py $CLIENT1_CLIPORT publish -t "$toscafile_test1"
100 echo "Stopping Domino Client 1..."
103 echo "Stopping Domino Server..."
106 cut -d " " -f 4- "$client1_log" > file1
107 #will use the form below to declare success or failure
108 diff -q file1 "$test1_reffile" 1>/dev/null