summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
0805794)
When custom-packaging the VPP artifacts, it can be useful to exclude
some of the core plugins from packaging/testing, for some reasons.
A removal of a plugin(s) from the worktree needs to be tracked as
a separate change, and thus is tricky from the maintenance
point of view.
This change adds the ability to "pretend they do not exist" -
plugins which are added to the comma-separated environment
variable "VPP_EXCLUDED_PLUGINS" will not be added to the build
process and not packaged.
The tests do not have the 1:1 relationship as plugins,
so they might need to be modified separately. This change
includes some of these modifications as an example.
Type: feature
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Id31562d00a01ced1acbb4996a633517cbd6f09d8
ifeq ("$(V)","1")
vpp_cmake_args += -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
endif
ifeq ("$(V)","1")
vpp_cmake_args += -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
endif
+ifneq ($(VPP_EXCLUDED_PLUGINS),)
+vpp_cmake_args += -DVPP_EXCLUDED_PLUGINS="$(VPP_EXCLUDED_PLUGINS)"
+endif
ifneq ($(VPP_EXTRA_CMAKE_ARGS),)
vpp_cmake_args += $(VPP_EXTRA_CMAKE_ARGS)
ifneq ($(VPP_EXTRA_CMAKE_ARGS),)
vpp_cmake_args += $(VPP_EXTRA_CMAKE_ARGS)
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*/CMakeLists.txt
)
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*/CMakeLists.txt
)
+
+set(VPP_EXCLUDED_PLUGINS
+ ""
+ CACHE
+ STRING "Comma-separated list of core plugins excluded from packaging and tests"
+)
+
+# create the list of the plugins that we need to exclude from packaging
+SET(excluded_plugins "")
+STRING(REGEX REPLACE "[,]+" ";" exc_plugins "${VPP_EXCLUDED_PLUGINS}")
+foreach (e ${exc_plugins})
+ message(WARNING "Excluding plugin due to VPP_EXCLUDED_PLUGINS: '${e}'")
+ list(APPEND excluded_plugins ${e})
+endforeach()
+
foreach (f ${files})
get_filename_component(dir ${f} DIRECTORY)
foreach (f ${files})
get_filename_component(dir ${f} DIRECTORY)
- add_subdirectory(${dir})
+
+ # if a plugin is in the list of excluded plugin, do not add that subdirectory
+ LIST(FIND excluded_plugins "${dir}" exc_index)
+ if(${exc_index} EQUAL "-1")
+ add_subdirectory(${dir})
+ endif()
ARG17=--extern-apidir=$(EXTERN_APIDIR)
endif
ARG17=--extern-apidir=$(EXTERN_APIDIR)
endif
+EXC_PLUGINS_ARG=
+ifneq ($(VPP_EXCLUDED_PLUGINS),)
+# convert the comma-separated list into N invocations of the argument to exclude a plugin
+EXC_PLUGINS_ARG=$(shell echo "${VPP_EXCLUDED_PLUGINS}" | sed 's/\([^,]*\)/--excluded-plugin=\1/g; s/,/ /g')
+endif
+
+
+
EXTRA_ARGS=$(ARG0) $(ARG1) $(ARG2) $(ARG3) $(ARG4) $(ARG5) $(ARG6) $(ARG7) $(ARG8) $(ARG9) $(ARG10) $(ARG11) $(ARG12) $(ARG13) $(ARG14) $(ARG15) $(ARG16) $(ARG17)
EXTRA_ARGS=$(ARG0) $(ARG1) $(ARG2) $(ARG3) $(ARG4) $(ARG5) $(ARG6) $(ARG7) $(ARG8) $(ARG9) $(ARG10) $(ARG11) $(ARG12) $(ARG13) $(ARG14) $(ARG15) $(ARG16) $(ARG17)
-RUN_TESTS_ARGS=--failed-dir=$(FAILED_DIR) --verbose=$(V) --jobs=$(TEST_JOBS) --filter=$(TEST) --retries=$(RETRIES) --venv-dir=$(VENV_PATH) --vpp-ws-dir=$(WS_ROOT) --vpp-tag=$(TAG) --rnd-seed=$(RND_SEED) --vpp-worker-count="$(VPP_WORKER_COUNT)" --keep-pcaps $(PLUGIN_PATH_ARGS) $(TEST_PLUGIN_PATH_ARGS) $(EXTRA_ARGS)
+RUN_TESTS_ARGS=--failed-dir=$(FAILED_DIR) --verbose=$(V) --jobs=$(TEST_JOBS) --filter=$(TEST) --retries=$(RETRIES) --venv-dir=$(VENV_PATH) --vpp-ws-dir=$(WS_ROOT) --vpp-tag=$(TAG) --rnd-seed=$(RND_SEED) --vpp-worker-count="$(VPP_WORKER_COUNT)" --keep-pcaps $(PLUGIN_PATH_ARGS) $(EXC_PLUGINS_ARG) $(TEST_PLUGIN_PATH_ARGS) $(EXTRA_ARGS)
RUN_SCRIPT_ARGS=--python-opts=$(PYTHON_OPTS)
define retest-func
RUN_SCRIPT_ARGS=--python-opts=$(PYTHON_OPTS)
define retest-func
+@unittest.skipIf("quic" in config.excluded_plugins, "Exclude QUIC plugin tests")
class QUICTestCase(VppTestCase):
"""QUIC Test Case"""
class QUICTestCase(VppTestCase):
"""QUIC Test Case"""
help="Runs tests against a running VPP.",
)
help="Runs tests against a running VPP.",
)
+parser.add_argument(
+ "--excluded-plugin",
+ dest="excluded_plugins",
+ required=False,
+ action="append",
+ default=[],
+ help="Exclude the tests that indicate they require this plugin(s)",
+)
+
parser.add_argument(
"-d",
"--socket-dir",
parser.add_argument(
"-d",
"--socket-dir",
from socket import inet_pton, inet_ntop, AF_INET, AF_INET6
import unittest
from socket import inet_pton, inet_ntop, AF_INET, AF_INET6
import unittest
+from config import config
+
from framework import VppTestCase, VppTestRunner
from vpp_ip import DpoProto
from vpp_ip_route import (
from framework import VppTestCase, VppTestRunner
from vpp_ip import DpoProto
from vpp_ip_route import (
return "abf-attach-%d-%d" % (self.policy_id, self.sw_if_index)
return "abf-attach-%d-%d" % (self.policy_id, self.sw_if_index)
+@unittest.skipIf(
+ "acl" in config.excluded_plugins,
+ "Exclude ABF plugin tests due to absence of ACL plugin",
+)
+@unittest.skipIf("abf" in config.excluded_plugins, "Exclude ABF plugin tests")
class TestAbf(VppTestCase):
"""ABF Test Case"""
class TestAbf(VppTestCase):
"""ABF Test Case"""
import unittest
import random
import unittest
import random
+from config import config
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, TCP, UDP, ICMP
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, TCP, UDP, ICMP
from vpp_ip import INVALID_INDEX
from vpp_ip import INVALID_INDEX
+@unittest.skipIf("acl" in config.excluded_plugins, "Exclude ACL plugin tests")
@tag_fixme_vpp_workers
class TestACLplugin(VppTestCase):
"""ACL plugin Test Case"""
@tag_fixme_vpp_workers
class TestACLplugin(VppTestCase):
"""ACL plugin Test Case"""
from random import choice, shuffle
from pprint import pprint
from ipaddress import ip_network
from random import choice, shuffle
from pprint import pprint
from ipaddress import ip_network
+from config import config
import scapy.compat
from scapy.packet import Raw
import scapy.compat
from scapy.packet import Raw
from vpp_acl import AclRule, VppAcl, VppAclInterface
from vpp_acl import AclRule, VppAcl, VppAclInterface
+@unittest.skipIf("acl" in config.excluded_plugins, "Exclude ACL plugin tests")
class TestACLpluginL2L3(VppTestCase):
"""TestACLpluginL2L3 Test Case"""
class TestACLpluginL2L3(VppTestCase):
"""TestACLpluginL2L3 Test Case"""
import re
import unittest
from ipaddress import ip_network, IPv4Network, IPv6Network
import re
import unittest
from ipaddress import ip_network, IPv4Network, IPv6Network
+from config import config
import scapy.compat
from scapy.packet import Raw
import scapy.compat
from scapy.packet import Raw
from vpp_papi import MACAddress
from vpp_papi import MACAddress
+@unittest.skipIf("acl" in config.excluded_plugins, "Exclude ACL plugin tests")
class MethodHolder(VppTestCase):
DEBUG = False
class MethodHolder(VppTestCase):
DEBUG = False
+@unittest.skipIf("ikev2" in config.excluded_plugins, "Exclude IKEv2 plugin tests")
class IkePeer(VppTestCase):
"""common class for initiator and responder"""
class IkePeer(VppTestCase):
"""common class for initiator and responder"""
+@unittest.skipIf("ikev2" in config.excluded_plugins, "Exclude IKEv2 plugin tests")
class TestApi(VppTestCase):
"""Test IKEV2 API"""
class TestApi(VppTestCase):
"""Test IKEV2 API"""
import os
from hashlib import blake2s
import os
from hashlib import blake2s
+from config import config
from scapy.packet import Packet
from scapy.packet import Raw
from scapy.layers.l2 import Ether, ARP
from scapy.packet import Packet
from scapy.packet import Raw
from scapy.layers.l2 import Ether, ARP
return wg_p[Wireguard].message_type == 1
return wg_p[Wireguard].message_type == 1
+@unittest.skipIf(
+ "wireguard" in config.excluded_plugins, "Exclude Wireguard plugin tests"
+)
class TestWg(VppTestCase):
"""Wireguard Test Case"""
class TestWg(VppTestCase):
"""Wireguard Test Case"""
"""Multi-tunnel on the same port"""
"""Multi-tunnel on the same port"""
+@unittest.skipIf(
+ "wireguard" in config.excluded_plugins, "Exclude Wireguard plugin tests"
+)
class TestWgFIB(VppTestCase):
"""Wireguard FIB Test Case"""
class TestWgFIB(VppTestCase):
"""Wireguard FIB Test Case"""