aboutsummaryrefslogtreecommitdiffstats
path: root/resources/test_data/honeycomb
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2016-07-22 09:50:03 +0200
committerMatej Klotton <mklotton@cisco.com>2016-07-22 09:15:23 +0000
commitdec1188c7f89f5f8f97085b5f68c6f1d918586b8 (patch)
tree95d79281e92cb5cd5a64dda10991d71d852664f9 /resources/test_data/honeycomb
parent9c8743594ac51c51ac14b6b80c9806a79ada0753 (diff)
CSIT-219: Realocate resources for Honeycomb tests
- move the resources to resources/test_data/honeycomb Change-Id: I77c1bd5707f557799a7a189a9c695c50e5471621 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/test_data/honeycomb')
-rw-r--r--resources/test_data/honeycomb/acl.py82
-rw-r--r--resources/test_data/honeycomb/l2_fib.py142
-rw-r--r--resources/test_data/honeycomb/netconf/hello.py22
-rw-r--r--resources/test_data/honeycomb/netconf/subscription.py24
-rw-r--r--resources/test_data/honeycomb/netconf/triggers.py336
-rw-r--r--resources/test_data/honeycomb/persistence.py138
-rw-r--r--resources/test_data/honeycomb/sub_interfaces.py287
-rw-r--r--resources/test_data/honeycomb/vxlan.py28
-rw-r--r--resources/test_data/honeycomb/vxlan_gpe.py99
9 files changed, 1158 insertions, 0 deletions
diff --git a/resources/test_data/honeycomb/acl.py b/resources/test_data/honeycomb/acl.py
new file mode 100644
index 0000000000..227330c2a9
--- /dev/null
+++ b/resources/test_data/honeycomb/acl.py
@@ -0,0 +1,82 @@
+# Copyright (c) 2016 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.
+
+"""Test variables for access control list test suite."""
+
+# settings for acl tables
+hc_acl_table = {
+ "name": "acl_table_test",
+ "nbuckets": 1,
+ "memory_size": 100000,
+ "skip_n_vectors": 0,
+ "miss_next": "permit",
+ "mask": "00:00:00:00:00:00:ff:ff:ff:ff:ff:ff:00:00:00:00"
+}
+
+hc_acl_table2 = {
+ "name": "acl_table_test2",
+ "nbuckets": 2,
+ "memory_size": 100000,
+ "skip_n_vectors": 1,
+ "next_table": "acl_table_test",
+ "miss_next": "deny",
+ "mask": "ff:ff:ff:00:00:00:ff:ff:ff:ff:ff:ff:00:00:00:00"
+}
+# representation of table settings in VAT
+table_index = 0
+vat_acl_table = {
+ "nbuckets": hc_acl_table['nbuckets'],
+ "skip": 0,
+ "match": 1,
+ "nextnode": -1,
+ "nexttbl": -1,
+ "mask": hc_acl_table['mask'].replace(":", ""),
+}
+table_index2 = 1
+vat_acl_table2 = {
+ "nbuckets": hc_acl_table2['nbuckets'],
+ "skip": 1,
+ "match": 1,
+ "nextnode": 0,
+ "nexttbl": table_index,
+ "mask": hc_acl_table2['mask'].replace(":", ""),
+}
+# setting for acl sessions
+hc_acl_session = {
+ "match": "00:00:00:00:00:00:01:02:03:04:05:06:00:00:00:00",
+ "hit_next": "permit",
+ "opaque_index": "1",
+ "advance": 1
+}
+
+hc_acl_session2 = {
+ "match": "00:00:00:00:00:00:06:05:04:03:02:01:00:00:00:00",
+ "hit_next": "deny",
+ "opaque_index": "2",
+ "advance": 1
+}
+# representation of session settings in VAT
+session_index = 0
+vat_acl_session = {
+ "match": hc_acl_session['match'].replace(":", ""),
+ "advance": hc_acl_session['advance'],
+ "opaque": 1,
+ "next_index": -1
+}
+session_index2 = 1
+vat_acl_session2 = {
+ "match": hc_acl_session2['match'].replace(":", ""),
+ "advance": hc_acl_session2['advance'],
+ "opaque": 2,
+ "next_index": session_index
+}
diff --git a/resources/test_data/honeycomb/l2_fib.py b/resources/test_data/honeycomb/l2_fib.py
new file mode 100644
index 0000000000..b06193ad1d
--- /dev/null
+++ b/resources/test_data/honeycomb/l2_fib.py
@@ -0,0 +1,142 @@
+# Copyright (c) 2016 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.
+
+"""Test variables for Honeycomb L2 FIB test suite."""
+
+# Bridge domain name.
+bd_name = 'test-l2-bd'
+bd_index = 1
+
+# Bridge domain settings used while creating a test bridge domain.
+bd_settings = {
+ 'flood': True,
+ 'forward': True,
+ 'learn': True,
+ 'unknown-unicast-flood': True,
+ 'arp-termination': True
+}
+
+# Bridge domain configuration used while adding the bridge domain to an
+# interface.
+if_bd_settings = {
+ 'bridge-domain': bd_name,
+ 'split-horizon-group': 1,
+ 'bridged-virtual-interface': False
+}
+
+# Add L2 FIB entry (forward).
+# Configuration data:
+l2_fib_forward_cfg = {
+ "phys-address": "aa:bb:cc:dd:ee:ff",
+ "outgoing-interface": "GigabitEthernet0/8/0",
+ "action": "l2-fib-forward"
+}
+
+# Expected operational data:
+l2_fib_forward_oper = {
+ "phys-address": "aa:bb:cc:dd:ee:ff",
+ "outgoing-interface": "GigabitEthernet0/8/0",
+ "bridged-virtual-interface": False,
+ "action": "v3po:l2-fib-forward",
+ "static-config": False
+}
+
+# Expected VAT data:
+l2_fib_forward_vat = {
+ "mac": int("".join(l2_fib_forward_oper["phys-address"].split(':')), 16),
+ "static_mac": 0,
+ "filter_mac": 0,
+ "bvi_mac": 0
+ }
+
+# Add L2 FIB entry (static, forward).
+# Configuration data:
+l2_fib_static_forward_cfg = {
+ "phys-address": "22:22:33:44:55:66",
+ "outgoing-interface": "GigabitEthernet0/8/0",
+ "static-config": True,
+ "action": "l2-fib-forward"
+}
+
+# Expected operational data:
+l2_fib_static_forward_oper = {
+ "phys-address": "22:22:33:44:55:66",
+ "outgoing-interface": "GigabitEthernet0/8/0",
+ "bridged-virtual-interface": False,
+ "action": "v3po:l2-fib-forward",
+ "static-config": True
+}
+
+# Expected VAT data:
+l2_fib_static_forward_vat = {
+ "mac": int("".join(l2_fib_static_forward_oper["phys-address"].
+ split(':')), 16),
+ "sw_if_index": 5,
+ "static_mac": 1,
+ "filter_mac": 0,
+ "bvi_mac": 0
+}
+
+# Add L2 FIB entry (filter).
+# Configuration data:
+l2_fib_filter_cfg = {
+ "phys-address": "00:01:02:03:04:05",
+ "outgoing-interface": "GigabitEthernet0/8/0",
+ "static-config": True,
+ "action": "l2-fib-filter"
+}
+
+# Expected operational data:
+l2_fib_filter_oper = {
+ "phys-address": "00:01:02:03:04:05",
+ "outgoing-interface": "GigabitEthernet0/8/0",
+ "bridged-virtual-interface": False,
+ "action": "v3po:l2-fib-filter",
+ "static-config": True
+}
+
+# Expected VAT data:
+l2_fib_filter_vat = {
+ "mac": int("".join(l2_fib_filter_oper["phys-address"].split(':')), 16),
+ "sw_if_index": 5,
+ "static_mac": 1,
+ "filter_mac": 1,
+ "bvi_mac": 0
+}
+
+# WRONG configuration data - Add L2 FIB entry.
+l2_fib_forward_cfg_wrong_mac = {
+ "phys-address": "WRONG-MAC",
+ "outgoing-interface": "GigabitEthernet0/8/0",
+ "action": "l2-fib-forward"
+}
+
+l2_fib_forward_cfg_wrong_if = {
+ "phys-address": "aa:bb:cc:dd:ee:ff",
+ "outgoing-interface": "WRONG-INTERFACE",
+ "action": "l2-fib-forward"
+}
+
+l2_fib_forward_cfg_wrong_action = {
+ "phys-address": "aa:bb:cc:dd:ee:ff",
+ "outgoing-interface": "GigabitEthernet0/8/0",
+ "action": "WRONG-ACTION"
+}
+
+# Modify L2 FIB entry (forward).
+# Configuration data:
+l2_fib_forward_modified_cfg = {
+ "phys-address": "aa:bb:cc:dd:ee:ff",
+ "outgoing-interface": "GigabitEthernet0/9/0",
+ "action": "l2-fib-forward"
+}
diff --git a/resources/test_data/honeycomb/netconf/hello.py b/resources/test_data/honeycomb/netconf/hello.py
new file mode 100644
index 0000000000..2cc89b387c
--- /dev/null
+++ b/resources/test_data/honeycomb/netconf/hello.py
@@ -0,0 +1,22 @@
+# Copyright (c) 2016 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.
+
+"""Hello message with capabilities list for Netconf sessions."""
+
+hello = u"""
+<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<capabilities>
+<capability>urn:ietf:params:netconf:base:1.0</capability>
+</capabilities>
+</hello>
+]]>]]>""" \ No newline at end of file
diff --git a/resources/test_data/honeycomb/netconf/subscription.py b/resources/test_data/honeycomb/netconf/subscription.py
new file mode 100644
index 0000000000..ccf8c47022
--- /dev/null
+++ b/resources/test_data/honeycomb/netconf/subscription.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2016 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.
+
+"""RPC call to add a subscription to Netconf notifications."""
+
+subscription = u"""
+<netconf:rpc netconf:message-id="101"
+xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
+<create-subscription
+xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
+<stream>honeycomb</stream>
+</create-subscription>
+</netconf:rpc>
+]]>]]>"""
diff --git a/resources/test_data/honeycomb/netconf/triggers.py b/resources/test_data/honeycomb/netconf/triggers.py
new file mode 100644
index 0000000000..77596bd052
--- /dev/null
+++ b/resources/test_data/honeycomb/netconf/triggers.py
@@ -0,0 +1,336 @@
+# Copyright (c) 2016 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.
+
+"""Contains RPC sequences to trigger specific issues through Netconf."""
+
+# Test data for issue: https://jira.fd.io/browse/HONEYCOMB-105
+# Creating and removing interfaces may result in duplicated interface indices.
+trigger_105 = u"""
+<rpc message-id="m-27" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<get-config>
+<source>
+<running/>
+</source>
+<filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
+<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
+<interface>
+<name>4fe335c8-6fdc-4654-b12c-d256e9b39229</name>
+</interface>
+</interfaces>
+</filter>
+</get-config>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-72" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<lock>
+<target>
+<candidate/>
+</target>
+</lock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-38" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<edit-config>
+<target>
+<candidate/>
+</target>
+<default-operation>none</default-operation>
+<config>
+<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
+<interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
+a:operation="replace">
+<name>4fe335c8-6fdc-4654-b12c-d256e9b39229</name>
+<description>neutron port</description>
+<link-up-down-trap-enable>enabled</link-up-down-trap-enable>
+<vhost-user xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
+<role>client</role>
+<socket>/tmp/socket_4fe335c8-6fdc-4654-b12c-d256e9b39229</socket>
+</vhost-user>
+<type xmlns:x="urn:opendaylight:params:xml:ns:yang:v3po">x:vhost-user</type>
+<enabled>true</enabled>
+</interface>
+</interfaces>
+</config>
+</edit-config>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-80" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<commit/>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-74" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<unlock>
+<target>
+<candidate/>
+</target>
+</unlock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-72" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<lock>
+<target>
+<candidate/>
+</target>
+</lock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-43" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<edit-config>
+<target>
+<candidate/>
+</target>
+<default-operation>none</default-operation>
+<config>
+<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
+<interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
+a:operation="delete">
+<name>4fe335c8-6fdc-4654-b12c-d256e9b39229</name>
+</interface>
+</interfaces>
+</config>
+</edit-config>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-80" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<commit/>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-74" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<unlock>
+<target>
+<candidate/>
+</target>
+</unlock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-72" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<lock>
+<target>
+<candidate/>
+</target>
+</lock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-50" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<edit-config>
+<target>
+<candidate/>
+</target>
+<default-operation>none</default-operation>
+<config>
+<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
+<interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
+a:operation="replace">
+<name>4fe335c8-6fdc-4654-b12c-d256e9b39229</name>
+<description>neutron port</description>
+<link-up-down-trap-enable>enabled</link-up-down-trap-enable>
+<vhost-user xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
+<role>client</role>
+<socket>/tmp/socket_4fe335c8-6fdc-4654-b12c-d256e9b39229</socket>
+</vhost-user>
+<type xmlns:x="urn:opendaylight:params:xml:ns:yang:v3po">x:vhost-user</type>
+<enabled>true</enabled>
+</interface>
+</interfaces>
+</config>
+</edit-config>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-80" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<commit/>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-74" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<unlock>
+<target>
+<candidate/>
+</target>
+</unlock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-72" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<lock>
+<target>
+<candidate/>
+</target>
+</lock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-57" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<edit-config>
+<target>
+<candidate/>
+</target>
+<default-operation>none</default-operation>
+<config>
+<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
+<interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
+a:operation="replace">
+<name>d7611278-88ff-40e1-81e2-602e94e96fc7</name>
+<description>neutron port</description>
+<link-up-down-trap-enable>enabled</link-up-down-trap-enable>
+<vhost-user xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
+<role>client</role>
+<socket>/tmp/socket_d7611278-88ff-40e1-81e2-602e94e96fc7</socket>
+</vhost-user>
+<type xmlns:x="urn:opendaylight:params:xml:ns:yang:v3po">x:vhost-user</type>
+<enabled>true</enabled>
+</interface>
+</interfaces>
+</config>
+</edit-config>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-80" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<commit/>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-74" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<unlock>
+<target>
+<candidate/>
+</target>
+</unlock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-72" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<lock>
+<target>
+<candidate/>
+</target>
+</lock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-64" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<edit-config>
+<target>
+<candidate/>
+</target>
+<default-operation>none</default-operation>
+<config>
+<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
+<interface xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
+a:operation="replace">
+<name>1f96a665-4351-4984-b1a8-dc6f54683123</name>
+<description>neutron port</description>
+<link-up-down-trap-enable>enabled</link-up-down-trap-enable>
+<vhost-user xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
+<role>client</role>
+<socket>/tmp/socket_1f96a665-4351-4984-b1a8-dc6f54683123</socket>
+</vhost-user>
+<type xmlns:x="urn:opendaylight:params:xml:ns:yang:v3po">x:vhost-user</type>
+<enabled>true</enabled>
+</interface>
+</interfaces>
+</config>
+</edit-config>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-80" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<commit/>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-74" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<unlock>
+<target>
+<candidate/>
+</target>
+</unlock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-72" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<lock>
+<target>
+<candidate/>
+</target>
+</lock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-72" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<edit-config>
+<target>
+<candidate/>
+</target>
+<default-operation>none</default-operation>
+<config>
+<vpp xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
+<bridge-domains>
+<bridge-domain xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
+a:operation="replace">
+<name>e86740a2-042c-4e64-a43b-cc224e0d5240</name>
+<unknown-unicast-flood>true</unknown-unicast-flood>
+<forward>true</forward>
+<learn>true</learn>
+<flood>true</flood>
+<arp-termination>false</arp-termination>
+</bridge-domain>
+</bridge-domains>
+</vpp>
+</config>
+</edit-config>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-80" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<commit/>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-74" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<unlock>
+<target>
+<candidate/>
+</target>
+</unlock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-72" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<lock>
+<target>
+<candidate/>
+</target>
+</lock>
+</rpc>
+]]>]]>
+
+<rpc message-id="m-75" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+<get>
+<filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
+<interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"/>
+</filter>
+</get>
+</rpc>
+]]>]]>"""
diff --git a/resources/test_data/honeycomb/persistence.py b/resources/test_data/honeycomb/persistence.py
new file mode 100644
index 0000000000..f46cfba597
--- /dev/null
+++ b/resources/test_data/honeycomb/persistence.py
@@ -0,0 +1,138 @@
+# Copyright (c) 2016 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.
+
+"""Test variables for Honeycomb persistence test suite."""
+
+
+def get_variables(interface):
+ """Creates and returns dictionary of test variables.
+
+ :param interface: name of super-interface for the tested sub-interface
+ :type interface: str
+ :return: dictionary of test variables
+ :rtype: dict
+ """
+ # basic settings
+ bd_name = 'bd_persist'
+ sub_if_id = 1
+ sub_if_name = interface + '.' + str(sub_if_id)
+
+ variables = {
+ # VxLan settings
+ 'vx_interface': 'vx_tunnel_test',
+ 'vxlan_settings': {'src': '192.168.0.2',
+ 'dst': '192.168.0.3',
+ "vni": 88,
+ 'encap-vrf-id': 0},
+ # bridge domain settings
+ 'bd_name': bd_name,
+ 'bd_settings': {'flood': True,
+ 'forward': True,
+ 'learn': True,
+ 'unknown-unicast-flood': True,
+ 'arp-termination': True
+ },
+ # tap interface settings
+ 'tap_interface': 'tap_test',
+ 'tap_settings': {'tap-name': 'tap_test',
+ 'mac': '08:00:27:c0:5d:37',
+ 'device-instance': 1
+ },
+ # vhost-user interface settings
+ 'vhost_interface': 'test_vhost',
+ 'vhost_user_server': {'socket': 'soc1',
+ 'role': 'server'
+ },
+ # Vlan subinterface settings
+ 'sub_if_id': sub_if_id,
+ 'sub_if_name': sub_if_name,
+ 'sub_if_1_settings': {
+ "identifier": sub_if_id,
+ "vlan-type": "802dot1q",
+ "enabled": "false"
+ },
+ 'sub_if_1_tags': [
+ {
+ "index": "0",
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:s-vlan",
+ "vlan-id": "100"
+ }
+ },
+ {
+ "index": "1",
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:c-vlan",
+ "vlan-id": "any"
+ }
+ }
+ ],
+ 'sub_if_1_match': "vlan-tagged-exact-match",
+ 'sub_if_1_oper': {
+ "identifier": sub_if_id,
+ "oper-status": "up",
+ "admin-status": "up",
+ "tags": {
+ "tag": [
+ {
+ "index": 1,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:c-vlan",
+ "vlan-id": "any"
+ }
+ },
+ {
+ "index": 0,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:s-vlan",
+ "vlan-id": "100"
+ }
+ }
+ ]
+ },
+ "match": {
+ "vlan-tagged": {
+ "match-exact-tags": False
+ }
+ }
+ },
+ 'sub_bd_settings': {
+ 'bridge-domain': bd_name,
+ 'split-horizon-group': '1',
+ 'bridged-virtual-interface': 'False'
+ },
+ 'tag_rewrite_pop_1': {
+ "pop-tags": "1"
+ },
+
+ 'tag_rewrite_pop_1_oper': {
+ "vlan-type": "vpp-vlan:802dot1ad",
+ "pop-tags": 1
+ },
+
+ 'tag_rewrite_pop_1_VAT': {
+ 'sub_default': 0,
+ 'sub_dot1ad': 0,
+ 'sub_exact_match': 0,
+ 'sub_inner_vlan_id': 0,
+ 'sub_inner_vlan_id_any': 1,
+ 'sub_number_of_tags': 2,
+ 'sub_outer_vlan_id': 100,
+ 'sub_outer_vlan_id_any': 0,
+ 'vtr_op': 3,
+ 'vtr_push_dot1q': 0,
+ 'vtr_tag1': 0,
+ 'vtr_tag2': 0
+ }
+ }
+ return variables
diff --git a/resources/test_data/honeycomb/sub_interfaces.py b/resources/test_data/honeycomb/sub_interfaces.py
new file mode 100644
index 0000000000..6904b48015
--- /dev/null
+++ b/resources/test_data/honeycomb/sub_interfaces.py
@@ -0,0 +1,287 @@
+# Copyright (c) 2016 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.
+
+"""Test variables for Honeycomb sub-interface test suite."""
+
+# Sub-interface 1 and its settings:
+sub_if_1_settings = {
+ "identifier": "1",
+ "vlan-type": "802dot1q",
+ "enabled": "false"
+}
+
+sub_if_1_tags = [
+ {
+ "index": "0",
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:s-vlan",
+ "vlan-id": "100"
+ }
+ },
+ {
+ "index": "1",
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:c-vlan",
+ "vlan-id": "any"
+ }
+ }
+]
+
+sub_if_1_match = "vlan-tagged-exact-match"
+
+# Expected operational data: sub-interface.
+sub_if_1_oper = {
+ "identifier": 1,
+ "oper-status": "down",
+ "admin-status": "down",
+ "tags": {
+ "tag": [
+ {
+ "index": 1,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:c-vlan",
+ "vlan-id": "any"
+ }
+ },
+ {
+ "index": 0,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:s-vlan",
+ "vlan-id": "100"
+ }
+ }
+ ]
+ },
+ "match": {
+ "vlan-tagged": {
+ "match-exact-tags": False
+ }
+ }
+}
+
+# Bridge domain name.
+bd_name = 'test-sub-bd'
+
+# Bridge domain settings used while creating a test bridge domain.
+bd_settings = {
+ 'flood': True,
+ 'forward': True,
+ 'learn': True,
+ 'unknown-unicast-flood': True,
+ 'arp-termination': True
+}
+
+# Bridge domain configuration used while adding the sub-interface to the bridge
+# domain.
+sub_bd_settings = {
+ 'bridge-domain': bd_name,
+ 'split-horizon-group': 1,
+ 'bridged-virtual-interface': False
+}
+
+# Configuration data: Enable tag-rewrite push.
+tag_rewrite_push = {
+ "vlan-type": "vpp-vlan:802dot1q",
+ "push-tags": [
+ {
+ "index": 0,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:s-vlan",
+ "vlan-id":123
+ }
+ },
+ {
+ "index": 1,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:c-vlan",
+ "vlan-id": 456
+ }
+ }
+ ]
+}
+
+# Expected operational data: tag-rewrite push.
+tag_rewrite_push_oper = {
+ "vlan-type": "vpp-vlan:802dot1q",
+ "push-tags": [
+ {
+ "index": 1,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:c-vlan",
+ "vlan-id": 456
+ }
+ },
+ {
+ "index": 0,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:s-vlan",
+ "vlan-id": 123
+ }
+ }
+ ]
+}
+
+# Expected VAT data: tag-rewrite push.
+tag_rewrite_push_VAT = {
+ 'sub_default': 0,
+ 'sub_dot1ad': 0,
+ 'sub_exact_match': 0,
+ 'sub_inner_vlan_id': 0,
+ 'sub_inner_vlan_id_any': 1,
+ 'sub_number_of_tags': 2,
+ 'sub_outer_vlan_id': 100,
+ 'sub_outer_vlan_id_any': 0,
+ 'vtr_op': 2,
+ 'vtr_push_dot1q': 1,
+ 'vtr_tag1': 123,
+ 'vtr_tag2': 456
+}
+
+# Configuration data: Enable tag-rewrite pop 1.
+tag_rewrite_pop_1 = {
+ "pop-tags": "1"
+}
+
+# Expected operational data: tag-rewrite pop 1.
+tag_rewrite_pop_1_oper = {
+ "vlan-type": "vpp-vlan:802dot1ad",
+ "pop-tags": 1
+}
+
+# Expected VAT data: tag-rewrite pop 1.
+tag_rewrite_pop_1_VAT = {
+ 'sub_default': 0,
+ 'sub_dot1ad': 0,
+ 'sub_exact_match': 0,
+ 'sub_inner_vlan_id': 0,
+ 'sub_inner_vlan_id_any': 1,
+ 'sub_number_of_tags': 2,
+ 'sub_outer_vlan_id': 100,
+ 'sub_outer_vlan_id_any': 0,
+ 'vtr_op': 3,
+ 'vtr_push_dot1q': 0,
+ 'vtr_tag1': 0,
+ 'vtr_tag2': 0
+}
+
+# Configuration data: Enable tag-rewrite translate 1-2.
+tag_rewrite_translate_1_2 = {
+ "vlan-type": "vpp-vlan:802dot1q",
+ "pop-tags": "1",
+ "push-tags": [
+ {
+ "index": 0,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:s-vlan",
+ "vlan-id": 111
+ }
+ },
+ {
+ "index": 1,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:c-vlan",
+ "vlan-id": 222
+ }
+ }
+ ]
+}
+
+# Expected operational data: tag-rewrite translate 1-2.
+tag_rewrite_translate_1_2_oper = {
+ "vlan-type": "vpp-vlan:802dot1q",
+ "pop-tags": 1,
+ "push-tags": [
+ {
+ "index": 1,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:c-vlan",
+ "vlan-id": 222
+ }
+ },
+ {
+ "index": 0,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:s-vlan",
+ "vlan-id": 111
+ }
+ }
+ ]
+}
+
+# Expected VAT data: tag-rewrite translate 1-2.
+tag_rewrite_translate_1_2_VAT = {
+ 'sub_default': 0,
+ 'sub_dot1ad': 0,
+ 'sub_exact_match': 0,
+ 'sub_inner_vlan_id': 0,
+ 'sub_inner_vlan_id_any': 1,
+ 'sub_number_of_tags': 2,
+ 'sub_outer_vlan_id': 100,
+ 'sub_outer_vlan_id_any': 0,
+ 'vtr_op': 6,
+ 'vtr_push_dot1q': 1,
+ 'vtr_tag1': 111,
+ 'vtr_tag2': 222
+}
+
+# Configuration data: Disable tag-rewrite.
+tag_rewrite_disabled = {}
+
+# Expected VAT data: Disable tag-rewrite.
+tag_rewrite_disabled_VAT = {
+ 'sub_default': 0,
+ 'sub_dot1ad': 0,
+ 'sub_exact_match': 0,
+ 'sub_inner_vlan_id': 0,
+ 'sub_inner_vlan_id_any': 1,
+ 'sub_number_of_tags': 2,
+ 'sub_outer_vlan_id': 100,
+ 'sub_outer_vlan_id_any': 0,
+ 'vtr_op': 0,
+ 'vtr_push_dot1q': 0,
+ 'vtr_tag1': 0,
+ 'vtr_tag2': 0
+}
+
+# Configuration data:
+# Wrong vlan-type for enable tag-rewrite translate 1-2.
+tag_rewrite_translate_1_2_wrong = {
+ "vlan-type": "vpp-vlan:WRONG",
+ "pop-tags": "1",
+ "push-tags": [
+ {
+ "index": 0,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:s-vlan",
+ "vlan-id": 111
+ }
+ },
+ {
+ "index": 1,
+ "dot1q-tag": {
+ "tag-type": "dot1q-types:c-vlan",
+ "vlan-id": 222
+ }
+ }
+ ]
+}
+
+# IP addresses configured on sub-interface during tests
+ipv4 = {
+ "address": "192.168.0.4",
+ "netmask": "255.255.255.0",
+ "prefix-length": 24}
+ipv4_2 = {
+ "address": "192.168.0.5",
+ "netmask": "255.255.0.0",
+ "prefix-length": 16}
diff --git a/resources/test_data/honeycomb/vxlan.py b/resources/test_data/honeycomb/vxlan.py
new file mode 100644
index 0000000000..43307aa61a
--- /dev/null
+++ b/resources/test_data/honeycomb/vxlan.py
@@ -0,0 +1,28 @@
+# Copyright (c) 2016 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.
+
+"""Test variables for Honeycomb VxLAN management test suite."""
+
+# invalid VxLAN settings
+vxlan_invalid = [
+ # same source and destination IPs
+ {'src': '192.168.0.2', 'dst': '192.168.0.2', 'vni': 88, 'encap-vrf-id': 0},
+ # missing source
+ {'dst': '192.168.0.2', 'vni': 88, 'encap-vrf-id': 0},
+ # missing destination
+ {'src': '192.168.0.2', 'vni': 88, 'encap-vrf-id': 0},
+ # missing vni
+ {'src': '192.168.0.2', 'dst': '192.168.0.3', 'encap-vrf-id': 0},
+ # missing encap id
+ {'src': '192.168.0.2', 'dst': '192.168.0.3', 'vni': 88}
+]
diff --git a/resources/test_data/honeycomb/vxlan_gpe.py b/resources/test_data/honeycomb/vxlan_gpe.py
new file mode 100644
index 0000000000..308cd0a316
--- /dev/null
+++ b/resources/test_data/honeycomb/vxlan_gpe.py
@@ -0,0 +1,99 @@
+# Copyright (c) 2016 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.
+
+"""Test variables for Honeycomb VxLAN GPE management test suite."""
+
+# The first VxLAN GPE Interface used in tests.
+vxlan_gpe_if1 = 'vxlan_gpe_tunnel0'
+vxlan_gpe_base_settings = {
+ 'name': vxlan_gpe_if1,
+ 'description': 'for testing purposes',
+ 'enabled': True,
+ 'link-up-down-trap-enable': 'enabled'
+}
+vxlan_gpe_settings = {
+ 'local': '192.168.50.76',
+ 'remote': '192.168.50.71',
+ 'vni': 9,
+ 'next-protocol': 'ipv4',
+ 'encap-vrf-id': 0,
+ 'decap-vrf-id': 0
+}
+
+# The values of parameters of disabled VxLAN GPE interface.
+vxlan_gpe_disabled_base_settings = {
+ 'name': vxlan_gpe_if1,
+ 'description': 'for testing purposes',
+ 'enabled': 'false'
+}
+
+# Wrong interface type.
+vxlan_gpe_if2 = 'vxlan_gpe_tunnel1'
+vxlan_gpe_wrong_type_base_settings = {
+ 'name': vxlan_gpe_if2,
+ 'type': 'iana-if-type:ethernetCsmacd',
+ 'description': 'for testing purposes',
+ 'enabled': True,
+ 'link-up-down-trap-enable': 'enabled'
+}
+
+# Wrong next-protocol value.
+vxlan_gpe_if3 = 'vxlan_gpe_tunnel1'
+vxlan_gpe_wrong_protocol_base_settings = {
+ 'name': vxlan_gpe_if3,
+ 'description': 'for testing purposes',
+ 'enabled': 'true',
+ 'link-up-down-trap-enable': 'enabled'
+}
+vxlan_gpe_wrong_protocol_settings = {
+ 'local': '192.168.50.77',
+ 'remote': '192.168.50.72',
+ 'vni': 9,
+ 'next-protocol': 'wrong_ipv4',
+ 'encap-vrf-id': 0,
+ 'decap-vrf-id': 0
+}
+
+# The first IPv6 VxLAN GPE interface.
+vxlan_gpe_if5 = 'vxlan_gpe_tunnel0'
+vxlan_gpe_base_ipv6_settings = {
+ 'name': vxlan_gpe_if5,
+ 'description': 'for testing purposes',
+ 'enabled': True,
+ 'link-up-down-trap-enable': 'enabled'
+}
+vxlan_gpe_ipv6_settings = {
+ 'local': '10:10:10:10:10:10:10:10',
+ 'remote': '10:10:10:10:10:10:10:11',
+ 'vni': 9,
+ 'next-protocol':'ipv4',
+ 'encap-vrf-id': 0,
+ 'decap-vrf-id': 0
+}
+
+# The second IPv6 VxLAN GPE interface.
+vxlan_gpe_if6 = 'vxlan_gpe_tunnel1'
+vxlan_gpe_base_ipv6_settings2 = {
+ 'name': vxlan_gpe_if6,
+ 'description': 'for testing purposes',
+ 'enabled': True,
+ 'link-up-down-trap-enable': 'enabled'
+}
+vxlan_gpe_ipv6_settings2 = {
+ 'local': '10:10:10:10:10:10:10:20',
+ 'remote': '10:10:10:10:10:10:10:21',
+ 'vni': 9,
+ 'next-protocol': 'ipv4',
+ 'encap-vrf-id': 0,
+ 'decap-vrf-id': 0
+}