Functional testcases for tacker¶
Purpose of functional testcases is to verify various functionality of tacker features. From tacker home directory, testcases are located at tacker/tests/functional.
Writing a testcase:A testcase is written by declaring a class name derived from class base.BaseTackerTest. BaseTackerTest is class declared in tacker/tests/functional/base.py.
A testcase body typically looks as below:
class testClassName(base.BaseTackerTest):
//setup
//Testcase operations
//validations or asserts
//cleanup
In above example test class ‘testClassName’ is derived from base.BaseTackerTest. Testcases typically has sections to setup, test, validate results and finally cleanup.
Input yaml files: These are input files used in testcases for operations like create vnfd or create vnf. The location of files is samples/tests/etc/samples/.
requirements.txt and test-requirements.txt : The file requirements.txt and test-requirements.txt lists all the packages needed for functional test. These packages are installed during devstack installation. If there are any new packages needed for functional test make sure they are added in test-requirements.txt.
Asserting values in testcase: The base class BaseTackerTest inherits base.TestCase which has inbuild assert functions which can be used in testcase. Eg: assertIsNotNone, assertEqual
Tacker-client: In base.py we instantiate tackerclient object which has apis to create/delete/list vnfd/vnf once given the necessary parameters. Verify tackerclient/v1_0/client.py for all the tacker related apis supported.
Important guidelines to follow:¶
Install test-requirements.txt with below command:
pip install -r test-requirements.txt
It is important that the test case executed leaves the system in the same state it was prior to test case execution and not leave any stale data on system as this might affect other test cases.
There should not be any dependencies between testcases which assume one testcase should be executed and be passed for second testcase.
Testcases in tox environment may be executed in parallel. The order in which the testcases are executed may vary between two environments.
The code added should meet pep8 standards. This can be verified with following command and ensuring the code does not return any errors.
tox -e pep8
Execution of testcase:¶
Install tacker server via devstack installation, which registers tacker service and endpoint, creates “nfv_user” and “nfv” project, and registers default VIM with the created user and project.
From tacker directory, specific testcases can be executed using following commands:
tox -e functional tacker.tests.functional.xxx.yyy.<testcase>
Multi-node configuration for testing¶
For the Zuul environment that runs functional test, install tacker server via devstack installation in multi-node configuration.
Note
Not all functional tests require a multi-node configuration. Many tests can be run in an all-in-one mode. See Install via Devstack for installing all-in-one mode.
The steps to create an environment with a multi-node configuration similar to Zuul(controller/controller-tacker/compute1/compute2) are as follows. Here is a sample case that does not use k8s. Create four virtual machine (VM) environments each with IP addresses and host names, for example:
192.168.56.11 controller
192.168.56.12 controller-tacker
192.168.56.13 compute1
192.168.56.14 compute2
From above four hosts, DevStack on the controller host must be built first. Once completed, proceed with the remaining three hosts: controller-tacker, compute1, and compute2. The order of building Devstack on these three hosts is not important, and you can build them simultaneously if desired. To build DevStack on each host, run the script ./stack.sh.
Here is a sample case of using k8s. Create four virtual machine (VM) environments each with IP addresses and host names, for example:
192.168.56.21 controller
192.168.56.22 controller-tacker
192.168.56.23 controller-k8s
From above four hosts, DevStack on the controller host must be built first. Once completed, proceed with the remaining three hosts: controller-tacker and controller-k8s. The order of building Devstack on these three hosts is not important, and you can build them simultaneously if desired. To build DevStack on each host, run the script ./stack.sh.
Regarding the specs of your machine, see Devstack or Install via Devstack for details on the OS and Linux distribution to use.
For not using k8s¶
Preparation
Prepare 4VMs that meet the following criteria
Criteria
Recommended
CPU
4 cores or more
RAM
16 GB or more
Storage
32 GB or more
Create stack user on each VM
$ sudo useradd -s /bin/bash -d /opt/stack -m stack $ sudo chmod +x /opt/stack $ echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
Download devstack on each VM
$ git clone https://opendev.org/openstack/devstack
Create controller node
Create the following local.conf on controller node
$ cd devstack $ vi local.conf
# Not using k8s # local.conf.controller # NOTE: Items that are used in local.conf on Zuul but are not required # locally have been commented out. [[local|localrc]] disable_all_services enable_service c-api #disable_service c-bak enable_service c-sch enable_service c-vol enable_service cinder enable_service g-api #disable_service horizon enable_service key enable_service mysql enable_service n-api enable_service n-api-meta enable_service n-cond #disable_service n-cpu enable_service n-novnc enable_service n-sch enable_service ovn-controller enable_service ovn-northd enable_service ovs-vswitchd enable_service ovsdb-server enable_service placement-api enable_service q-ovn-metadata-agent enable_service q-qos enable_service q-svc enable_service rabbit #disable_service s-account #disable_service s-container #disable_service s-object #disable_service s-proxy #disable_service swift #disable_service tempest #disable_service tls-proxy ADMIN_PASSWORD="secretadmin" #CELLSV2_SETUP="singleconductor" DATABASE_PASSWORD="secretdatabase" #DATABASE_TYPE="mysql" DEBUG_LIBVIRT_COREDUMPS="True" #DEVSTACK_PARALLEL="True" ENABLE_SYSCTL_MEM_TUNING="True" ENABLE_SYSCTL_NET_TUNING="True" ENABLE_ZSWAP="True" #ERROR_ON_CLONE="True" FIXED_RANGE="10.1.0.0/20" FLOATING_RANGE="192.168.56.0/24" GNOCCHI_SERVICE_HOST="192.168.56.12" HOST_IP="192.168.56.11" IPV4_ADDRS_SAFE_TO_USE="10.1.0.0/20" #KEYSTONE_SERVICE_HOST="192.168.56.11" L2_AGENT_EXTENSIONS="qos" LIBVIRT_TYPE="qemu" LOGFILE="/opt/stack/logs/devstacklog.txt" #LOG_COLOR="False" MYSQL_HOST="192.168.56.11" NETWORK_GATEWAY="10.1.0.1" NOVA_LIBVIRT_TB_CACHE_SIZE="128" NOVA_VNC_ENABLED="True" NOVNC_FROM_PACKAGE="True" OVN_DBS_LOG_LEVEL="dbg" OVN_L3_CREATE_PUBLIC_NETWORK="True" OVS_BRIDGE_MAPPINGS="public:br-ex,mgmtphysnet0:br-infra" PHYSICAL_NETWORK="mgmtphysnet0" PUBLIC_BRIDGE_MTU="1430" PUBLIC_NETWORK_GATEWAY="192.168.56.1" Q_ML2_PLUGIN_MECHANISM_DRIVERS="ovn,logger" Q_SERVICE_PLUGIN_CLASSES="ovn-router,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin,neutron.services.qos.qos_plugin.QoSPlugin,qos" RABBIT_PASSWORD="secretrabbit" SERVICE_HOST="192.168.56.11" SERVICE_PASSWORD="secretservice" #SWIFT_HASH="1234123412341234" #SWIFT_REPLICAS="1" #SWIFT_START_ALL_SERVICES="False" #VERBOSE="True" VERBOSE_NO_TIMESTAMP="True" LIBS_FROM_GIT=aodh,barbican,cinder,devstack,glance,heat,horizon,keystone,networking-sfc,neutron,nova,os-test-images,placement,python-barbicanclient,python-tackerclient,requirements,swift,tacker,tacker-horizon enable_plugin aodh https://opendev.org/openstack/aodh enable_plugin barbican https://opendev.org/openstack/barbican enable_plugin heat https://opendev.org/openstack/heat enable_plugin networking-sfc https://opendev.org/openstack/networking-sfc [[post-config|$CINDER_CONF]] [lvmdriver-1] image_volume_cache_enabled = False [[post-config|$NEUTRON_CONF]] [DEFAULT] client_socket_timeout = 60 [[post-config|$NEUTRON_DHCP_CONF]] [DEFAULT] enable_isolated_metadata = True
Execute installation script
$ ./stack.sh
Create controller-tacker node
Create the following local.conf on controller-tacker node
$ cd devstack $ vi local.conf
# Not using k8s # local.conf.controller-tacker # NOTE: Items that are used in local.conf on Zuul but are not required # locally have been commented out. [[local|localrc]] disable_all_services enable_service ovn-controller enable_service ovs-vswitchd enable_service ovsdb-server enable_service q-ovn-metadata-agent enable_service tacker enable_service tacker-conductor ADMIN_PASSWORD="secretadmin" #CELLSV2_SETUP="singleconductor" DATABASE_HOST="192.168.56.11" DATABASE_PASSWORD="secretdatabase" DATABASE_TYPE="mysql" ENABLE_CHASSIS_AS_GW="False" ENABLE_SYSCTL_MEM_TUNING="True" ENABLE_SYSCTL_NET_TUNING="True" ENABLE_ZSWAP="True" #ERROR_ON_CLONE="True" FIXED_RANGE="10.1.0.0/20" FLOATING_RANGE="192.168.56.0/24" #GLANCE_HOSTPORT="192.168.56.11:9292" GNOCCHI_SERVICE_HOST="192.168.56.12" HOST_IP="192.168.56.12" IPV4_ADDRS_SAFE_TO_USE="10.1.0.0/20" IS_ZUUL_FT="True" #KEYSTONE_SERVICE_HOST="192.168.56.11" L2_AGENT_EXTENSIONS="qos" LIBVIRT_TYPE="qemu" LOGFILE="/opt/stack/logs/devstacklog.txt" #LOG_COLOR="False" MYSQL_HOST="192.168.56.11" NETWORK_GATEWAY="10.1.0.1" NOVA_LIBVIRT_TB_CACHE_SIZE="128" NOVA_VNC_ENABLED="True" NOVNC_FROM_PACKAGE="True" OVS_BRIDGE_MAPPINGS="public:br-ex,mgmtphysnet0:br-infra" PHYSICAL_NETWORK="mgmtphysnet0" PUBLIC_BRIDGE_MTU="1430" PUBLIC_NETWORK_GATEWAY="192.168.56.1" #Q_HOST="192.168.56.11" Q_ML2_PLUGIN_MECHANISM_DRIVERS="ovn,logger" Q_SERVICE_PLUGIN_CLASSES="qos,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin,neutron.services.qos.qos_plugin.QoSPlugin,ovn-router" RABBIT_HOST="192.168.56.11" RABBIT_PASSWORD="secretrabbit" SERVICE_HOST="192.168.56.11" SERVICE_PASSWORD="secretservice" TACKER_HOST="192.168.56.12" TACKER_MODE="standalone" #VERBOSE="True" VERBOSE_NO_TIMESTAMP="True" LIBS_FROM_GIT=aodh,barbican,cinder,devstack,glance,heat,horizon,keystone,networking-sfc,neutron,nova,os-test-images,placement,python-barbicanclient,python-tackerclient,requirements,swift,tacker,tacker-horizon enable_plugin tacker https://opendev.org/openstack/tacker [[post-config|$TACKER_CONF]] [database] max_pool_size = 0 [openstack_vim] stack_retries = 120
Execute installation script
$ ./stack.sh
Create compute1 node
Create the following local.conf on compute1 node
$ cd devstack $ vi local.conf
# Not using k8s # local.conf.compute1 # NOTE: Items that are used in local.conf on Zuul but are not required # locally have been commented out. [[local|localrc]] disable_all_services enable_service c-bak enable_service c-vol #disable_service dstat enable_service file_tracker #disable_service horizon enable_service memory_tracker enable_service n-cpu enable_service openstack-cli-server enable_service ovn-controller enable_service ovs-vswitchd enable_service ovsdb-server enable_service placement-client enable_service q-ovn-metadata-agent #disable_service tempest #disable_service tls-proxy ADMIN_PASSWORD="secretadmin" #CELLSV2_SETUP="singleconductor" DATABASE_HOST="192.168.56.11" DATABASE_PASSWORD="secretdatabase" DATABASE_TYPE="mysql" ENABLE_CHASSIS_AS_GW="False" ENABLE_SYSCTL_MEM_TUNING="True" ENABLE_SYSCTL_NET_TUNING="True" ENABLE_ZSWAP="True" #ERROR_ON_CLONE="True" FIXED_RANGE="10.1.0.0/20" FLOATING_RANGE="192.168.56.0/24" #GLANCE_HOSTPORT="192.168.56.11:9292" GNOCCHI_SERVICE_HOST="192.168.56.12" HOST_IP="192.168.56.13" IPV4_ADDRS_SAFE_TO_USE="10.1.0.0/20" #IS_ZUUL_FT="True" #KEYSTONE_SERVICE_HOST="192.168.56.11" L2_AGENT_EXTENSIONS="qos" LIBVIRT_TYPE="qemu" LOGFILE="/opt/stack/logs/devstacklog.txt" #LOG_COLOR="False" MYSQL_HOST="192.168.56.11" NETWORK_GATEWAY="10.1.0.1" NOVA_LIBVIRT_TB_CACHE_SIZE="128" NOVA_VNC_ENABLED="True" NOVNC_FROM_PACKAGE="True" OVS_BRIDGE_MAPPINGS="public:br-ex,mgmtphysnet0:br-infra" PHYSICAL_NETWORK="mgmtphysnet0" PUBLIC_BRIDGE_MTU="1430" PUBLIC_NETWORK_GATEWAY="192.168.56.1" #Q_HOST="192.168.56.11" Q_ML2_PLUGIN_MECHANISM_DRIVERS="ovn,logger" Q_SERVICE_PLUGIN_CLASSES="qos,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin,neutron.services.qos.qos_plugin.QoSPlugin,ovn-router" RABBIT_HOST="192.168.56.11" RABBIT_PASSWORD="secretrabbit" SERVICE_HOST="192.168.56.11" SERVICE_PASSWORD="secretservice" #TACKER_HOST="192.168.56.12" #TACKER_MODE="standalone" #VERBOSE="True" VERBOSE_NO_TIMESTAMP="True" LIBS_FROM_GIT=aodh,barbican,cinder,devstack,glance,heat,horizon,keystone,networking-sfc,neutron,nova,os-test-images,placement,python-barbicanclient,python-tackerclient,requirements,swift,tacker,tacker-horizon [[post-config|$NOVA_CONF]] [DEFAULT] vif_plugging_is_fatal = False
Execute installation script
$ ./stack.sh
Create compute2 node
Create the following local.conf on compute2 node
$ cd devstack $ vi local.conf
# Not using k8s # local.conf.compute2 # NOTE: Items that are used in local.conf on Zuul but are not required # locally have been commented out. [[local|localrc]] disable_all_services enable_service c-bak enable_service c-vol #disable_service dstat enable_service file_tracker #disable_service horizon enable_service memory_tracker enable_service n-cpu enable_service openstack-cli-server enable_service ovn-controller enable_service ovs-vswitchd enable_service ovsdb-server enable_service placement-client enable_service q-ovn-metadata-agent #disable_service tempest #disable_service tls-proxy ADMIN_PASSWORD="secretadmin" #CELLSV2_SETUP="singleconductor" DATABASE_HOST="192.168.56.11" DATABASE_PASSWORD="secretdatabase" DATABASE_TYPE="mysql" ENABLE_CHASSIS_AS_GW="False" ENABLE_SYSCTL_MEM_TUNING="True" ENABLE_SYSCTL_NET_TUNING="True" ENABLE_ZSWAP="True" #ERROR_ON_CLONE="True" FIXED_RANGE="10.1.0.0/20" FLOATING_RANGE="192.168.56.0/24" #GLANCE_HOSTPORT="192.168.56.11:9292" GNOCCHI_SERVICE_HOST="192.168.56.12" HOST_IP="192.168.56.14" IPV4_ADDRS_SAFE_TO_USE="10.1.0.0/20" #IS_ZUUL_FT="True" #KEYSTONE_SERVICE_HOST="192.168.56.11" L2_AGENT_EXTENSIONS="qos" LIBVIRT_TYPE="qemu" LOGFILE="/opt/stack/logs/devstacklog.txt" #LOG_COLOR="False" MYSQL_HOST="192.168.56.11" NETWORK_GATEWAY="10.1.0.1" NOVA_LIBVIRT_TB_CACHE_SIZE="128" NOVA_VNC_ENABLED="True" NOVNC_FROM_PACKAGE="True" OVS_BRIDGE_MAPPINGS="public:br-ex,mgmtphysnet0:br-infra" PHYSICAL_NETWORK="mgmtphysnet0" PUBLIC_BRIDGE_MTU="1430" PUBLIC_NETWORK_GATEWAY="192.168.56.1" #Q_HOST="192.168.56.11" Q_ML2_PLUGIN_MECHANISM_DRIVERS="ovn,logger" Q_SERVICE_PLUGIN_CLASSES="qos,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin,neutron.services.qos.qos_plugin.QoSPlugin,ovn-router" RABBIT_HOST="192.168.56.11" RABBIT_PASSWORD="secretrabbit" SERVICE_HOST="192.168.56.11" SERVICE_PASSWORD="secretservice" #TACKER_HOST="192.168.56.12" #TACKER_MODE="standalone" #VERBOSE="True" VERBOSE_NO_TIMESTAMP="True" LIBS_FROM_GIT=aodh,barbican,cinder,devstack,glance,heat,horizon,keystone,networking-sfc,neutron,nova,os-test-images,placement,python-barbicanclient,python-tackerclient,requirements,swift,tacker,tacker-horizon [[post-config|$NOVA_CONF]] [DEFAULT] vif_plugging_is_fatal = False
Execute installation script
$ ./stack.sh
For using k8s¶
Preparation
Prepare 3VMs that meet the following criteria
Criteria
Recommended
CPU
4 cores or more
RAM
16 GB or more
Storage
32 GB or more
Create stack user on each VM
$ sudo useradd -s /bin/bash -d /opt/stack -m stack $ sudo chmod +x /opt/stack $ echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
Download devstack on each VM
$ git clone https://opendev.org/openstack/devstack
Create controller node
Create the following local.conf on controller node
$ cd devstack $ vi local.conf
# Using k8s # local.conf.controller # NOTE: Items that are used in local.conf on Zuul but are not required # locally have been commented out. [[local|localrc]] disable_all_services enable_service c-api #disable_service c-bak enable_service c-sch enable_service c-vol enable_service cinder #disable_service coredns enable_service etcd3 enable_service g-api enable_service g-reg #disable_service horizon enable_service key enable_service mysql enable_service n-api enable_service n-api-meta enable_service n-cond #disable_service n-cpu enable_service n-novnc enable_service n-sch enable_service neutron enable_service ovn-controller enable_service ovn-northd enable_service ovs-vswitchd enable_service ovsdb-server enable_service placement-api enable_service placement-client enable_service q-ovn-metadata-agent enable_service q-qos enable_service q-svc enable_service rabbit #disable_service s-account #disable_service s-container #disable_service s-object #disable_service s-proxy #disable_service swift #disable_service tempest #disable_service tls-proxy ADMIN_PASSWORD="secretadmin" #CELLSV2_SETUP="singleconductor" DATABASE_PASSWORD="secretdatabase" #DATABASE_TYPE="mysql" DEBUG_LIBVIRT_COREDUMPS="True" #DEVSTACK_PARALLEL="True" ENABLE_SYSCTL_MEM_TUNING="True" ENABLE_SYSCTL_NET_TUNING="True" ENABLE_ZSWAP="True" #ERROR_ON_CLONE="True" ETCD_USE_RAMDISK="True" FIXED_RANGE="10.1.0.0/20" FLOATING_RANGE="192.168.56.0/24" GLOBAL_VENV="False" HOST_IP="192.168.56.21" IPV4_ADDRS_SAFE_TO_USE="10.1.0.0/20" #IS_ZUUL_FT="True" #KEYSTONE_SERVICE_HOST="10.209.133.219" L2_AGENT_EXTENSIONS="qos" LIBVIRT_TYPE="qemu" LOGFILE="/opt/stack/logs/devstacklog.txt" #LOG_COLOR="False" MYSQL_HOST="192.168.56.21" NETWORK_GATEWAY="10.1.0.1" NOVA_LIBVIRT_TB_CACHE_SIZE="128" NOVA_VNC_ENABLED="True" NOVNC_FROM_PACKAGE="True" OVN_DBS_LOG_LEVEL="dbg" OVN_L3_CREATE_PUBLIC_NETWORK="True" OVS_BRIDGE_MAPPINGS="public:br-ex,mgmtphysnet0:br-infra" PHYSICAL_NETWORK="mgmtphysnet0" PUBLIC_BRIDGE_MTU="1430" PUBLIC_NETWORK_GATEWAY="192.168.56.1" Q_ML2_PLUGIN_MECHANISM_DRIVERS="ovn,logger" Q_SERVICE_PLUGIN_CLASSES="ovn-router,neutron.services.qos.qos_plugin.QoSPlugin,qos" RABBIT_PASSWORD="secretrabbit" SERVICE_HOST="192.168.56.21" SERVICE_PASSWORD="secretservice" #SWIFT_HASH="1234123412341234" #SWIFT_REPLICAS="1" #SWIFT_START_ALL_SERVICES="False" #TACKER_HOST="10.208.192.130" #TACKER_MODE="standalone" USE_PYTHON3="True" #VERBOSE="True" VERBOSE_NO_TIMESTAMP="True" LIBS_FROM_GIT=barbican,cinder,devstack,devstack-plugin-container,glance,heat,horizon,keystone,neutron,nova,os-test-images,placement,python-barbicanclient,python-tackerclient,requirements,swift,tacker,tacker-horizon enable_plugin barbican https://opendev.org/openstack/barbican enable_plugin heat https://opendev.org/openstack/heat enable_plugin neutron https://opendev.org/openstack/neutron [[post-config|$NEUTRON_CONF]] [DEFAULT] global_physnet_mtu = 1430 [[post-config|$NEUTRON_DHCP_CONF]] [DEFAULT] enable_isolated_metadata = True
Execute installation script
$ ./stack.sh
Create controller-tacker node
Create the following local.conf on controller-tacker node
$ cd devstack $ vi local.conf
# Using k8s # local.conf.controller-tacker # NOTE: Items that are used in local.conf on Zuul but are not required # locally have been commented out. [[local|localrc]] disable_all_services enable_service ovn-controller enable_service ovn-northd enable_service ovs-vswitchd enable_service ovsdb-server enable_service q-ovn-metadata-agent enable_service tacker enable_service tacker-conductor ADMIN_PASSWORD="secretadmin" #CELLSV2_SETUP="singleconductor" #CONTAINER_ENGINE="crio" #CRIO_VERSION="1.30.5" DATABASE_HOST="192.168.56.21" DATABASE_PASSWORD="secretdatabase" DATABASE_TYPE="mysql" ENABLE_CHASSIS_AS_GW="False" ENABLE_SYSCTL_MEM_TUNING="True" ENABLE_SYSCTL_NET_TUNING="True" ENABLE_ZSWAP="True" #ERROR_ON_CLONE="True" FIXED_RANGE="10.1.0.0/20" FLOATING_RANGE="192.168.56.0/24" #GLANCE_HOSTPORT="10.209.133.219:9292" GLOBAL_VENV="False" HOST_IP="192.168.56.22" IPV4_ADDRS_SAFE_TO_USE="10.1.0.0/20" IS_ZUUL_FT="True" #K8S_API_SERVER_IP="10.209.0.153" #K8S_TOKEN="9agf12.zsu5uh2m4pzt3qba" #K8S_VERSION="1.30.5" #KEYSTONE_SERVICE_HOST="10.209.133.219" LIBVIRT_TYPE="qemu" LOGFILE="/opt/stack/logs/devstacklog.txt" #LOG_COLOR="False" MYSQL_HOST="192.168.56.21" NETWORK_GATEWAY="10.1.0.1" NOVA_LIBVIRT_TB_CACHE_SIZE="128" NOVA_VNC_ENABLED="True" NOVNC_FROM_PACKAGE="True" OVS_BRIDGE_MAPPINGS="public:br-ex,mgmtphysnet0:br-infra" PHYSICAL_NETWORK="mgmtphysnet0" PUBLIC_BRIDGE_MTU="1430" PUBLIC_NETWORK_GATEWAY="192.168.56.1" #Q_HOST="10.209.133.219" Q_ML2_PLUGIN_MECHANISM_DRIVERS="ovn,logger" RABBIT_HOST="192.168.56.21" RABBIT_PASSWORD="secretrabbit" SERVICE_HOST="192.168.56.21" SERVICE_PASSWORD="secretservice" TACKER_HOST="192.168.56.22" TACKER_MODE="standalone" #USE_PYTHON3="True" #VERBOSE="True" VERBOSE_NO_TIMESTAMP="True" LIBS_FROM_GIT=barbican,cinder,devstack,devstack-plugin-container,glance,heat,horizon,keystone,neutron,nova,os-test-images,placement,python-barbicanclient,python-tackerclient,requirements,swift,tacker,tacker-horizon enable_plugin tacker https://opendev.org/openstack/tacker [[post-config|$TACKER_CONF]] [database] max_pool_size = 0 [kubernetes_vim] stack_retries = 120
Execute installation script
$ ./stack.sh
Create controller-k8s node
Create the following local.conf on controller-k8s node
$ cd devstack $ vi local.conf
# Using k8s # local.conf.controller-k8s # NOTE: Items that are used in local.conf on Zuul but are not required # locally have been commented out. [[local|localrc]] disable_all_services enable_service container #disable_service etcd3 enable_service k8s-master enable_service ovn-controller enable_service ovn-northd enable_service ovs-vswitchd enable_service ovsdb-server enable_service q-ovn-metadata-agent ADMIN_PASSWORD="secretadmin" #CELLSV2_SETUP="singleconductor" CONTAINER_ENGINE="crio" CRIO_VERSION="1.30.5" DATABASE_HOST="192.168.56.21" DATABASE_PASSWORD="secretdatabase" DATABASE_TYPE="mysql" ENABLE_CHASSIS_AS_GW="False" ENABLE_SYSCTL_MEM_TUNING="True" ENABLE_SYSCTL_NET_TUNING="True" ENABLE_ZSWAP="True" #ERROR_ON_CLONE="True" FIXED_RANGE="10.1.0.0/20" FLOATING_RANGE="192.168.56.0/24" #GLANCE_HOSTPORT="10.209.133.219:9292" GLOBAL_VENV="False" HOST_IP="192.168.56.23" IPV4_ADDRS_SAFE_TO_USE="10.1.0.0/20" #IS_ZUUL_FT="True" K8S_API_SERVER_IP="192.168.56.23" K8S_TOKEN="9agf12.zsu5uh2m4pzt3qba" K8S_VERSION="1.30.5" #KEYSTONE_SERVICE_HOST="10.209.133.219" LIBVIRT_TYPE="qemu" LOGFILE="/opt/stack/logs/devstacklog.txt" #LOG_COLOR="False" MYSQL_HOST="192.168.56.21" NETWORK_GATEWAY="10.1.0.1" NOVA_LIBVIRT_TB_CACHE_SIZE="128" NOVA_VNC_ENABLED="True" NOVNC_FROM_PACKAGE="True" OVS_BRIDGE_MAPPINGS="public:br-ex,mgmtphysnet0:br-infra" PHYSICAL_NETWORK="mgmtphysnet0" PUBLIC_BRIDGE_MTU="1430" PUBLIC_NETWORK_GATEWAY="192.168.56.1" #Q_HOST="10.209.133.219" Q_ML2_PLUGIN_MECHANISM_DRIVERS="ovn,logger" RABBIT_HOST="192.168.56.21" RABBIT_PASSWORD="secretrabbit" SERVICE_HOST="192.168.56.21" SERVICE_PASSWORD="secretservice" #TACKER_HOST="10.208.192.130" #TACKER_MODE="standalone" USE_PYTHON3="True" #VERBOSE="True" VERBOSE_NO_TIMESTAMP="True" LIBS_FROM_GIT=barbican,cinder,devstack,devstack-plugin-container,glance,heat,horizon,keystone,neutron,nova,os-test-images,placement,python-barbicanclient,python-tackerclient,requirements,swift,tacker,tacker-horizon enable_plugin devstack-plugin-container https://opendev.org/openstack/devstack-plugin-container
Execute installation script
$ ./stack.sh
Note
Pre-settings may be required to install Kubernetes. See Kubernetes documentation for the target version for details. For example, the following settings are required for Kubernetes 1.30.5.
$ sudo modprobe overlay $ sudo modprobe br_netfilter $ cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf net.bridge.bridge-nf-call-ip6tableis=1 net.bridge.bridge-nf-call-iptables=1 net.ipv4.ip_forward=1 EOF $ sudo sysctl --system
Settings¶
Several settings are required to run the functional tests (FT). We provide shell script files that implement those settings. See Scripts for Setting of v1 Functional Tests for how to use them. Running these shell script files will complete the settings for running following functional tests (FT).
tacker-ft-legacy-vim
tacker-ft-v1-vnfpkgm
tacker-ft-v1-k8s
tacker-ft-v1-tosca-vnflcm
tacker-ft-v1-userdata-vnflcm
Committing testcase and opening a review:¶
Once testcase is added in local setup, commit the testcase and open for review using below guidelines: https://docs.openstack.org/infra/manual/developers.html
Sample testcase:¶
Check sample tests under following directory: https://opendev.org/openstack/tacker/src/branch/master/tacker/tests/functional/