Skip to content

Commit

Permalink
Adding a stray file that was lying around, but a very useful script i…
Browse files Browse the repository at this point in the history
…t has been, so I'm adding it to the repo
  • Loading branch information
la3lma committed Oct 1, 2019
1 parent 639296d commit 7ed9805
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ metrics_descriptor.pb

# Python virtual env
venv
prime-service-account.json
54 changes: 54 additions & 0 deletions sim-administration/sm-dp-plus-emulator/test-smdp-plus-emulator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash -x

##
## Utility script that can be used to see if the sm-dp+ emulator
## is behaving halfway decently. Obviously we should also have
## unit tests, integration tests etc., but this script has proven to
## be handy while developing the emulator, so I'm including it for
## completeness/posterity.
##

#ES2PLUS_ENDPOINT="http://0.0.0.0:18080"
ES2PLUS_ENDPOINT="http://127.0.0.1:8080"
FUNCTION_REQUESTER_IDENTIFIER=Dunderhonning
ICCID="8901000000000000001"
FUNCTION_REQUESTER_EMULATOR="Dunderhonning"
GET_PROFILE_STATUS_PATH="/gsma/rsp2/es2plus/getProfileStatus"
GET_PROFILE_STATUS_PAYLOAD=$(cat <<EOF
{
"header":{
"functionRequesterIdentifier": "${FUNCTION_REQUESTER_IDENTIFIER}",
"functionCallIdentifier": "TX-568"},
"iccidList":[{"iccid":"${ICCID}"}]
}
EOF
)

PROFILE_STATUS_CMD_URL="${ES2PLUS_ENDPOINT}${GET_PROFILE_STATUS_PATH}"
PROFILE_STATUS_CMD_PAYLOAD=$GET_PROFILE_STATUS_PAYLOAD

CMD_URL="${ES2PLUS_ENDPOINT}${GET_PROFILE_STATUS_PATH}"
CMD_PAYLOAD=$PROFILE_STATUS_CMD_PAYLOAD



## Loop until the result of curling the sm-dp+ emulator is
## satisfactory.
CURL_RESULT=""
#until [[ ! -z "$CURL_RESULT" ]] ; do
#CURL_RESULT=$(
curl \
-vvv \
--header "X-Admin-Protocol: gsma/rsp/v2.0.0" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--request POST \
--data "$CMD_PAYLOAD" \
--insecure \
$CMD_URL
# )
## XXX MISSING: Something that verifies that the result
## is legit.
#done


0 comments on commit 7ed9805

Please sign in to comment.