From: Peter Mikus Date: Tue, 25 Jan 2022 11:37:43 +0000 (+0100) Subject: fix(core): Remove unused stuff X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=commitdiff_plain;h=f8f5d883fc816750ac051233709cfef869a10666 fix(core): Remove unused stuff Signed-off-by: Peter Mikus Change-Id: I0cfc9d9fbb1a82a308231a5d2c0b12cb632c469b --- diff --git a/resources/libraries/bash/entry/check/job_spec.sh b/resources/libraries/bash/entry/check/job_spec.sh deleted file mode 100644 index 21013fe984..0000000000 --- a/resources/libraries/bash/entry/check/job_spec.sh +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (c) 2021 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. - -set -exuo pipefail - -# This file should be executed from tox, as the assumed working directory -# is different from where this file is located. -# This file does not have executable flag nor shebang, -# to dissuade non-tox callers. - -# This script checks if the number of tests in a job specification is the same -# as declared at the beginning of the file. -# It counts the lines not starting with '#' so it can also detect redundant -# empty lines, or lines which should not be in the job specification. - -# "set -eu" handles failures from the following two lines. -BASH_CHECKS_DIR="$(dirname $(readlink -e "${BASH_SOURCE[0]}"))" -BASH_FUNCTION_DIR="$(readlink -e "${BASH_CHECKS_DIR}/../../function")" -source "${BASH_FUNCTION_DIR}/common.sh" || { - echo "Source failed." >&2 - exit 1 -} - -job_spec_dir="docs/job_specs/" -rm -f "job_spec.log" || die -violations=0 - -# Disabling -x: Following lines are doing too much garbage output. -set +x - -for f in $(find ${job_spec_dir} -type f | grep -v perf_tests_job_specs); do - declared=$(fgrep "### tests" $f | tr -dc '0-9') - present=$(fgrep -v '#' $f | wc -l) - if [ "${declared}" != "${present}" ]; then - echo "Wrong number of tests detected in ${f}: \ -declared: ${declared} / present: ${present}" | tee -a job_spec.log - violations=$((violations+1)) - fi -done - -set -x - -if [ "${violations}" != "0" ]; then - warn - warn "Number of tests in job spec checker: FAIL" - exit 1 -fi - -warn -warn "Number of tests in job spec checker: PASS" diff --git a/resources/libraries/bash/shell/tc_naming.sh b/resources/libraries/bash/shell/tc_naming.sh deleted file mode 100644 index f392ad7b9a..0000000000 --- a/resources/libraries/bash/shell/tc_naming.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2021 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. - -set -xeuo pipefail - -# This file should be executed from tox, as the assumend working directory -# is different from where this file is located. -# This file does not have executable flag nor shebang, -# to dissuade non-tox callers. - -# "set -eu" handles failures from the following two lines. -BASH_CHECKS_DIR="$(dirname $(readlink -e "${BASH_SOURCE[0]}"))" -BASH_FUNCTION_DIR="$(readlink -e "${BASH_CHECKS_DIR}/../../function")" -source "${BASH_FUNCTION_DIR}/common.sh" || { - echo "Source failed." >&2 - exit 1 -} - -# Grep of interest: We want all [0-9]{2,4}B- or IMIX- prefixed. -# Currently script assumes all variations inside to be part of either -# auto-generation or not checked at all (VIRL derivates). -r_grep="([0-9]{2,4}B|IMIX)-" -# Parse grep of interest (learn path, learn suite, learn testcase name). -r_parse='(.*)\/(.*).robot.*(([0-9]{2,4}B|IMIX)-.*)' - -# CSIT Testcase naming convention rules. -# https://wiki.fd.io/view/CSIT/csit-test-naming -# Rules are defined as regular expressions in ordered array and checked in order -# in a loop, where every iteration is catenated with previous rules. This way we -# can detect where exactly the naming does not meet criteria and print error -# from rule string array. This imply that rules are defined in a way of a single -# string. First rule must start with ^ and last is terminated by $. -# Rules are written from Left to Right. -# Bash regular expression logic is used. Once the error is raised the checker is -# breaked for current Testcase marking the expected fail. -# One caveat of this solution is that we cannot proceed to check full names now -# as majority of Testcases does not meet naming criteria. -s_testc_rules=( - 'packet size or file size' - 'core combination' - 'NIC driver mode' - 'packet encapsulation on L2 layer' - 'test type' - ) -r_testc_rules=( - '^([[:digit:]]{1,4}B|IMIX)-' - '([[:digit:]]+c-){0,1}' - '(avf-|1lbvpplacp-|2lbvpplacp-){0,1}' - '(eth|dot1q|dot1ad)' - # TODO: Packet encapsulation (here majority of TC starts failing). - #'(ip4|ip6|ip6ip6|icmpv4|icmpv6)' - #'(ipsec[[:digit:]]+tnlhw|ipsec[[:digit:]]+tnlsw|' - #'srhip6|tcp|udp|lispip6|lispip4|vxlan){0,1}' - #'(http){0,1}-' - '(.*)-(scapy|ndrpdr|bps|cps|rps|reconf)$' - ) -s_suite_rules=( - 'number of SUT nodes' - 'NIC card' - 'NIC driver mode' - 'packet encapsulation on L2 layer' - 'test type' - ) -r_suite_rules=( - '^(2n1l|2n){0,1}-' - '(eth2p|10ge2p1x710)-' - '(avf-|1lbvpplacp-|2lbvpplacp-){0,1}' - '(eth|dot1q|dot1ad)' - # TODO: Packet encapsulation (here majority of TC starts failing). - #'(ip4|ip6|ip6ip6|icmpv4|icmpv6)' - #'(ipsec[[:digit:]]+tnlhw|ipsec[[:digit:]]+tnlsw|' - #'srhip6|tcp|udp|lispip6|lispip4|vxlan){0,1}' - #'(http){0,1}-' - '(.*)-(scapy|ndrpdr|bps|cps|rps|reconf)$' - ) - -rm -f "tc_naming.log" || die - -# Disabling -x: Following lines are doing too much garbage output. -set +x - -# Grep interest. -grep_match=$(grep -RE "${r_grep}" tests/*) || die -# Extract data from the grep output. -suites_dirs=($(printf "${grep_match}" | sed -re "s/${r_parse}/\1/")) || die -suites_names=($(printf "${grep_match}" | sed -re "s/${r_parse}/\2/")) || die -testcases_names=($(printf "${grep_match}" | sed -re "s/${r_parse}/\3/")) || die - -# Naming check. -total_failed_tc=0 -total_failed_su=0 -for idx in "${!testcases_names[@]}"; do - for pass in "${!r_suite_rules[@]}"; do - r_rule=$(printf '%s' "${r_suite_rules[@]:1:pass}") - if [[ ! "${suites_names[idx]}" =~ ${r_rule} ]]; then - msg="" - msg+="${suites_dirs[idx]}/${suites_names[idx]} / " - msg+="${testcases_names[idx]} ${s_suite_rules[pass]} " - msg+="is not matching suite naming rule!" - echo "${msg}" | tee -a "tc_naming.log" || die - total_failed_su=$((total_failed_su + 1)) - break - fi - done - for pass in "${!r_testc_rules[@]}"; do - r_rule=$(printf '%s' "${r_testc_rules[@]:1:pass}") - if [[ ! "${testcases_names[idx]}" =~ ${r_rule} ]]; then - msg="" - msg+="${suites_dirs[idx]}/${suites_names[idx]} / " - msg+="${testcases_names[idx]} ${s_testc_rules[pass]} " - msg+="is not matching testcase naming rule!" - echo "${msg}" | tee -a "tc_naming.log" || die - total_failed_tc=$((total_failed_tc + 1)) - break - fi - done -done - -set -x - -if [ $((total_failed_tc + total_failed_su)) != "0" ]; then - warn - warn "Testcase naming checker: FAIL" - exit 1 -fi - -warn -warn "Testcase naming checker: PASS" diff --git a/topologies/available/lf_2n_clx_testbed27.yaml b/topologies/available/lf_2n_clx_testbed27.yaml index dddc8dd7a6..1bf2aa67a2 100644 --- a/topologies/available/lf_2n_clx_testbed27.yaml +++ b/topologies/available/lf_2n_clx_testbed27.yaml @@ -104,11 +104,6 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci - honeycomb: - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 interfaces: port1: # s33-t27-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE. diff --git a/topologies/available/lf_2n_clx_testbed28.yaml b/topologies/available/lf_2n_clx_testbed28.yaml index ed707dc173..8df00378e0 100644 --- a/topologies/available/lf_2n_clx_testbed28.yaml +++ b/topologies/available/lf_2n_clx_testbed28.yaml @@ -104,11 +104,6 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci - honeycomb: - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 interfaces: port1: # s35-t28-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE. diff --git a/topologies/available/lf_2n_clx_testbed29.yaml b/topologies/available/lf_2n_clx_testbed29.yaml index 39d757a015..1a657f7f49 100644 --- a/topologies/available/lf_2n_clx_testbed29.yaml +++ b/topologies/available/lf_2n_clx_testbed29.yaml @@ -104,11 +104,6 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci - honeycomb: - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 interfaces: port1: # s37-t29-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE. diff --git a/topologies/available/lf_2n_skx_testbed21.yaml b/topologies/available/lf_2n_skx_testbed21.yaml index 5eba0397e7..86a5f3fe24 100644 --- a/topologies/available/lf_2n_skx_testbed21.yaml +++ b/topologies/available/lf_2n_skx_testbed21.yaml @@ -104,11 +104,6 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci - honeycomb: - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 interfaces: port1: # s3-t21-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE. diff --git a/topologies/available/lf_2n_skx_testbed22.yaml b/topologies/available/lf_2n_skx_testbed22.yaml index f048e52486..ee25175946 100644 --- a/topologies/available/lf_2n_skx_testbed22.yaml +++ b/topologies/available/lf_2n_skx_testbed22.yaml @@ -104,11 +104,6 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci - honeycomb: - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 interfaces: port1: # s5-t22-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE. diff --git a/topologies/available/lf_2n_skx_testbed23.yaml b/topologies/available/lf_2n_skx_testbed23.yaml index b62ccc9cf2..cb08cddf7d 100644 --- a/topologies/available/lf_2n_skx_testbed23.yaml +++ b/topologies/available/lf_2n_skx_testbed23.yaml @@ -104,11 +104,6 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci - honeycomb: - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 interfaces: port1: # s7-t23-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE. diff --git a/topologies/available/lf_2n_skx_testbed24.yaml b/topologies/available/lf_2n_skx_testbed24.yaml index 78483c3676..a945fa7e0a 100644 --- a/topologies/available/lf_2n_skx_testbed24.yaml +++ b/topologies/available/lf_2n_skx_testbed24.yaml @@ -104,11 +104,6 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci - honeycomb: - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 interfaces: port1: # s9-t24-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE. diff --git a/topologies/available/lf_3n_skx_testbed31.yaml b/topologies/available/lf_3n_skx_testbed31.yaml index 3706a3baeb..6cb33b6ce0 100644 --- a/topologies/available/lf_3n_skx_testbed31.yaml +++ b/topologies/available/lf_3n_skx_testbed31.yaml @@ -104,11 +104,6 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci - honeycomb: - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 interfaces: port1: # s11-t31-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE. @@ -166,11 +161,6 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci - honeycomb: - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 interfaces: port1: # s12-t31-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE. diff --git a/topologies/available/lf_3n_skx_testbed32.yaml b/topologies/available/lf_3n_skx_testbed32.yaml index bfb38fa4a2..206b469b90 100644 --- a/topologies/available/lf_3n_skx_testbed32.yaml +++ b/topologies/available/lf_3n_skx_testbed32.yaml @@ -104,11 +104,6 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci - honeycomb: - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 interfaces: port1: # s14-t32-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE. @@ -166,11 +161,6 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci - honeycomb: - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 interfaces: port1: # s15-t32-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE.