Scott Baker | acb2bf6 | 2019-03-15 10:20:35 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Copyright 2017-present Open Networking Foundation |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | set -e |
| 18 | |
| 19 | CHAMELEON_URL=http://`hostname`:30006/xosapi/v1/testservice/testserviceserviceinstances |
| 20 | TOSCA_URL=http://`hostname`:30007 |
| 21 | TEST_POD=`kubectl get pods | grep -i testservice | cut -f 1 -d " "` |
| 22 | RECIPE=../tosca/test_sync_after_policy.yaml |
| 23 | |
| 24 | curl -H "xos-username: admin@opencord.org" -H "xos-password: letmein" -X post --data-binary @$RECIPE $TOSCA_URL/run |
| 25 | |
| 26 | echo "done tosca" |
| 27 | |
| 28 | cat <<EOF > wait_for.txt |
| 29 | TEST:SYNC_DONE id=[0-9]+ model_class=TestserviceServiceInstance model_name=u'test-sync-after-policy' some_integer=0 some_other_integer=0 |
| 30 | TEST:POLICY_DONE id=[0-9]+ model_class=TestserviceServiceInstance model_name=u'test-sync-after-policy' some_integer=0 some_other_integer=0 |
| 31 | EOF |
| 32 | kubectl logs -f --since=30s $TEST_POD | ansi2txt | python wait_for_lines.py wait_for.txt |
| 33 | |
| 34 | python ./verify_model.py $CHAMELEON_URL name=test-sync-after-policy "updated>=0" "enacted>=@updated" "policed>=@updated" |