-# Copyright (c) 2017-2019 Cisco and/or its affiliates.
+# Copyright (c) 2017-2022 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
echo "*******************************************************************"
# Make the package
- make -C ${SCRIPT_PATH}/.. INSTALL_PREFIX=/usr test package-release
+ make -C "${SCRIPT_PATH}/.." BUILD_PATH="${SCRIPT_PATH}/../packages" INSTALL_PREFIX=/usr test package-release
- pushd ${SCRIPT_PATH}/../build-release-${ID}
+ pushd ${SCRIPT_PATH}/../packages
find . -not -name '*.deb' -not -name '*.rpm' -print0 | xargs -0 rm -rf -- || true
rm *Unspecified* *Development* *development* || true
popd
echo "*******************************************************************"
}
+function functional_test() {
+ echo "*******************************************************************"
+ echo "********************* STARTING FUNCTIONAL TESTS *******************"
+ echo "*******************************************************************"
+
+ # Run functional tests
+ pushd ${SCRIPT_PATH}/..
+ BUILD_SOFTWARE=0 DOCKERFILE="tests/Dockerfile.ci" bash ./tests/run-functional.sh
+ popd
+
+ echo "*******************************************************************"
+ echo "********** FUNCTIONAL TESTS COMPLETED SUCCESSFULLY ***************"
+ echo "*******************************************************************"
+}
+
build_sphinx() {
setup
;;
packages)
build_package
+ functional_test
;;
*)
usage
# Install dependencies
function install_deps() {
+ curl -fsSL https://get.docker.com -o get-docker.sh
+ sudo sh get-docker.sh
make -C ${SCRIPT_PATH}/.. deps
}
# Prevent vpp to set sysctl
export VPP_INSTALL_SKIP_SYSCTL=1
+apt-get update
+apt-get install -y curl
+
curl -s https://packagecloud.io/install/repositories/fdio/${VPP_VERSION}/script.deb.sh | bash
curl -L https://packagecloud.io/fdio/${VPP_VERSION}/gpgkey | apt-key add -
sed -E -i 's/(deb.*)(\[.*\])(.*)/\1\3/g' /etc/apt/sources.list.d/fdio_"${VPP_VERSION}".list
build:
context: ..
dockerfile: ${DOCKERFILE}
- args:
- BASE_IMAGE: ${BASE_IMAGE}
image: hicn-base
privileged: true
container_name: forwarder
sleep 4
- hiperf -q -z hicnlightng_module -S -R -B 4000kbps ${RTC_PRODUCER} -P 2 &
- hiperf -q -z hicnlightng_module -S ${RAAQM_PRODUCER}/128 &
- hicn-ping-server -q -z hicnlightng_module -s 0 -n ${PING_PRODUCER}/128 &
+ hiperf -q -z hicnlight_module -S -R -B 4000kbps ${RTC_PRODUCER} -P 2 &
+ hiperf -q -z hicnlight_module -S ${RAAQM_PRODUCER}/128 &
+ hicn-ping-server -q -z hicnlight_module -s 0 -n ${PING_PRODUCER}/128 &
tail -f /dev/null
sudo tee /etc/vpp/startup.conf <<EOF
cpu { main-core 1 }
plugins {
- path /usr/lib/x86_64-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
+ path /usr/lib/$$(arch)-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
plugin default { disable }
plugin acl_plugin.so { enable }
plugin nat_plugin.so { enable }
sudo tee /etc/vpp/startup.conf <<EOF
cpu { main-core 2 }
plugins {
- path /usr/lib/x86_64-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
+ path /usr/lib/$$(arch)-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
plugin default { disable }
plugin acl_plugin.so { enable }
plugin nat_plugin.so { enable }
build:
context: ..
dockerfile: ${DOCKERFILE}
- args:
- BASE_IMAGE: ${BASE_IMAGE}
stdin_open: true
tty: true
working_dir: /workspace
cpu { main-core 1 }
buffers { buffers-per-numa 600000 }
plugins {
- path /hicn-root/lib/vpp_plugins:/usr/lib/x86_64-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
+ path /hicn-root/lib/vpp_plugins:/usr/lib/$$(arch)-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
plugin default { disable }
plugin acl_plugin.so { enable }
plugin nat_plugin.so { enable }
build:
context: ..
dockerfile: ${DOCKERFILE}
- args:
- BASE_IMAGE: ${BASE_IMAGE}
stdin_open: true
tty: true
working_dir: /workspace
buffers { buffers-per-numa 600000 }
plugins {
- path /hicn-root/lib/vpp_plugins:/usr/lib/x86_64-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
+ path /hicn-root/lib/vpp_plugins:/usr/lib/$$(arch)-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
plugin default { disable }
plugin acl_plugin.so { enable }
plugin nat_plugin.so { enable }
cpu { main-core 1 }
buffers { buffers-per-numa 600000 }
plugins {
- path /usr/lib/x86_64-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
+ path /usr/lib/$$(arch)-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
plugin default { disable }
plugin acl_plugin.so { enable }
plugin nat_plugin.so { enable }
buffers { buffers-per-numa 600000 }
plugins {
- path /usr/lib/x86_64-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
+ path /usr/lib/$$(arch)-linux-gnu/vpp_plugins:/usr/lib/vpp_plugins
plugin default { disable }
plugin acl_plugin.so { enable }
plugin nat_plugin.so { enable }
build:
context: ..
dockerfile: ${DOCKERFILE}
- args:
- BASE_IMAGE: ${BASE_IMAGE}
- image: hicn-base
privileged: true
stdin_open: true
hostname: client
build:
context: ..
dockerfile: ${DOCKERFILE}
- args:
- BASE_IMAGE: ${BASE_IMAGE}
privileged: true
stdin_open: true
hostname: server
-ARG BASE_IMAGE
+FROM ubuntu:focal
-FROM ${BASE_IMAGE}
+ARG DEBIAN_FRONTEND=noninteractive
+ARG DEB_FOLDER="./packages"
-RUN sudo sed -i 's,secure_path="\(.*\)",secure_path="/hicn-root/bin:\1",' /etc/sudoers
+WORKDIR /hicn-release
+
+################################################################
+# Copy DEB files
+################################################################
+COPY ${DEB_FOLDER} deb
+
+################################################################
+# Install VPP and hicn debs
+################################################################
+ARG VERSION_PATH=/tmp/versions.cmake
+COPY versions.cmake ${VERSION_PATH}
+ARG INSTALL_VPP_SCRIPT=/tmp/install-vpp.sh
+COPY scripts/install-vpp.sh ${INSTALL_VPP_SCRIPT}
+
+RUN bash -x ${INSTALL_VPP_SCRIPT} \
+ && cd deb \
+ && apt-get install -y \
+ iproute2 sudo \
+ ./libhicn_*.deb \
+ ./hicn-light_*.deb \
+ ./hicn-plugin_*.deb \
+ ./libhicnctrl_*.deb \
+ ./libhicnctrl-modules_*.deb \
+ ./libhicntransport-io-modules_*.deb \
+ ./libhicntransport_*.deb \
+ ./facemgr_*.deb \
+ ./hicn-apps_*.deb \
+ && rm ${VERSION_PATH} \
+ && rm -rf deb \
+ && rm -rf /var/lib/apt/lists/* \
+ && apt-get autoremove -y \
+ && apt-get clean
+
+WORKDIR /
# Use when building for the fist time,
# then `make test` forces a rebuild if local changes
build:
- BASE_IMAGE=hicn DOCKERFILE=Dockerfile.dev BUILD_SOFTWARE=1 \
+ DOCKERFILE=Dockerfile.dev BUILD_SOFTWARE=1 \
docker-compose -f build.yml up --force-recreate --remove-orphans
# Rebuild from scratch (to avoid cmake cache)
rebuild:
- BASE_IMAGE=hicn DOCKERFILE=Dockerfile.dev BUILD_SOFTWARE=1 \
+ DOCKERFILE=Dockerfile.dev BUILD_SOFTWARE=1 \
REBUILD=1 \
docker-compose -f build.yml up --force-recreate --remove-orphans
-#!/bin/bash
+#!/usr/bin/env bash
set -e
set -a
DOCKERFILE=${DOCKERFILE:-Dockerfile.dev}
-BASE_IMAGE=${BASE_IMAGE:-hicn}
BUILD_SOFTWARE=${BUILD_SOFTWARE:-1}
set +a
-HIPERF_CMD_RTC="hiperf -q -n 50 -C -H -R ${RTC_PRODUCER} -P 2"
+HIPERF_CMD_RTC="/usr/bin/hiperf -q -n 50 -C -H -R ${RTC_PRODUCER} -P 2"
HIPERF_CMD_MEMIF_RTC="${HIPERF_CMD_RTC} -z memif_module"
POSTPROCESS_COMMAND_RAAQM_RTC='tail -n +3 | \
tr -s " " | \
print int(a[0]), int(a[n-1]), int(s/n) \
}"'
-HIPERF_CMD_RAAQM="hiperf -q -n 50 -i 200 -C -H ${RAAQM_PRODUCER}"
+HIPERF_CMD_RAAQM="/usr/bin/hiperf -q -n 50 -i 200 -C -H ${RAAQM_PRODUCER}"
HIPERF_CMD_CBR="${HIPERF_CMD_RAAQM} -W 350 -M 0"
HIPERF_CMD_MEMIF_RAAQM="${HIPERF_CMD_RAAQM} -z memif_module"
HIPERF_CMD_MEMIF_CBR="${HIPERF_CMD_CBR} -z memif_module"