Line length: Fix recent merges 21/32421/5
authorVratko Polak <vrpolak@cisco.com>
Tue, 15 Jun 2021 12:35:41 +0000 (14:35 +0200)
committerPeter Mikus <pmikus@cisco.com>
Wed, 16 Jun 2021 13:29:14 +0000 (13:29 +0000)
Not fixing .rst, .md, .yaml, conf.py, .vat, and so on.

Change-Id: Icc585d6dbebc8eb5c483b10326302571e94c614d
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
13 files changed:
resources/libraries/bash/entry/check/pylint.sh
resources/libraries/bash/function/artifacts.sh
resources/libraries/bash/function/common.sh
resources/libraries/bash/function/dpdk.sh
resources/libraries/bash/function/gather.sh
resources/libraries/bash/function/per_patch.sh
resources/libraries/bash/shell/k8s_utils.sh
resources/libraries/python/HoststackUtil.py
resources/libraries/python/VppApiCrc.py
resources/tools/doc_gen/run_doc.sh
resources/tools/doc_gen/src/Makefile
resources/tools/iperf/iperf_client.py
resources/tools/presentation/run_report_local.sh

index 18e7d3d..fbfea47 100644 (file)
@@ -19,7 +19,8 @@ set -exuo pipefail
 # to dissuade non-tox callers.
 
 # This script runs pylint and propagates its exit code.
-# Config is taken from pylint.cfg, and proper virtualenv is assumed to be active.
+# Config is taken from pylint.cfg,
+# and proper virtualenv is assumed to be active.
 # The pylint output stored to pylint.log (overwriting).
 
 # "set -eu" handles failures from the following two lines.
