-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 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:
from robot.libraries.BuiltIn import BuiltIn, RobotNotRunningError
from robot.api.deco import keyword
-__all__ = ["DICT__nodes", 'Topology']
+__all__ = ["DICT__nodes", 'Topology', 'NodeType']
def load_topo_from_yaml():
:type nodes: dict
:returns: Nothing
"""
- port_types = ('subinterface', 'vlan_subif', 'memif', 'tap', 'vhost',
+ port_types = ('subinterface', 'vlan_subif', 'memif', 'tap', 'vhost',
'loopback', 'gre_tunnel', 'vxlan_tunnel')
for node_data in nodes.values():
"""
return node['host']
+ @staticmethod
+ def get_node_arch(node):
+ """Return arch of the node.
+ Default to x86_64 if no arch present
+
+ :param node: Node created from topology.
+ :type node: dict
+ :returns: Node architecture
+ :rtype: str
+ """
+ try:
+ return node['arch']
+ except KeyError:
+ node['arch'] = 'x86_64'
+ return 'x86_64'
+
@staticmethod
def get_cryptodev(node):
"""Return Crytodev configuration of the node.