2 # $1 mocker server host
3 # $2 mocker server port
5 if [ "$#" -ne 2 ]; then
6 echo "need 2 arguments"
10 export mockserver_host=$1
11 export mockserver_port=$2
12 export SMO_ENDPOINT="https://${mockserver_host}:${mockserver_port}/mockserver"
14 VALID_CLOUD_OBSERVER="{
15 \"id\": \"mock_smo_registration\",
17 \"path\" : \"/mock_smo/v1/ocloud_observer\",
24 \"result\": \"Welcome to mocked smo server!\"
30 INVALID_CLOUD_OBSERVER="{
31 \"id\": \"invalid_mock_smo_registration\",
33 \"path\" : \"/mock_smo/v1/invalid_ocloud_observer\",
40 \"result\": \"mocked smo server invalid\"
46 O2IMS_INVENTORY_OBSERVER="{
47 \"id\": \"mock_smo_inventory_change_notification_endpoint_registration\",
49 \"path\" : \"/mock_smo/v1/o2ims_inventory_observer\",
56 \"result\": \"this is mocked inventory change notification callback\"
62 O2IMS_ALARM_OBSERVER="{
63 \"id\": \"mock_smo_alarm_notification_endpoint_registration\",
65 \"path\" : \"/mock_smo/v1/o2ims_alarm_observer\",
72 \"result\": \"Welcome to mocked smo server alarm notification endpoint\"
78 curl -s -k -X PUT $SMO_ENDPOINT/expectation --header 'Content-Type: application/json' \
79 --header 'Accept: application/json' \
80 -d "${VALID_CLOUD_OBSERVER}"
82 curl -s -k -X PUT $SMO_ENDPOINT/expectation --header 'Content-Type: application/json' \
83 --header 'Accept: application/json' \
84 -d "${INVALID_CLOUD_OBSERVER}"
86 curl -s -k -X PUT $SMO_ENDPOINT/expectation --header 'Content-Type: application/json' \
87 --header 'Accept: application/json' \
88 -d "${O2IMS_INVENTORY_OBSERVER}"
91 curl -s -k -X PUT $SMO_ENDPOINT/expectation --header 'Content-Type: application/json' \
92 --header 'Accept: application/json' \
93 -d "${O2IMS_ALARM_OBSERVER}"