Browse Source

Run end-to-end tempest with networking-ansible

The patch replaces the old standalone Neutron tests that tested only
Neutron to switch interaction.  The new approach deploys the multinode
devstack with all services like Ironic and Nova.  Multitenancy tests from
ironic-tempest-plugin repos are executed on the environment.  OVS is
used as a switch provider.

Change-Id: I7bd68de22b4e18007af71731483ec658a5436136
Jakub Libosvar 2 months ago
parent
commit
7b0c51f339

+ 126
- 15
devstack/plugin.sh View File

@@ -7,10 +7,20 @@ NET_ANSIBLE_ROLES_DIR=$NET_ANSIBLE_DIR/etc/ansible/roles/
7 7
 
8 8
 ANSIBLE_ROLES_DIR=/etc/ansible/roles
9 9
 
10
-NET_ANSIBLE_OVS_BRIDGE=${NET_ANSIBLE_OVS_BRIDGE:-net-ans-br}
11
-NET_ANSIBLE_OVS_PORT=${NET_ANSIBLE_OVS_PORT:-net-ans-p0}
10
+NET_ANS_SWITCH_INI_FILE="/etc/neutron/plugins/ml2/ml2_conf_netansible.ini"
11
+OVS_SWITCH_DATA_DIR="$DATA_DIR/ovs-switch"
12
+# NOTE(pas-ha) NEVER SET THIS TO ANY EXISTING USER!
13
+# you might get locked out of SSH when limitinig SSH sessions is enabled for this user,
14
+# AND THIS USER WILL BE DELETED TOGETHER WITH ITS HOME DIR ON UNSTACK/CLEANUP!!!
15
+# this is why it is left unconfigurable
16
+OVS_SWITCH_USER="ovs_manager"
17
+OVS_SWITCH_USER_HOME="$OVS_SWITCH_DATA_DIR/$OVS_SWITCH_USER"
18
+OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE="$OVS_SWITCH_USER_HOME/.ssh/authorized_keys"
19
+OVS_SWITCH_KEY_FILE=${OVS_SWITCH_KEY_FILE:-"$OVS_SWITCH_DATA_DIR/keys/ovs-switch"}
20
+
21
+OVS_SWITCH_TEST_BRIDGE="ovsswitch"
22
+OVS_SWITCH_TEST_PORT="sw-port-01"
12 23
 
13
-SSH_KEY_FILE=~/.ssh/id_rsa
14 24
 
