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
23 pgrep -f "python DominoServer.py" && return 0
24 python DominoServer.py --log "$LOGLEVEL" > server.log 2>&1 &
28 pgrep -f "python DominoServer.py" || return 0
29 kill $(pgrep -f "python DominoServer.py")
34 pgrep -f "python DominoClient.py" && return 0
35 python DominoClient.py -p $CLIENT1_PORT --cliport $CLIENT1_CLIPORT \
36 --log "$LOGLEVEL" > client1.log 2>&1 &
40 pgrep -f "python DominoClient.py" || return 0
41 kill $(pgrep -f "python DominoClient.py")
46 if [ -f dominoserver.db ]; then
50 if [ -d toscafiles ]; then
55 echo "domino/tests/run.sh has been executed."
57 echo "Cleaning residue files and folders from previous runs..."
60 echo "Launching Domino Server..."
64 echo "Launching Domino Client 1..."
69 python domino-cli.py $CLIENT1_CLIPORT heartbeat
72 echo "Test Subscribe API"
73 python domino-cli.py $CLIENT1_CLIPORT subscribe -t hot \
74 -l tosca.policies.Placement:properties:region:nova-1
76 python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top OVERWRITE
78 python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top DELETE
80 python domino-cli.py $CLIENT1_CLIPORT subscribe \
81 -l tosca.policies.Placement:properties:region:nova-2 \
83 python domino-cli.py $CLIENT1_CLIPORT subscribe \
84 -l tosca.policies.Placement:properties:region:nova-3 \
87 python domino-cli.py $CLIENT1_CLIPORT subscribe \
88 -l tosca.policies.Placement:properties:region:nova-3 \
92 echo "Test Publish API"
93 python domino-cli.py $CLIENT1_CLIPORT publish -t "$toscafile_test1"
97 echo "Stopping Domino Client 1..."
100 echo "Stopping Domino Server..."
103 #will use the form below to declare success or failure
104 #diff -q file1 file2 1>/dev/null
109 # echo "Not the same"