index 3fe6bae..15a4dd2 100644 (file)
@@ -86,7 +86,7 @@ function download_ubuntu_artifacts () {
             repository installation was not successful."
     fi
 
-    packages=$(apt-cache -o Dir::Etc::SourceList=${apt_fdio_repo_file} \
+    pkgs=$(apt-cache -o Dir::Etc::SourceList=${apt_fdio_repo_file} \
                -o Dir::Etc::SourceParts=${apt_fdio_repo_file} dumpavail \
                | grep Package: | cut -d " " -f 2 | grep vpp) || {
                    die "Retrieval of available VPP packages failed."
@@ -102,7 +102,7 @@ function download_ubuntu_artifacts () {
     fi
 
     set +x
-    for package in ${packages}; do
+    for package in ${pkgs}; do
         # Filter packages with given version
         pkg_info=$(apt-cache show -- ${package}) || {
             die "apt-cache show on ${package} failed."
@@ -147,19 +147,19 @@ function download_centos_artifacts () {
     }
     # If version is set we will add suffix.
     artifacts=()
-    packages=(vpp vpp-selinux-policy vpp-devel vpp-lib vpp-plugins vpp-api-python)
+    pkgs=(vpp vpp-selinux-policy vpp-devel vpp-lib vpp-plugins vpp-api-python)
     if [ -z "${VPP_VERSION-}" ]; then
-        artifacts+=(${packages[@]})
+        artifs+=(${pkgs[@]})
     else
-        artifacts+=(${packages[@]/%/-${VPP_VERSION-}})
+        artifs+=(${pkgs[@]/%/-${VPP_VERSION-}})
     fi
 
     if [[ "${INSTALL:-false}" == "true" ]]; then
-        sudo yum -y install "${artifacts[@]}" || {
+        sudo yum -y install "${artifs[@]}" || {
             die "Install VPP artifact failed."
         }
     else
-        sudo yum -y install --downloadonly --downloaddir=. "${artifacts[@]}" || {
+        sudo yum -y install --downloadonly --downloaddir=. "${artifs[@]}" || {
             die "Download VPP artifacts failed."
         }
     fi
@@ -181,20 +181,20 @@ function download_opensuse_artifacts () {
         die "Packagecloud FD.io repo fetch failed."
     }
     # If version is set we will add suffix.
-    artifacts=()
-    packages=(vpp vpp-devel vpp-lib vpp-plugins libvpp0)
+    artifs=()
+    pkgs=(vpp vpp-devel vpp-lib vpp-plugins libvpp0)
     if [ -z "${VPP_VERSION-}" ]; then
-        artifacts+=(${packages[@]})
+        artifs+=(${pkgs[@]})
     else
-        artifacts+=(${packages[@]/%/-${VPP_VERSION-}})
+        artifs+=(${pkgs[@]/%/-${VPP_VERSION-}})
     fi
 
     if [[ "${INSTALL:-false}" == "true" ]]; then
-        sudo yum -y install "${artifacts[@]}" || {
+        sudo yum -y install "${artifs[@]}" || {
             die "Install VPP artifact failed."
         }
     else
-        sudo yum -y install --downloadonly --downloaddir=. "${artifacts[@]}" || {
+        sudo yum -y install --downloadonly --downloaddir=. "${artifs[@]}" || {
             die "Download VPP artifacts failed."
         }
     fi
index ec95f92..ed3b204 100644 (file)
@@ -526,7 +526,8 @@ function get_test_tag_string () {
         TEST_TAG_STRING=$("${cmd[@]}" <<< "${comment}" || true)
         if [[ -z "${TEST_TAG_STRING-}" ]]; then
             # Probably we got a base64 encoded comment.
-            comment=$(base64 --decode <<< "${GERRIT_EVENT_COMMENT_TEXT}" || true)
+            comment="${GERRIT_EVENT_COMMENT_TEXT}"
+            comment=$(base64 --decode <<< "${comment}" || true)
             comment=$(fgrep "${trigger}" <<< "${comment}" || true)
             TEST_TAG_STRING=$("${cmd[@]}" <<< "${comment}" || true)
         fi
index 3625243..3c16372 100644 (file)
@@ -95,8 +95,10 @@ function dpdk_compile () {
     sed -i "${sed_cmd}" "${sed_file}" || die "RTE_MAX_NUMA_NODES Patch failed"
 
     # Patch L3FWD.
-    sed_rxd="s/^#define RTE_TEST_RX_DESC_DEFAULT 128/#define RTE_TEST_RX_DESC_DEFAULT 1024/g"
-    sed_txd="s/^#define RTE_TEST_TX_DESC_DEFAULT 512/#define RTE_TEST_TX_DESC_DEFAULT 1024/g"
+    sed_rxd="s/^#define RTE_TEST_RX_DESC_DEFAULT 128"
+    sed_rxd+="/#define RTE_TEST_RX_DESC_DEFAULT 1024/g"
+    sed_txd="s/^#define RTE_TEST_TX_DESC_DEFAULT 512"
+    sed_txd+="/#define RTE_TEST_TX_DESC_DEFAULT 1024/g"
     sed_file="./main.c"
     pushd examples/l3fwd || die "Pushd failed"
     sed -i "${sed_rxd}" "${sed_file}" || die "Patch failed"
@@ -207,8 +209,10 @@ function dpdk_l3fwd_compile () {
 
     pushd "${DPDK_DIR}" || die "Pushd failed"
     # Patch L3FWD.
-    sed_rxd="s/^#define RTE_TEST_RX_DESC_DEFAULT 128/#define RTE_TEST_RX_DESC_DEFAULT 2048/g"
-    sed_txd="s/^#define RTE_TEST_TX_DESC_DEFAULT 512/#define RTE_TEST_TX_DESC_DEFAULT 2048/g"
+    sed_rxd="s/^#define RTE_TEST_RX_DESC_DEFAULT 128"
+    sed_rxd+="/#define RTE_TEST_RX_DESC_DEFAULT 2048/g"
+    sed_txd="s/^#define RTE_TEST_TX_DESC_DEFAULT 512"
+    sed_txd+="/#define RTE_TEST_TX_DESC_DEFAULT 2048/g"
     sed_file="./main.c"
     pushd examples/l3fwd || die "Pushd failed"
     sed -i "${sed_rxd}" "${sed_file}" || die "Patch failed"
index 2112e1b..e3a6a9d 100644 (file)
@@ -124,7 +124,8 @@ function gather_vpp () {
     # - ${CSIT_DIR}/DPDK_STABLE_VER - DPDK version to use
     #   by csit-vpp not-timed jobs.
     # - ${CSIT_DIR}/${VPP_VER_FILE} - Ubuntu VPP version to use.
-    # - ../*vpp*.deb|rpm - Relative to ${DOWNLOAD_DIR}, copied for vpp-csit jobs.
+    # - ../*vpp*.deb|rpm - Relative to ${DOWNLOAD_DIR},
+    #   copied for vpp-csit jobs.
     # Directories updated:
     # - ${DOWNLOAD_DIR}, vpp-*.deb files are copied here for vpp-csit jobs.
     # - ./ - Assumed ${DOWNLOAD_DIR}, *vpp*.deb|rpm files
@@ -157,8 +158,10 @@ function gather_vpp () {
             download_artifacts || die
             ;;
         "vpp-csit-"*)
+            # Shorten line.
+            pgks="${PKG_SUFFIX}"
             # Use locally built packages.
-            mv "${DOWNLOAD_DIR}"/../*vpp*."${PKG_SUFFIX}" "${DOWNLOAD_DIR}"/ || {
+            mv "${DOWNLOAD_DIR}"/../*vpp*."${pkgs}" "${DOWNLOAD_DIR}"/ || {
                 die "Move command failed."
             }
             ;;
index 76dbf51..4af3302 100644 (file)
@@ -96,7 +96,7 @@ function build_vpp_ubuntu_amd64 () {
              "using build default ($(grep -c ^processor /proc/cpuinfo))."
     fi
 
-    make UNATTENDED=y pkg-verify || die "VPP build using make pkg-verify failed."
+    make UNATTENDED=y pkg-verify || die "VPP build with make pkg-verify failed."
     echo "* VPP ${1-} BUILD SUCCESSFULLY COMPLETED" || {
         die "Argument not found."
     }
index c291510..b96ec8d 100644 (file)
@@ -66,7 +66,8 @@ function k8s_utils.contiv_vpp_deploy {
     k8s_contiv_patch="kubecon.contiv-vpp-yaml-patch.diff"
 
     # Pull the most recent Docker images
-    bash <(curl -s https://raw.githubusercontent.com/contiv/vpp/master/k8s/pull-images.sh)
+    url="https://raw.githubusercontent.com/contiv/vpp/master/k8s/pull-images.sh"
+    bash <(curl -s "${url}")
 
     # Apply resources
     wget ${k8s_contiv}
@@ -80,17 +81,21 @@ function k8s_utils.contiv_vpp_deploy {
 
 function k8s_utils.cri_shim_install {
     # Install the CRI Shim on host
-    sudo su root -c 'bash <(curl -s https://raw.githubusercontent.com/contiv/vpp/master/k8s/cri-install.sh)'
+    url"https://raw.githubusercontent.com/contiv/vpp/master/k8s/cri-install.sh"
+    sudo su root -c "bash <(curl -s '${url}')"
 }
 
 function k8s_utils.cri_shim_uninstall {
     # Uninstall the CRI Shim on host
-    sudo su root -c 'bash <(curl -s https://raw.githubusercontent.com/contiv/vpp/master/k8s/cri-install.sh) --uninstall'
+    url="https://raw.githubusercontent.com/contiv/vpp/master/k8s/cri-install.sh"
+    sudo su root -c "bash <(curl -s '${url}') --uninstall"
 }
 
 function k8s_utils.kube_proxy_install {
     # Installing custom version of Kube-Proxy to enable Kubernetes services
-    bash <(curl -s https://raw.githubusercontent.com/contiv/vpp/master/k8s/proxy-install.sh)
+    url="https://raw.githubusercontent.com/contiv/vpp/master/k8s/"
+    url+="proxy-install.sh"
+    bash <(curl -s "${url}")
 }
 
 function k8s_utils.apply {
@@ -113,7 +118,9 @@ function k8s_utils.resource_delete {
 
 function k8s_utils.affinity_non_vpp {
     # Set affinity for all non VPP docker containers to CPU 0
-    for i in `sudo docker ps --format "{{.ID}} {{.Names}}" | grep -v vpp | cut -d' ' -f1`; do
+    command='sudo docker ps --format "{{.ID}} {{.Names}}"'
+    command+=" | grep -v vpp | cut -d' ' -f1"
+    for i in $(${command}); do
         sudo docker update --cpuset-cpus 0 ${i}
     done
 }
index 76c75ee..7e6ba56 100644 (file)
@@ -84,6 +84,7 @@ class HoststackUtil():
         ip_address = f" {iperf3_attributes[u'ip_address']}" if u"ip_address" \
                      in iperf3_attributes else u""
         iperf3_cmd[u"name"] = u"iperf3"
+        # TODO: Use OptionString library.
         iperf3_cmd[u"args"] = f"--{iperf3_attributes[u'role']}{ip_address} " \
                               f"--interval 0{json_results} " \
                               f"--version{iperf3_attributes[u'ip_version']}"
index ca76397..0cb8c2b 100644 (file)
@@ -373,8 +373,7 @@ class VppApiCrcChecker:
         if not matching:
             self._reported[api_name] = crc
             self.log_and_raise(
-                f"No active collection contains API {api_name!r} with CRC "
-                f"{crc!r}"
+                f"No active collection has API {api_name!r} with CRC {crc!r}"
             )
         options = self._options[api_name]
         options.pop(u"vat_help", None)
index d50c5b8..10cc3e2 100755 (executable)
@@ -21,11 +21,18 @@ mkdir --parents ${WORKING_DIR}/tests/
 cp -r src/* ${WORKING_DIR}/
 
 # Copy the source files to be processed:
-rsync -a --include '*/' --include '*.py' --exclude '*' ../../../resources/libraries/python/ ${WORKING_DIR}/resources/libraries/python/
+from_dir="../../../resources/libraries/python/"
+to_dir="${WORKING_DIR}/resources/libraries/python/"
+command="rsync -a --include '*/'"
+${command} --include '*.py' --exclude '*' "${from_dir}" "${to_dir}"
 cp ../../../resources/__init__.py ${WORKING_DIR}/resources/
 cp ../../../resources/libraries/__init__.py ${WORKING_DIR}/resources/libraries/
-rsync -a --include '*/' --include '*.robot' --exclude '*' ../../../resources/libraries/robot/ ${WORKING_DIR}/resources/libraries/robot/
-rsync -a --include '*/' --include '*.robot' --exclude '*' ../../../tests/ ${WORKING_DIR}/tests/
+from_dir="../../../resources/libraries/robot/"
+to_dir="${WORKING_DIR}/resources/libraries/robot/"
+${command} --include '*.robot' --exclude '*' "${from_dir}" "${to_dir}"
+from_dir="../../../tests/"
+to_dir="${WORKING_DIR}/tests/"
+${command} --include '*.robot' --exclude '*' "${from_dir}" "${to_dir}"
 
 # Create virtual environment:
 virtualenv --python=$(which python3) ${WORKING_DIR}/env
@@ -44,7 +51,9 @@ find ./${WORKING_DIR}/env -type f -name '*.rst' | xargs rm -f
 
 # Generate the documentation:
 DATE=$(date -u '+%d-%b-%Y')
-sphinx-build -v -c ${WORKING_DIR} -a  -b html -E -D release=$1 -D version="$1 documentation - $DATE" ${WORKING_DIR} ${BUILD_DIR}/
+command="sphinx-build -v -c '${WORKING_DIR}' -a  -b html -E -D release='$1' -D"
+command+=" version='$1 documentation - $DATE' '${WORKING_DIR}' '${BUILD_DIR}/'"
+${command}
 
 find . -type d -name 'env' | xargs rm -rf
 
index dc34917..087683e 100644 (file)
@@ -40,7 +40,7 @@ help:
        @echo "  xml        to make Docutils-native XML files"
        @echo "  pseudoxml  to make pseudoxml-XML files for display purposes"
        @echo "  linkcheck  to check all external links for integrity"
-       @echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+       @echo "  doctest    to run all doctests embedded in the documentation"
        @echo "  coverage   to run coverage check of the documentation (if enabled)"
        @echo "  dummy      to check syntax errors of document sources"
 
index b77dea1..d719ee4 100644 (file)
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-"""This module gets a bandwith limit together with other parameters, reads
+"""This script gets a bandwith limit together with other parameters, reads
 the iPerf3 configuration and sends the traffic. At the end, it measures
 the packet loss and latency.
 """
index b48d4d2..df0e89e 100755 (executable)
@@ -83,8 +83,10 @@ fi
 if [[ ${cfg_install_latex} -eq 1 ]] ;
 then
     sudo apt-get -y install xvfb texlive-latex-recommended \
-        texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra latexmk wkhtmltopdf inkscape
-    sudo sed -i.bak 's/^\(main_memory\s=\s\).*/\110000000/' /usr/share/texlive/texmf-dist/web2c/texmf.cnf
+        texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra \
+        latexmk wkhtmltopdf inkscape
+    target="/usr/share/texlive/texmf-dist/web2c/texmf.cnf"
+    sudo sed -i.bak 's/^\(main_memory\s=\s\).*/\110000000/' "${target}"
 fi
 
 # Create working directories