#!/usr/bin/python
+# SPDX-License-Identifier: ISC
#
# Copyright (c) 2021 by VMware, Inc. ("VMware")
# Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
# ("NetDEF") in this file.
#
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
"""OSPF Summarisation Functionality Automation."""
step("Verify that show ip ospf summary should show the summaries.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("show ip ospf summary should not have any summary address.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("Verify that show ip ospf summary should show the summaries.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
input_dict = {
"2011::/16": {
- "Summary address": "2011::/16",
- "Metric-type": "E2",
+ "summaryAddress": "2011::/16",
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
input_dict = {
"2011::/32": {
- "Summary address": "2011::/32",
- "Metric-type": "E2",
+ "summaryAddress": "2011::/32",
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 0,
+ "externalRouteCount": 0,
}
}
dut = "r0"
step("Verify that show ip ospf summary should show the summaries with tag.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 1234,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("show ip ospf summary should not have any summary address.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 1234,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("Verify that show ip ospf summary should show the summaries with tag.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 1,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
)
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 4294967295,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
)
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 88888,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("Verify that show ip ospf summary should show the summaries with tag.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 1234,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("show ip ospf summary should not have any summary address.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 1234,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("Verify that show ip ospf summary should show the summaries with tag.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 1,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
)
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 4294967295,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
)
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 88888,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("Verify that show ip ospf summary should show the " "configured summaries.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "External route count": 5,
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("show ip ospf summary should not have any summary address.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 1234,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("Verify that show ip ospf summary should show the " "configured summaries.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "External route count": 5,
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("Verify that show ip ospf summary should show the summaries.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("Verify that show ip ospf summary should show the summaries.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
)
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
)
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
input_dict = {
SUMMARY["ipv6"][3]: {
- "Summary address": SUMMARY["ipv6"][3],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][3],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 0,
+ "externalRouteCount": 0,
}
}
dut = "r0"
step("Verify that show ip ospf summary should show the summaries.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"
step("Verify that show ip ospf summary should show the summaries.")
input_dict = {
SUMMARY["ipv6"][0]: {
- "Summary address": SUMMARY["ipv6"][0],
- "Metric-type": "E2",
+ "summaryAddress": SUMMARY["ipv6"][0],
+ "metricType": "E2",
"Metric": 20,
"Tag": 0,
- "External route count": 5,
+ "externalRouteCount": 5,
}
}
dut = "r0"