From 39ddc27a31d3e12b51db88ddace64135399d3e35 Mon Sep 17 00:00:00 2001 From: blsaws Date: Wed, 12 Oct 2016 12:40:32 -0700 Subject: Build agent demo library into the app VM JIRA: VES-1 Change-Id: Iaa4c25dd78b0cc0c83979706709443c69ad0db1e Signed-off-by: blsaws --- tests/blueprints/tosca-vnfd-hello-ves/start.sh | 34 +++++++++++++++++++++----- tests/vHello_VES.sh | 5 ---- 2 files changed, 28 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/blueprints/tosca-vnfd-hello-ves/start.sh b/tests/blueprints/tosca-vnfd-hello-ves/start.sh index 6c8fbeb..eeaf887 100755 --- a/tests/blueprints/tosca-vnfd-hello-ves/start.sh +++ b/tests/blueprints/tosca-vnfd-hello-ves/start.sh @@ -24,6 +24,33 @@ # ID: username:password to use in REST # +setup_agent () { + echo "$0: Install prerequisites" + sudo apt-get install -y gcc + # NOTE: force is required as some packages can't be authenticated... + sudo apt-get install -y --force-yes libcurl4-openssl-dev + sudo apt-get install -y make + + echo "$0: Clone agent library" + cd /home/ubuntu + git clone https://github.com/att/evel-library.git + + echo "$0: Build agent demo" + sed -i -- '/api_secure,/{n;s/.*/ "hello",/}' evel-library/code/evel_demo/evel_demo.c + sed -i -- '/"hello",/{n;s/.*/ "world",/}' evel-library/code/evel_demo/evel_demo.c + + echo "$0: Build agent demo" + cd evel-library/bldjobs + make + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ubuntu/evel-library/libs/x86_64 + + echo "$0: Start agent demo, repeat every minute" + crontab -l > /tmp/cron + echo "* * * * 1-5 /home/ubuntu/evel-library/output/x86_64/evel_demo --fqdn $COL_IP --port 30000 -v" >> /tmp/cron + crontab /tmp/cron + rm /tmp/cron +} + echo "$0: Setup website and dockerfile" mkdir ~/www mkdir ~/www/html @@ -76,9 +103,4 @@ echo "$0: setup VES event delivery for the nginx server" export COL_IP=$1 export COL_ID=$2 -while true -do - sleep 30 - curl --user $COL_ID -H "Content-Type: application/json" -X POST -d '{ "event": { "commonEventHeader": { "domain": "fault", "eventType": "Fault_MobileCallRecording_PilotNumberPoolExhaustion", "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", "sequence": "0", "priority": "High", "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", "sourceName": "EricssonECE", "functionalRole": "SCF", "startEpochMicrosec": "1413378172000000", "lastEpochMicrosec": "1413378172000000", "reportingEntityId": "de305d54-75b4-431b-adb2-eb6b9e546014", "reportingEntityName": "EricssonECE" }, "faultFields": { "alarmCondition": "PilotNumberPoolExhaustion", "eventSourceType": "other(0)", "specificProblem": "Calls cannot complete because pilot numbers are unavailable", "eventSeverity": "CRITICAL", "vfStatus": "Active" } } }' http://$COL_IP:30000/eventListener/v1 -done - +setup_agent diff --git a/tests/vHello_VES.sh b/tests/vHello_VES.sh index 85120d2..7c65199 100644 --- a/tests/vHello_VES.sh +++ b/tests/vHello_VES.sh @@ -223,11 +223,6 @@ cd /home/ubuntu/ git clone https://github.com/att/evel-test-collector.git sed -i -- 's/vel_username = /vel_username = hello/' evel-test-collector/config/collector.conf sed -i -- 's/vel_password = /vel_password = world/' evel-test-collector/config/collector.conf -nohup python evel-test-collector/code/collector/collector.py \ - --config evel-test-collector/config/collector.conf \ - --section default \ - --verbose > ~/collector.log & -exit EOF echo "$0: start vHello web server in VDU1" -- cgit 1.2.3-korg