aboutsummaryrefslogtreecommitdiffstats
path: root/tools/docker/vineperf/deploytools.sh
diff options
context:
space:
mode:
authorSridhar K. N. Rao <sridhar.rao@spirent.com>2021-10-01 09:34:54 +0530
committerAl Morton <acm@research.att.com>2021-10-01 21:01:49 +0000
commitb298cbad4e39cfacead75debcb743e9b844efbd0 (patch)
tree5db9d85d3a11c40a6ead685cc17f618d6699c8e0 /tools/docker/vineperf/deploytools.sh
parent467a22c1c2cbfc3c4a8448b7170d84dc26d658ec (diff)
Docker: ViNePerf Container
This patch adds support for new vineperf container 1. Both T-Rex and Prox support 2. SSH support added to run in K8S cluster. Signed-off-by: Sridhar K. N. Rao <sridhar.rao@spirent.com> Change-Id: I993807acf0abaa873c82b22e0286b5156a1954cf
Diffstat (limited to 'tools/docker/vineperf/deploytools.sh')
-rw-r--r--tools/docker/vineperf/deploytools.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/tools/docker/vineperf/deploytools.sh b/tools/docker/vineperf/deploytools.sh
new file mode 100644
index 00000000..c82e394c
--- /dev/null
+++ b/tools/docker/vineperf/deploytools.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+
+# If already running from root, no need for sudo
+SUDO=""
+[ $(id -u) -ne 0 ] && SUDO="sudo"
+
+function os_pkgs_install()
+{
+ ${SUDO} apt-get -y update
+ # Install required packages
+ ${SUDO} apt-get install -y git wget iputils-ping iproute2 unzip openssh-server openssh-client tk sudo
+}
+
+function os_cfg()
+{
+ [ ! -f /etc/ssh/ssh_host_rsa_key ] && ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
+ [ ! -f /etc/ssh/ssh_host_ecdsa_key ] && ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
+ [ ! -f /etc/ssh/ssh_host_ed25519_key ] && ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''
+
+ [ ! -d /var/run/sshd ] && mkdir -p /var/run/sshd
+
+ USER_NAME="opnfv"
+ USER_PWD="opnfv"
+ ROOT_USER="root"
+
+ useradd -m -d /home/${USER_NAME} -s /bin/bash -U ${USER_NAME}
+ echo "${USER_NAME}:${USER_PWD}" | chpasswd
+ echo "${ROOT_USER}:${USER_PWD}" | chpasswd
+ usermod -aG sudo ${USER_NAME}
+
+ echo "%sudo ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER_NAME}
+}
+
+function cleanup()
+{
+ ${SUDO} apt-get autoremove -y
+ ${SUDO} apt-get clean all
+ ${SUDO} rm -rf /var/cache/apt
+}
+
+os_pkgs_install
+os_cfg
+cleanup