X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Fuse_cases%2Fseba_on_arm%2Ftest%2Fponsim%2Finstall.sh;h=b6baf61ccffe41f056b16c4d63eda1f4133d20d9;hb=7cd1361ac2e8f3de4ac436129d6ce0ba2785e633;hp=6aa728b4e409846167a4f126afd37d3fcc7ae467;hpb=e70f1cbe15e44cc01e3114cd69481e9b33ce351f;p=iec.git diff --git a/src/use_cases/seba_on_arm/test/ponsim/install.sh b/src/use_cases/seba_on_arm/test/ponsim/install.sh index 6aa728b..b6baf61 100755 --- a/src/use_cases/seba_on_arm/test/ponsim/install.sh +++ b/src/use_cases/seba_on_arm/test/ponsim/install.sh @@ -3,62 +3,37 @@ set -ex -basepath=$(cd "$(dirname "$0")"; pwd) +basepath="$(cd "$(dirname "$(readlink -f "$0")")"; pwd)" +IEC_PATH="$(readlink -f "$(git -C "${basepath}" rev-parse --show-toplevel)")" +HELM_CHARTS_PATH="src/use_cases/seba_on_arm/src_repo/helm-charts" -# Using opencord automation-tools from the cord-6.1 maintenance branch -AUTO_TOOLS_GIT="https://github.com/opencord/automation-tools.git" -AUTO_TOOLS_VER=${AUTO_TOOLS_VER:-cord-6.1} - -export M=/tmp/milestones +export M="/tmp/milestones" export SEBAVALUE= -export WORKSPACE=${HOME} +export WORKSPACE="${HOME}" + +# Using opencord automation-tools from the cord-6.1 maintenance branch +AUTO_TOOLS="${WORKSPACE}/automation-tools" +AUTO_TOOLS_REPO="https://github.com/iecedge/automation-tools.git" +AUTO_TOOLS_REV="${AUTO_TOOLS_VER:-cord-7.0-arm64}" -mkdir -p ${M} "${WORKSPACE}/cord/test" +rm -rf "${M}" +mkdir -p "${M}" "${WORKSPACE}/cord/test" # Update helm-charts submdule needed later # ignore subproject commit and use latest remote version -git submodule update --init --remote "${basepath}/../../src_repo/helm-charts" +git -C "${IEC_PATH}" submodule update --init --remote "${HELM_CHARTS_PATH}" -cd "${WORKSPACE}" -test -d automation-tools || git clone "${AUTO_TOOLS_GIT}" -cd "${WORKSPACE}/automation-tools" && git checkout "${AUTO_TOOLS_VER}" - -# Fake the setup phase so that portcheck.sh is not called -# also install some required packages -sudo apt install -y httpie jq software-properties-common bridge-utils make -# add iptbles rule needed to forward DHCP packets comming from the RG_POD -sudo iptables -P FORWARD ACCEPT -touch "${M}/setup" - -# Skip helm installation if it already exists and fake /usr/local/bin/helm -if xhelm=$(command -v helm) -then - if [ "${xhelm}" != "/usr/local/bin/helm" ] - then - echo "helm is installed at ${xhelm}; symlinking to /usr/local/bin/helm" - mkdir -p /usr/local/bin/ || true - sudo ln -sf "${xhelm}" /usr/local/bin/helm - fi -else - echo "helm is not installed" -fi +test -d "${AUTO_TOOLS}" || git clone "${AUTO_TOOLS_REPO}" "${AUTO_TOOLS}" +git -C "${AUTO_TOOLS}" checkout "${AUTO_TOOLS_REV}" # Faking helm-charts repo clone to our own git submodule if not already there CHARTS="${WORKSPACE}/cord/helm-charts" -test -d "${CHARTS}" || test -h "${CHARTS}" || \ - ln -s "${basepath}/../../src_repo/helm-charts" "${CHARTS}" +test -d "${CHARTS}" || test -L "${CHARTS}" || \ + ln -s "${IEC_PATH}/${HELM_CHARTS_PATH}" "${CHARTS}" -# Fake SiaB components setup since they are already installed -milestones="kubeadm helm-init kafka kafka-running etcd-operator-ready voltha \ - voltha-running nem onos siab" +cd "${AUTO_TOOLS}/seba-in-a-box" +# shellcheck source=/dev/null +. env.sh -for m in ${milestones} -do - echo "Faking SiaB milestone ${M}/${m}" - test -f "${M}/${m}" || touch "${M}/${m}" -done - -# Now calling make, to install PONSim -cd "${WORKSPACE}/automation-tools/seba-in-a-box" +# Now calling make, to install SiaB and PONSim make stable -