Commit 5f7a5a16 authored by Raphael Defosseux's avatar Raphael Defosseux

fix(rhel): installing curl version that supports HTTP2

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 2f72eea2
......@@ -74,6 +74,11 @@ RUN yum repolist --disablerepo=* && \
http://repo.openfusion.net/centos7-x86_64/hyperscan-5.3.0-1.of.el7.x86_64.rpm && \
rpm -i *.rpm && \
rm *.rpm && \
# The CURL version installed is 7.29 and does not support HTTP2
wget --tries=4 --retry-connrefused --wait=8 \
https://github.com/moparisthebest/static-curl/releases/download/v7.85.0/curl-amd64 \
-O /usr/bin/curl && \
chmod +x /usr/bin/curl && \
yum remove -y wget && \
yum clean all -y && \
rm -rf /var/cache/yum /var/cache/dnf
......
......@@ -110,6 +110,11 @@ RUN yum repolist --disablerepo=* && \
http://repo.openfusion.net/centos7-x86_64/hyperscan-5.3.0-1.of.el7.x86_64.rpm && \
rpm -i *.rpm && \
rm *.rpm && \
# The CURL version installed is 7.29 and does not support HTTP2
wget --tries=4 --retry-connrefused --wait=8 \
https://github.com/moparisthebest/static-curl/releases/download/v7.85.0/curl-amd64 \
-O /usr/bin/curl && \
chmod +x /usr/bin/curl && \
yum remove -y wget && \
yum clean all -y && \
rm -rf /var/cache/yum /var/cache/dnf
......
......@@ -29,22 +29,32 @@
#*/
#"""
UPF_PROFILE=$CONFIG_DIR/upf_profile.json
if [ ! -v UUID ]; then
echo "UUID is not defined"
UUID=`grep nfInstanceId ${UPF_PROFILE} | sed -e 's@ "nfInstanceId": "@@' -e 's@",@@'`
else
echo "UUID is exported: ${UUID}"
fi
NRF_URL=$NRF_IP_ADDR:$NRF_PORT/nnrf-nfm/v1/nf-instances/$UUID
echo "NRF_URL is ${NRF_URL}"
##### Variables #####
DUMP_STATUS_CODE=$(echo '--write-out %{http_code} --silent --output /dev/null')
PATCH_DATA=$(echo '[{"op":"replace","path":"/nfStatus","value":"REGISTERED"}]')
CONTENT_TYPE=$(echo 'Content-Type: application/json')
HTTP2=--http2-prior-knowledge
UPF_PROFILE=$CONFIG_DIR/upf_profile.json
NF_HEARTBEAT_TIMER=10
NF_HEARTBEAT_START=5
##### NF Registration #####
echo "Sending NF Registration Request (HTTP Version $HTTP_VERSION)"
if [[ ${HTTP_VERSION} == 2 ]];then
echo 'curl command options are: ${HTTP2} ${DUMP_STATUS_CODE} -X PUT ${NRF_URL} -d @${UPF_PROFILE} -H "${CONTENT_TYPE}"'
response=$(curl $HTTP2 $DUMP_STATUS_CODE -X PUT $NRF_URL -d @$UPF_PROFILE -H "$CONTENT_TYPE")
else
echo 'curl command options are: ${DUMP_STATUS_CODE} -X PUT ${NRF_URL} -d @${UPF_PROFILE} -H "${CONTENT_TYPE}"'
response=$(curl $DUMP_STATUS_CODE -X PUT $NRF_URL -d @$UPF_PROFILE -H "$CONTENT_TYPE")
fi
......@@ -66,6 +76,6 @@ if [[ ${response} == 201 || ${response} == 200 ]];then
sleep $NF_HEARTBEAT_TIMER
done
else
echo -e "\nNF Registration Procedure Failed ........!!!!"
echo -e "\nNF Registration Procedure Failed (response is ${response}) ........!!!!"
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment