aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rw-r--r--resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/Dockerfile122
-rw-r--r--resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/supervisord.conf22
-rw-r--r--resources/tools/testbed-setup/ansible/roles/vpp_device/files/csit-initialize-vfs.sh2
3 files changed, 146 insertions, 0 deletions
diff --git a/resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/Dockerfile b/resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/Dockerfile
new file mode 100644
index 0000000000..343ac1ba2d
--- /dev/null
+++ b/resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/Dockerfile
@@ -0,0 +1,122 @@
+# Copyright (c) 2018 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:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM ubuntu:bionic-20180821
+
+MAINTAINER csit-dev <csit-dev@lists.fd.io>
+LABEL Description="CSIT vpp-device ubuntu 18.04 baseline image"
+LABEL Version="0.3"
+
+# Setup the environment
+ENV DEBIAN_FRONTEND=noninteractive
+ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
+ENV NOTVISIBLE "in users profile"
+ENV VPP_PYTHON_PREFIX=/var/cache/vpp/python
+
+# Base layer
+RUN apt-get -q update \
+ && apt-get install -y -qq \
+ apt-transport-https \
+ curl \
+ software-properties-common \
+ && rm -rf /var/lib/apt/lists/*
+
+# Repository settings
+RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
+ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
+ && apt-get remove -y \
+ curl
+
+# Extended layer
+RUN apt-get -q update \
+ && apt-get install -y -qq \
+ # general tools
+ bridge-utils \
+ cloud-init \
+ locales \
+ net-tools \
+ openssh-server \
+ pciutils \
+ rsyslog \
+ ssh \
+ sudo \
+ supervisor \
+ tar \
+ vim \
+ wget \
+ # csit requirements
+ cmake \
+ dkms \
+ docker-ce \
+ libpcap-dev \
+ libpython2.7-dev \
+ libpython-dev \
+ openjdk-8-jdk-headless \
+ python-pip \
+ python2.7-dev \
+ python-dev \
+ python-virtualenv \
+ qemu-system-x86 \
+ socat \
+ strongswan \
+ unzip \
+ tcpdump \
+ zlib1g-dev \
+ # vpp requirements
+ ca-certificates \
+ libapr1 \
+ libmbedcrypto1 \
+ libmbedtls10 \
+ libmbedx509-0 \
+ libnuma1 \
+ && rm -rf /var/lib/apt/lists/*
+
+# Configure locales
+RUN locale-gen en_US.UTF-8 \
+ && dpkg-reconfigure locales
+
+# Fix permissions
+RUN chown root:syslog /var/log \
+ && chmod 755 /etc/default
+
+# Create directory structure
+RUN mkdir -p /tmp/dumps \
+ && mkdir -p /var/cache/vpp/python \
+ && mkdir -p /var/run/sshd
+
+# PIP pre-cache
+RUN pip install \
+ robotframework==2.9.2 \
+ paramiko==1.16.0 \
+ scp==0.10.2 \
+ ipaddress==1.0.16 \
+ PyYAML==3.11 \
+ pykwalify==1.5.0 \
+ scapy==2.3.1 \
+ enum34==1.1.2 \
+ requests==2.9.1 \
+ ecdsa==0.13 \
+ pycrypto==2.6.1 \
+ pypcap==1.1.5
+
+# SSH settings
+RUN echo 'root:Csit1234' | chpasswd \
+ && sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
+ && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \
+ && echo "export VISIBLE=now" >> /etc/profile
+
+EXPOSE 22
+
+COPY supervisord.conf /etc/supervisord/supervisord.conf
+
+CMD ["sh", "-c", "rm -f /dev/shm/db /dev/shm/global_vm /dev/shm/vpe-api; /usr/bin/supervisord -c /etc/supervisord/supervisord.conf; /usr/sbin/sshd -D"]
diff --git a/resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/supervisord.conf b/resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/supervisord.conf
new file mode 100644
index 0000000000..3a2c150a53
--- /dev/null
+++ b/resources/tools/disk-image-builder/csit-sut-dcr/ubuntu_1804_amd64/supervisord.conf
@@ -0,0 +1,22 @@
+[unix_http_server]
+file = /run/supervisor.sock
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
+
+[supervisorctl]
+serverurl = unix:///run/supervisor.sock
+
+[supervisord]
+pidfile = /run/supervisord.pid
+identifier = supervisor
+directory = /run
+logfile=/var/log/supervisord.log
+loglevel=debug
+nodaemon=false
+
+[program:vpp]
+command=/usr/bin/vpp -c /etc/vpp/startup.conf
+autorestart=true
+redirect_stderr=true
+priority=1
diff --git a/resources/tools/testbed-setup/ansible/roles/vpp_device/files/csit-initialize-vfs.sh b/resources/tools/testbed-setup/ansible/roles/vpp_device/files/csit-initialize-vfs.sh
index 666839c707..092f6ef9f5 100644
--- a/resources/tools/testbed-setup/ansible/roles/vpp_device/files/csit-initialize-vfs.sh
+++ b/resources/tools/testbed-setup/ansible/roles/vpp_device/files/csit-initialize-vfs.sh
@@ -61,6 +61,8 @@ for pci_addr in ${pci_whitelist[@]}; do
mac_str="mac ba:dc:0f:fe:${mac5}:${mac6}"
# Set 802.1Q VLAN id and MAC address
ip link set ${pf} vf $(( vf - 1 )) ${mac_str} ${vlan_str}
+ ip link set ${pf} vf $(( vf - 1 )) trust on
+ ip link set ${pf} vf $(( vf - 1 )) spoof off
done
pci_idx=$(( pci_idx + 1 ))
;;