diff options
author | Ritu Sood <Ritu.Sood@intel.com> | 2020-06-28 03:06:50 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-06-28 03:06:50 +0000 |
commit | 8e446beb55c68314896f16cb3105816cacc05f84 (patch) | |
tree | b4a91164192c8fd96e933e51cea55737383cb8ce /kud/tests/cFW/sink | |
parent | 5a06648cdee4011b355c4be59ff265462e4c3d76 (diff) | |
parent | dd79554660e0f81cc8723243235e82e8769490f7 (diff) |
Merge "Update cFW instruction set"
Diffstat (limited to 'kud/tests/cFW/sink')
-rw-r--r-- | kud/tests/cFW/sink/Dockerfile | 28 | ||||
-rwxr-xr-x | kud/tests/cFW/sink/init.sh | 17 | ||||
-rw-r--r-- | kud/tests/cFW/sink/wrapper_v_sink_init.sh | 10 |
3 files changed, 26 insertions, 29 deletions
diff --git a/kud/tests/cFW/sink/Dockerfile b/kud/tests/cFW/sink/Dockerfile index 5e3da088..3d934135 100644 --- a/kud/tests/cFW/sink/Dockerfile +++ b/kud/tests/cFW/sink/Dockerfile @@ -1,24 +1,14 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 MAINTAINER Ritu Sood <ritu.sood@intel.com> -ARG HTTP_PROXY=${HTTP_PROXY} -ARG HTTPS_PROXY=${HTTPS_PROXY} +COPY init.sh /opt/init.sh -ENV http_proxy $HTTP_PROXY -ENV https_proxy $HTTPS_PROXY +ENV PROTECTED_NET_GW "192.168.20.100" +ENV UNPROTECTED_NET "192.168.10.0/24" -ENV repo_url "https://nexus.onap.org/content/repositories/staging/org/onap/demo/vnf" -ENV demo_artifacts_version "1.5.0" +RUN apt-get update && apt-get install -y -qq --no-install-recommends \ + iproute2 darkstat +EXPOSE 667 -RUN apt-get update && apt-get install -y -qq wget net-tools unzip - -WORKDIR /opt - -RUN wget "${repo_url}/vfw/vfw-scripts/${demo_artifacts_version}/vfw-scripts-${demo_artifacts_version}.zip" \ - && unzip "vfw-scripts-${demo_artifacts_version}.zip" \ - && chmod +x v_sink_init.sh - -COPY wrapper_v_sink_init.sh . -RUN chmod +x wrapper_v_sink_init.sh - -CMD ["./wrapper_v_sink_init.sh"] +ENTRYPOINT ["/bin/bash"] +CMD ["/opt/init.sh"] diff --git a/kud/tests/cFW/sink/init.sh b/kud/tests/cFW/sink/init.sh new file mode 100755 index 00000000..58c32bdc --- /dev/null +++ b/kud/tests/cFW/sink/init.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2020 +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +set -o pipefail +set -o xtrace +set -o errexit +set -o nounset + +ip route add $UNPROTECTED_NET via $PROTECTED_NET_GW +/usr/sbin/darkstat --no-daemon --verbose -i eth0 diff --git a/kud/tests/cFW/sink/wrapper_v_sink_init.sh b/kud/tests/cFW/sink/wrapper_v_sink_init.sh deleted file mode 100644 index e3a3e35e..00000000 --- a/kud/tests/cFW/sink/wrapper_v_sink_init.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -mkdir -p /opt/config/ -echo "$protected_net_gw" > /opt/config/protected_net_gw.txt -echo "$protected_private_net_cidr" > /opt/config/unprotected_net.txt - -# NOTE: this script executes $ route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.20.100 -# which results in this error if doesn't have all nics required -> SIOCADDRT: File exists -./v_sink_init.sh -sleep infinity |