15 25
 function ansible_workarounds {
16 26
     sudo pip uninstall ansible -y || :
@@ -27,6 +37,56 @@ function ansible_workarounds {
27 37
     popd
28 38
 }
29 39
 
40
+function create_ovs_manager_user {
41
+    # Give the non-root user the ability to run as **root** via ``sudo``
42
+    is_package_installed sudo || install_package sudo
43
+
44
+    if ! getent group $OVS_SWITCH_USER >/dev/null; then
45
+        echo "Creating a group called $OVS_SWITCH_USER"
46
+        sudo groupadd $OVS_SWITCH_USER
47
+    fi
48
+
49
+    if ! getent passwd $OVS_SWITCH_USER >/dev/null; then
50
+        echo "Creating a user called $OVS_SWITCH_USER"
51
+        mkdir -p $OVS_SWITCH_USER_HOME
52
+        sudo useradd -g $OVS_SWITCH_USER -s /bin/bash -d $OVS_SWITCH_USER_HOME -m $OVS_SWITCH_USER
53
+    fi
54
+
55
+    echo "Giving $OVS_SWITCH_USER user passwordless sudo privileges"
56
+    # UEC images ``/etc/sudoers`` does not have a ``#includedir``, add one
57
+    sudo grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers ||
58
+        echo "#includedir /etc/sudoers.d" | sudo tee -a /etc/sudoers
59
+    ( umask 226 && echo "$OVS_SWITCH_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/99_ovs_manager )
60
+
61
+}
62
+
63
+function configure_switch_ssh_keypair {
64
+    if [[ ! -d $OVS_SWITCH_USER_HOME/.ssh ]]; then
65
+        sudo mkdir -p $OVS_SWITCH_USER_HOME/.ssh
66
+        sudo chmod 700 $OVS_SWITCH_USER_HOME/.ssh
67
+    fi
68
+    # copy over stack user's authorized_keys to OVS_SWITCH_USER
69
+    # mostly needed for multinode gate job
70
+    if [[ -e "$HOME/.ssh/authorized_keys" ]];then
71
+        cat "$HOME/.ssh/authorized_keys" | sudo tee -a $OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE
72
+    fi
73
+    if [[ ! -e $OVS_SWITCH_KEY_FILE ]]; then
74
+        if [[ ! -d $(dirname $OVS_SWITCH_KEY_FILE) ]]; then
75
+            mkdir -p $(dirname $OVS_SWITCH_KEY_FILE)
76
+        fi
77
+        ssh-keygen -q -t rsa -P '' -f $OVS_SWITCH_KEY_FILE
78
+    fi
79
+    # NOTE(vsaienko) check for new line character, add if doesn't exist.
80
+    if [[ "$(sudo tail -c1 $OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE | wc -l)" == "0" ]]; then
81
+        echo "" | sudo tee -a $OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE
82
+    fi
83
+    cat $OVS_SWITCH_KEY_FILE.pub | sudo tee -a $OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE
84
+    # remove duplicate keys.
85
+    sudo sort -u -o $OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE $OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE
86
+    sudo chown $OVS_SWITCH_USER:$OVS_SWITCH_USER $OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE
87
+    sudo chown -R $OVS_SWITCH_USER:$OVS_SWITCH_USER $OVS_SWITCH_USER_HOME
88
+}
89
+
30 90
 function pre_install {
31 91
     # REVISIT(jlibosva): Ubuntu boxes use mawk by default which has a slightly
32 92
     #                    different syntax than gawk.  mawk fails when merging
@@ -55,6 +115,22 @@ function install {
55 115
     install_ansible_roles
56 116
 }
57 117
 
118
+function add_ovs_switch_to_ml2_config {
119
+    local switch_name=$1
120
+    local key_file=$2
121
+    local username=$3
122
+    local ip=$4
123
+    local switch_mac=$5
124
+
125
+    populate_ml2_config $NET_ANS_SWITCH_INI_FILE $switch_name ansible_network_os=openvswitch
126
+    populate_ml2_config $NET_ANS_SWITCH_INI_FILE $switch_name ansible_user=$username
127
+    populate_ml2_config $NET_ANS_SWITCH_INI_FILE $switch_name ansible_ssh_private_key_file=$key_file
128
+    populate_ml2_config $NET_ANS_SWITCH_INI_FILE $switch_name ansible_host=$ip
129
+    populate_ml2_config $NET_ANS_SWITCH_INI_FILE $switch_name manage_vlans=False
130
+    if [[ "$switch_mac" != "" ]]; then
131
+        populate_ml2_config $NET_ANS_SWITCH_INI_FILE $switch_name mac=$switch_mac
132
+    fi
133
+}
58 134
 
59 135
 function post_config {
60 136
     # The function does following:
@@ -72,6 +148,35 @@ function post_config {
72 148
     populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2 mechanism_drivers=$Q_ML2_PLUGIN_MECHANISM_DRIVERS
73 149
 
74 150
     ansible_workarounds
151
+
152
+    create_ovs_manager_user
153
+    configure_switch_ssh_keypair
154
+
155
+    sudo ovs-vsctl --may-exist add-br $OVS_SWITCH_TEST_BRIDGE
156
+    sudo ovs-vsctl --may-exist add-port $OVS_SWITCH_TEST_BRIDGE $OVS_SWITCH_TEST_PORT -- set Interface $OVS_SWITCH_TEST_PORT type=internal
157
+
158
+    # Create generic_switch ml2 config
159
+    for switch in $OVS_SWITCH_TEST_BRIDGE $IRONIC_VM_NETWORK_BRIDGE; do
160
+        local bridge_mac
161
+        bridge_mac=$(ip link show dev $switch | awk '/ether [A-Za-z0-9:]+/{ print $2 }')
162
+        switch="ansible:$switch"
163
+        add_ovs_switch_to_ml2_config $switch $OVS_SWITCH_KEY_FILE $OVS_SWITCH_USER localhost $bridge_mac
164
+    done
165
+    echo "HOST_TOPOLOGY: $HOST_TOPOLOGY"
166
+    echo "HOST_TOPOLOGY_SUBNODES: $HOST_TOPOLOGY_SUBNODES"
167
+    if [ -n "$HOST_TOPOLOGY_SUBNODES" ]; then
168
+        # NOTE(vsaienko) with multinode topology we need to add switches from all
169
+        # the subnodes to the config on primary node
170
+        local cnt=0
171
+        local section
172
+        for node in $HOST_TOPOLOGY_SUBNODES; do
173
+            cnt=$((cnt+1))
174
+            section="ansible:sub${cnt}${IRONIC_VM_NETWORK_BRIDGE}"
175
+            add_ovs_switch_to_ml2_config $section $OVS_SWITCH_KEY_FILE $OVS_SWITCH_USER $node
176
+        done
177
+    fi
178
+
179
+    neutron_server_config_add $NET_ANS_SWITCH_INI_FILE
75 180
 }
76 181
 
77 182
 
@@ -82,26 +187,32 @@ function extra {
82 187
 
83 188
 function unstack {
84 189
     echo_summary "Unstack"
190
+
191
+    rm -f $NET_ANS_SWITCH_INI_FILE
192
+    if [[ -f $OVS_SWITCH_KEY_FILE ]]; then
193
+        local key
194
+        key=$(cat $OVS_SWITCH_KEY_FILE.pub)
195
+        # remove public key from authorized_keys
196
+        sudo grep -v "$key" $OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE > temp && sudo mv -f temp $OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE
197
+        sudo chown $OVS_SWITCH_USER:$OVS_SWITCH_USER $OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE
198
+        sudo chmod 0600 $OVS_SWITCH_KEY_AUTHORIZED_KEYS_FILE
199
+    fi
200
+    sudo ovs-vsctl --if-exists del-br $OVS_SWITCH_TEST_BRIDGE
201
+
202
+    # remove generic switch user, its permissions and limits
203
+    sudo rm -f /etc/sudoers.d/99_ovs_manager
204
+    sudo userdel --remove --force $OVS_SWITCH_USER
205
+    sudo groupdel $OVS_SWITCH_USER
206
+
207
+    sudo rm -rf $OVS_SWITCH_DATA_DIR
85 208
 }
86 209
 
87 210
 function test-config {
88 211
     echo_summary "Test config"
89
-
90
-    # Create resources for openvswitch
91
-    sudo ovs-vsctl --may-exist add-br $NET_ANSIBLE_OVS_BRIDGE -- --may-exist add-port $NET_ANSIBLE_OVS_BRIDGE $NET_ANSIBLE_OVS_PORT -- set Interface $NET_ANSIBLE_OVS_PORT type=internal
92
-    sudo ovs-vsctl set Port $NET_ANSIBLE_OVS_PORT tag=[]
93
-
94
-    # Allow ansible on localhost
95
-    [ -f $SSH_KEY_FILE ] || ssh-keygen -q -t rsa -P '' -f $SSH_KEY_FILE
96
-    [ -f ${SSH_KEY_FILE}.pub ] || ssh-keygen -y -f $SSH_KEY_FILE > ${SSH_KEY_FILE}.pub
97
-    cat ${SSH_KEY_FILE}.pub >> ~/.ssh/authorized_keys
98
-    chmod 600 ~/.ssh/authorized_keys
99 212
 }
100 213
 
101 214
 function clean {
102 215
     echo_summary "Clean"
103
-
104
-    sudo ovs-vsctl del-br $NET_ANSIBLE_OVS_BRIDGE
105 216
 }
106 217
 
107 218
 

+ 0
- 0
net_ansible_tempest/__init__.py View File


+ 0
- 47
net_ansible_tempest/config.py View File

@@ -1,47 +0,0 @@
1
-# Copyright 2018 Red Hat, Inc.
2
-# All Rights Reserved.
3
-#
4
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
-#    not use this file except in compliance with the License. You may obtain
6
-#    a copy of the License at
7
-#
8
-#         http://www.apache.org/licenses/LICENSE-2.0
9
-#
10
-#    Unless required by applicable law or agreed to in writing, software
11
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
-#    License for the specific language governing permissions and limitations
14
-#    under the License.
15
-
16
-from oslo_config import cfg
17
-
18
-service_option = cfg.BoolOpt(
19
-    'netansible',
20
-    default=False,
21
-    help='Whether or not Networking Ansbile mech driver is expected to be '
22
-         'available.')
23
-
24
-ovs_opt_group = cfg.OptGroup(
25
-    name='net_ansible_openvswitch',
26
-    title='Settings for OVS provider.',
27
-    help='Options group for OVS Ansible provider.')
28
-
29
-OVS_GROUP = [
30
-    cfg.StrOpt(
31
-        'ovsdb_connection',
32
-        default='tcp:127.0.0.1:6640',
33
-        help='Connection string to OVSDB.'),
34
-    cfg.StrOpt(
35
-        'switch_name',
36
-        default='ovs_test',
37
-        help='Name of the switch as presented in the networking ansible '
38
-             'config file.'),
39
-    cfg.StrOpt(
40
-        'bridge_name',
41
-        default='net-ans-br',
42
-        help='Name of the bridge which port is attached to.'),
43
-    cfg.StrOpt(
44
-        'port_name',
45
-        default='net-ans-p0',
46
-        help='Name of the port that is being tested'),
47
-]

+ 0
- 45
net_ansible_tempest/plugin.py View File

@@ -1,45 +0,0 @@
1
-# Copyright 2018 Red Hat, Inc.
2
-# All Rights Reserved.
3
-#
4
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
-#    not use this file except in compliance with the License. You may obtain
6
-#    a copy of the License at
7
-#
8
-#         http://www.apache.org/licenses/LICENSE-2.0
9
-#
10
-#    Unless required by applicable law or agreed to in writing, software
11
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
-#    License for the specific language governing permissions and limitations
14
-#    under the License.
15
-
16
-import os
17
-
18
-from tempest import config
19
-from tempest.test_discover import plugins
20
-
21
-from net_ansible_tempest import config as plugin_config
22
-
23
-
24
-class NetAnsibleTempestPlugin(plugins.TempestPlugin):
25
-    def get_opt_lists(self):
26
-        return [
27
-            (plugin_config.ovs_opt_group.name, plugin_config.OVS_GROUP),
28
-            ('service_available', [plugin_config.service_option]),
29
-        ]
30
-
31
-    def get_service_clients(self):
32
-        pass
33
-
34
-    def load_tests(self):
35
-        base_path = os.path.split(os.path.dirname(
36
-            os.path.abspath(__file__)))[0]
37
-        test_dir = os.path.join("net_ansible_tempest", "tests")
38
-        full_test_dir = os.path.join(base_path, test_dir)
39
-        return full_test_dir, base_path
40
-
41
-    def register_opts(self, conf):
42
-        config.register_opt_group(
43
-            conf, plugin_config.ovs_opt_group, plugin_config.OVS_GROUP)
44
-        conf.register_opt(
45
-            plugin_config.service_option, group='service_available')

+ 0
- 0
net_ansible_tempest/tests/__init__.py View File


+ 0
- 20
net_ansible_tempest/tests/base.py View File

@@ -1,20 +0,0 @@
1
-# Copyright 2018 Red Hat, Inc.
2
-#
3
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-#    not use this file except in compliance with the License. You may obtain
5
-#    a copy of the License at
6
-#
7
-#         http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-#    Unless required by applicable law or agreed to in writing, software
10
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-#    License for the specific language governing permissions and limitations
13
-#    under the License.
14
-
15
-from tempest.api.network import base
16
-
17
-
18
-class NetAnsibleAdminBaseTest(base.BaseAdminNetworkTest):
19
-
20
-    credentials = ["primary", "admin"]

+ 0
- 0
net_ansible_tempest/tests/scenario/__init__.py View File


+ 0
- 112
net_ansible_tempest/tests/scenario/test_basic_ops.py View File

@@ -1,112 +0,0 @@
1
-# Copyright 2018 Red Hat, Inc.
2
-#
3
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-#    not use this file except in compliance with the License. You may obtain
5
-#    a copy of the License at
6
-#
7
-#         http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-#    Unless required by applicable law or agreed to in writing, software
10
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-#    License for the specific language governing permissions and limitations
13
-#    under the License.
14
-
15
-from oslo_config import cfg
16
-from tempest.lib import decorators
17
-from tempest.lib import exceptions
18
-
19
-from net_ansible_tempest.tests import base
20
-from net_ansible_tempest.tests import utils
21
-
22
-
23
-class TestWithOvs(base.NetAnsibleAdminBaseTest):
24
-
25
-    @classmethod
26
-    def skip_checks(cls):
27
-        super(TestWithOvs, cls).skip_checks()
28
-        if not cfg.CONF.service_available.netansible:
29
-            raise cls.skipException("networking ansible is not enabled")
30
-
31
-    def setUp(self):
32
-        super(TestWithOvs, self).setUp()
33
-        self.ovs = utils.get_idl_singleton()
34
-        self.network = self.create_network()
35
-
36
-    def cleanup_port(self, port_id):
37
-        """Remove Neutron port and skip NotFound exceptions."""
38
-        try:
39
-            self.admin_ports_client.delete_port(port_id)
40
-        except exceptions.NotFound:
41
-            pass
42
-
43
-    @property
44
-    def ovs_bridge_name(self):
45
-        return cfg.CONF.net_ansible_openvswitch.bridge_name
46
-
47
-    @property
48
-    def ovs_bridge_mac(self):
49
-        return self.ovs.db_get(
50
-            'Interface', self.ovs_bridge_name, 'mac_in_use').execute()
51
-
52
-    @property
53
-    def switch_name(self):
54
-        return cfg.CONF.net_ansible_openvswitch.switch_name
55
-
56
-    @property
57
-    def ovs_port_name(self):
58
-        return cfg.CONF.net_ansible_openvswitch.port_name
59
-
60
-    def get_network_segmentation_id(self, network_id):
61
-        return self.admin_networks_client.show_network(
62
-            network_id)['network']['provider:segmentation_id']
63
-
64
-    def create_port(self, network_id, local_link_info):
65
-        port = self.admin_ports_client.create_port(
66
-            network_id=network_id, name=self.ovs_port_name)['port']
67
-        self.addCleanup(self.cleanup_port, port['id'])
68
-
69
-        host = self.admin_agents_client.list_agents(
70
-            agent_type='Open vSwitch agent'
71
-        )['agents'][0]['host']
72
-
73
-        update_args = {
74
-            'device_owner': 'baremetal:none',
75
-            'device_id': 'fake-instance-uuid',
76
-            'admin_state_up': True,
77
-            'binding:vnic_type': 'baremetal',
78
-            'binding:host_id': host,
79
-            'binding:profile': {
80
-                'local_link_information': local_link_info
81
-            }
82
-        }
83
-        self.admin_ports_client.update_port(
84
-            port['id'],
85
-            **update_args
86
-        )
87
-        return port
88
-
89
-    def _test_update_port(self, local_link_info):
90
-        port = self.create_port(self.network['id'], local_link_info)
91
-        current_tag = self.ovs.db_get(
92
-            'Port', self.ovs_port_name, 'tag').execute()
93
-        network_segmentation_id = self.get_network_segmentation_id(
94
-            self.network['id'])
95
-        self.assertEqual(network_segmentation_id, current_tag)
96
-
97
-        self.cleanup_port(port['id'])
98
-        current_tag = self.ovs.db_get(
99
-            'Port', self.ovs_port_name, 'tag').execute()
100
-        self.assertEqual([], current_tag)
101
-
102
-    @decorators.idempotent_id('40b81fe4-1e9c-4f10-a808-c23f85aea5e2')
103
-    def test_update_port(self):
104
-        local_link_info = [{'switch_info': self.switch_name,
105
-                            'port_id': self.ovs_port_name}]
106
-        self._test_update_port(local_link_info)
107
-
108
-    @decorators.idempotent_id('40b81fe4-1e9c-4f10-a808-c23f85aea5e3')
109
-    def test_update_port_no_info(self):
110
-        local_link_info = [{'switch_id': '01:23:45:67:89:ab',
111
-                            'port_id': self.ovs_port_name}]
112
-        self._test_update_port(local_link_info)

+ 0
- 43
net_ansible_tempest/tests/utils.py View File

@@ -1,43 +0,0 @@
1
-# Copyright 2018 Red Hat, Inc.
2
-#
3
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-#    not use this file except in compliance with the License. You may obtain
5
-#    a copy of the License at
6
-#
7
-#         http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-#    Unless required by applicable law or agreed to in writing, software
10
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-#    License for the specific language governing permissions and limitations
13
-#    under the License.
14
-
15
-from oslo_config import cfg
16
-from ovs.db import idl
17
-from ovsdbapp.backend.ovs_idl import connection
18
-from ovsdbapp.backend.ovs_idl import idlutils
19
-from ovsdbapp.schema.open_vswitch import impl_idl
20
-
21
-_idl = None
22
-
23
-
24
-def idl_factory(conn, schema):
25
-    helper = idlutils.get_schema_helper(conn, schema)
26
-    helper.register_all()
27
-
28
-    return idl.Idl(conn, helper)
29
-
30
-
31
-def get_idl_singleton():
32
-    global _idl
33
-
34
-    conn = cfg.CONF.net_ansible_openvswitch.ovsdb_connection
35
-    schema = "Open_vSwitch"
36
-
37
-    if _idl is None:
38
-        _connection = connection.Connection(
39
-            idl=idl_factory(conn, schema),
40
-            timeout=10)
41
-        _idl = impl_idl.OvsdbIdl(_connection)
42
-
43
-    return _idl

+ 13
- 0
playbooks/ci-workarounds/set-stack-key.yaml View File

@@ -0,0 +1,13 @@
1
+- hosts: all
2
+  name: Copy ssh keys from too ~stack
3
+  tasks:
4
+    - shell:
5
+        cmd: |
6
+          set -e
7
+          set -x
8
+
9
+          sudo mkdir -p ~stack/.ssh
10
+          sudo cp ~root/.ssh/id_rsa.pub ~root/.ssh/id_rsa ~stack/.ssh
11
+          sudo chmod 700 ~stack/.ssh
12
+          sudo chown -R stack ~stack
13
+        executable: /bin/bash

+ 0
- 2
setup.cfg View File

@@ -27,8 +27,6 @@ data_files =
27 27
 [entry_points]
28 28
 neutron.ml2.mechanism_drivers =
29 29
     ansible = networking_ansible.ml2.mech_driver:AnsibleMechanismDriver
30
-tempest.test_plugins =
31
-    networking_ansible_whitebox = net_ansible_tempest.plugin:NetAnsibleTempestPlugin
32 30
 
33 31
 [build_sphinx]
34 32
 all-files = 1

+ 127
- 65
zuul.d/jobs.yaml View File

@@ -1,81 +1,143 @@
1 1
 - job:
2
-    name: networking-ansible-tempest-plugin-base
3
-    parent: devstack-tempest
4
-    abstract: true
5
-    description: Abstract base job for all plugin jobs
6
-    timeout: 7800
2
+    name: ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode-networking-ansible
3
+    description: ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode-networking-ansible
4
+    parent: tempest-multinode-full
5
+    pre-run: playbooks/ci-workarounds/set-stack-key.yaml
6
+    timeout: 10800
7 7
     required-projects:
8
-      - openstack/neutron
8
+      - openstack/ironic
9
+      - openstack/ironic-python-agent
10
+      - openstack/ironic-tempest-plugin
11
+      - openstack/pyghmi
12
+      - openstack/virtualbmc
9 13
       - openstack/networking-ansible
10 14
     irrelevant-files:
11
-      - ^.*\.rst$
12 15
       - ^doc/.*$
13
-      - ^networking_ansible/locale/.*$
14 16
       - ^networking_ansible/tests/.*$
15 17
       - ^releasenotes/.*$
16 18
       - ^setup.cfg$
19
+      - ^tools/.*$
17 20
       - ^tox.ini$
18
-    roles:
19
-      - zuul: openstack-dev/devstack
20 21
     vars:
21 22
       tox_envlist: all
23
+      tempest_concurrency: 4
24
+      tempest_test_regex: "(ironic_tempest_plugin.tests.scenario|test_schedule_to_all_nodes)"
22 25
       devstack_localrc:
23
-        TEMPEST_PLUGINS: /opt/stack/networking-ansible
24
-        Q_PLUGIN: ml2
25
-        Q_USE_PROVIDERNET_FOR_PUBLIC: False
26
+        BUILD_TIMEOUT: 1200
27
+        DEFAULT_INSTANCE_TYPE: baremetal
28
+        ENABLE_TENANT_TUNNELS: False
26 29
         ENABLE_TENANT_VLANS: True
27
-        NET_ANSIBLE_OVS_BRIDGE: net-ans-br
28
-        NET_ANSIBLE_OVS_PORT: net-ans-p0
29
-      devstack_local_conf:
30
-        post-config:
31
-          /$Q_PLUGIN_CONF_FILE:
32
-            ansible:ovs_test:
33
-              ansible_network_os: openvswitch
34
-              ansible_host: localhost
35
-              mac: 01:23:45:67:89:ab
36
-        test-config:
37
-          $TEMPEST_CONFIG:
38
-            net_ansible_openvswitch:
39
-              switch_name: ovs_test
40
-              bridge_name: net-ans-br
41
-              port_name: net-ans-p0
42
-            service_available:
43
-              netansible: true
30
+        FORCE_CONFIG_DRIVE: True
31
+        OVS_SWITCH_KEY_FILE: /opt/stack/.ssh/id_rsa
32
+        HOST_TOPOLOGY: multinode
33
+        HOST_TOPOLOGY_ROLE: primary
34
+        INSTALL_TEMPEST: False # Don't install a tempest package globaly
35
+        IRONIC_AUTOMATED_CLEAN_ENABLED: False
36
+        HOST_TOPOLOGY_SUBNODES: "{{ hostvars['compute1']['nodepool']['public_ipv4'] }}"
37
+        IRONIC_BAREMETAL_BASIC_OPS: True
38
+        IRONIC_BUILD_DEPLOY_RAMDISK: False
39
+        IRONIC_CALLBACK_TIMEOUT: 600
40
+        IRONIC_DEFAULT_DEPLOY_INTERFACE: direct
41
+        IRONIC_DEFAULT_BOOT_OPTION: local
42
+        IRONIC_DEPLOY_DRIVER: ipmi
43
+        IRONIC_ENABLED_NETWORK_INTERFACES: flat,neutron
44
+        IRONIC_INSPECTOR_BUILD_RAMDISK: False
45
+        IRONIC_NETWORK_INTERFACE: neutron
46
+        IRONIC_PROVISION_NETWORK_NAME: ironic-provision
47
+        IRONIC_PROVISION_SUBNET_GATEWAY: 10.0.5.1
48
+        IRONIC_PROVISION_SUBNET_PREFIX: 10.0.5.0/24
49
+        IRONIC_RAMDISK_TYPE: tinyipa
50
+        IRONIC_TEMPEST_BUILD_TIMEOUT: 600
51
+        IRONIC_TEMPEST_WHOLE_DISK_IMAGE: True
52
+        IRONIC_USE_LINK_LOCAL: True
53
+        IRONIC_VM_COUNT: 7
54
+        IRONIC_VM_EPHEMERAL_DISK: 0
55
+        IRONIC_VM_LOG_DIR: '{{ devstack_base_dir }}/ironic-bm-logs'
56
+        IRONIC_VM_SPECS_RAM: 384
57
+        OS_TEST_TIMEOUT: 2400
58
+        OVERRIDE_PUBLIC_BRIDGE_MTU: 1400
59
+        OVS_BRIDGE_MAPPINGS: 'mynetwork:brbm,public:br-infra'
60
+        OVS_PHYSICAL_BRIDGE: brbm
61
+        PHYSICAL_NETWORK: mynetwork
62
+        PUBLIC_BRIDGE: br-infra
63
+        Q_AGENT: openvswitch
64
+        Q_ML2_TENANT_NETWORK_TYPE: vlan
65
+        Q_PLUGIN: ml2
66
+        SWIFT_ENABLE_TEMPURLS: True
67
+        SWIFT_TEMPURL_KEY: secretkey
68
+        TEMPEST_PLUGINS: "'{{ ansible_user_dir }}/src/git.openstack.org/openstack/ironic-tempest-plugin'"
69
+        TENANT_VLAN_RANGE: 100:150
70
+        VIRT_DRIVER: ironic
44 71
       devstack_plugins:
45
-        networking-ansible: git://git.openstack.org/openstack/networking-ansible.git
72
+        ironic: git://git.openstack.org/openstack/ironic
73
+        networking-ansible: git://git.openstack.org/openstack/networking-ansible
74
+      zuul_copy_output:
75
+        '{{ devstack_base_dir }}/ironic-bm-logs': 'logs'
46 76
       devstack_services:
47
-        # Nova services
48
-        nova: false
49
-        n-api: false
50
-        n-api-meta: false
51
-        n-novnc: false
52
-        n-cond: false
53
-        n-cpu: false
54
-        n-obj: false
55
-        n-sch: false
56
-        n-cauth: false
57
-        # Glance services
58
-        g-api: false
59
-        g-reg: false
60
-        # Neutron services
61
-        q-metering: false
62
-        # Swift services
63
-        s-account: false
64
-        s-container: false
65
-        s-object: false
66
-        s-proxy: false
67
-        # Cinder services
68
-        c-api: false
69
-        c-bak: false
70
-        c-sch: false
71
-        c-vol: false
72
-        cinder: false
77
+        c-api: False
78
+        c-bak: False
79
+        c-sch: False
80
+        c-vol: False
81
+        cinder: False
73 82
 
74
-- job:
75
-    name: networking-ansible-tempest-ovs
76
-    parent: networking-ansible-tempest-plugin-base
77
-    pre-run: playbooks/networking-ansible-tempest-ovs/pre-run.yaml
78
-    post-run: playbooks/networking-ansible-tempest-ovs/post-run.yaml
79
-    vars:
80
-      tempest_test_regex: ^net_ansible_tempest\.tests\.scenario
81
-      ansible_logs_file: /opt/stack/ansible.log
83
+        s-account: True
84
+        s-container: True
85
+        s-object: True
86
+        s-proxy: True
87
+
88
+        dstat: True
89
+        g-api: True
90
+        g-reg: True
91
+        key: True
92
+        mysql: True
93
+        n-api: True
94
+        n-api-meta: True
95
+        n-cauth: True
96
+        n-cond: True
97
+        n-cpu: True
98
+        n-novnc: True
99
+        n-obj: True
100
+        n-sch: True
101
+        placement-api: True
102
+        q-agt: True
103
+        q-dhcp: True
104
+        q-l3: True
105
+        q-meta: True
106
+        q-metering: True
107
+        q-svc: True
108
+        rabbit: True
109
+    group-vars:
110
+      subnode:
111
+        devstack_localrc:
112
+          ENABLE_TENANT_TUNNELS: False
113
+          ENABLE_TENANT_VLANS: True
114
+          HOST_TOPOLOGY: multinode
115
+          HOST_TOPOLOGY_ROLE: subnode
116
+          IRONIC_AUTOMATED_CLEAN_ENABLED: False
117
+          IRONIC_BAREMETAL_BASIC_OPS: True
118
+          IRONIC_DEPLOY_DRIVER: ipmi
119
+          IRONIC_DEFAULT_BOOT_OPTION: local
120
+          IRONIC_ENABLED_NETWORK_INTERFACES: flat,neutron
121
+          IRONIC_NETWORK_INTERFACE: neutron
122
+          IRONIC_PROVISION_NETWORK_NAME: ironic-provision
123
+          IRONIC_RAMDISK_TYPE: tinyipa
124
+          IRONIC_USE_LINK_LOCAL: True
125
+          IRONIC_VM_COUNT: 7
126
+          IRONIC_VM_EPHEMERAL_DISK: 0
127
+          IRONIC_VM_LOG_DIR: '{{ devstack_base_dir }}/ironic-bm-logs'
128
+          IRONIC_VM_NETWORK_BRIDGE: sub1brbm
129
+          IRONIC_VM_SPECS_RAM: 384
130
+          OVS_BRIDGE_MAPPINGS: 'mynetwork:sub1brbm,public:br-infra'
131
+          OVS_PHYSICAL_BRIDGE: sub1brbm
132
+          PHYSICAL_NETWORK: mynetwork
133
+          Q_ML2_TENANT_NETWORK_TYPE: vlan
134
+          VIRT_DRIVER: ironic
135
+        devstack_services:
136
+          c-api: False
137
+          c-bak: False
138
+          c-sch: False
139
+          c-vol: False
140
+          cinder: False
141
+
142
+          q-agt: True
143
+          n-cpu: True

+ 2
- 4
zuul.d/project.yaml View File

@@ -2,10 +2,8 @@
2 2
     name: networking-ansible-tempest-jobs
3 3
     check:
4 4
       jobs:
5
-        - networking-ansible-tempest-ovs
6
-    gate:
7
-      jobs:
8
-        - networking-ansible-tempest-ovs
5
+        - ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode-networking-ansible:
6
+            voting: false
9 7
 
10 8
 - project:
11 9
     templates:

Loading…
Cancel
Save