Remove variables.py 23/71823/2
authorTomas Markovic <tomas.markovic@pantheon.tech>
Mon, 7 May 2018 08:47:46 +0000 (10:47 +0200)
committerTomas Markovic <tomas.markovic@pantheon.tech>
Mon, 7 May 2018 09:32:54 +0000 (11:32 +0200)
In flowspec it's not necessary,
and now we can safely delete it.

Change-Id: I1d82db0fc57cf55259326434e6667118071a0b60
Signed-off-by: Tomas Markovic <tomas.markovic@pantheon.tech>
csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot
csit/variables/bgpuser/empty.json [deleted file]
csit/variables/bgpuser/filled.json [deleted file]
csit/variables/bgpuser/variables.py [deleted file]

index 6e9317810877e59ed1b62abef035849129a80893..3841ef5be22ad21b79a5ee6a9ac64d20452540c7 100644 (file)
@@ -10,7 +10,6 @@ Suite Setup       Start Suite
 Suite Teardown    Stop Suite
 Library           RequestsLibrary
 Library           SSHLibrary
-Variables         ../../../variables/bgpuser/variables.py    ${TOOLS_SYSTEM_IP}    ${ODL_STREAM}
 Resource          ../../../libraries/ExaBgpLib.robot
 Resource          ../../../libraries/SetupUtils.robot
 Resource          ../../../libraries/SSHKeywords.robot
@@ -68,12 +67,8 @@ Start Suite
     ${mininet_conn_id}=    SSHLibrary.Open Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=6s
     Builtin.Set Suite Variable    ${mininet_conn_id}
     SSHKeywords.Flexible Mininet Login    ${TOOLS_SYSTEM_USER}
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    ls    return_stdout=True    return_stderr=True
-    ...    return_rc=True
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    sudo apt-get install -y python-pip    return_stdout=True    return_stderr=True
-    ...    return_rc=True
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    sudo pip install exabgp    return_stdout=True    return_stderr=True
-    ...    return_rc=True
+    SSHKeywords.Virtual_Env_Create
+    SSHKeywords.Virtual_Env_Install_Package    exabgp==3.4.16
     RequestsLibrary.Create Session    ${CONFIG_SESSION}    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
     Upload Config Files    ${CURDIR}/../../../variables/bgpflowspec/
 
diff --git a/csit/variables/bgpuser/empty.json b/csit/variables/bgpuser/empty.json
deleted file mode 100644 (file)
index 5189eec..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "topology": [
-  {
-   "server-provided": true,
-   "topology-id": "example-ipv4-topology",
-   "topology-types": $TOPOLOGY_TYPES
-  }
- ]
-}
diff --git a/csit/variables/bgpuser/filled.json b/csit/variables/bgpuser/filled.json
deleted file mode 100644 (file)
index 0c5876f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "topology": [
-  {
-   "node": [
-    {
-     "l3-unicast-igp-topology:igp-node-attributes": {
-      "prefix": [
-       {
-        "prefix": "8.0.1.0/28"
-       },
-       {
-        "prefix": "8.0.1.16/28"
-       },
-       {
-        "prefix": "8.0.1.32/28"
-       }
-      ]
-     },
-     "node-id": "192.0.2.1"
-    }
-   ],
-   "server-provided": true,
-   "topology-id": "example-ipv4-topology",
-   "topology-types": $TOPOLOGY_TYPES
-  }
- ]
-}
diff --git a/csit/variables/bgpuser/variables.py b/csit/variables/bgpuser/variables.py
deleted file mode 100644 (file)
index ffa9821..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-"""Variables file for data loaded from a file.
-
-Stuff like JSON topology outputs and the like
-are fairly long, therefore to improve clarity these
-are moved out of the testcase file to their own files.
-This module then allows the robot framework suite to
-read the file contents and access it as values of variables."""
-# Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-
-import os
-import string
-
-
-__author__ = "Jozef Behran"
-__copyright__ = "Copyright(c) 2015, Cisco Systems, Inc."
-__license__ = "Eclipse Public License v1.0"
-__email__ = "jbehran@cisco.com"
-
-
-def _get_stream_specific_dict(mininet_ip, stream):
-    """Returns the dict which will be used for the data substitution."""
-    def _get_topology_types(stream):
-        if stream in ['stable-lithium', 'beryllium']:
-            return '{}'
-        else:
-            return '{"odl-bgp-topology-types:bgp-ipv4-reachability-topology": {}}'
-
-    subs_dict = {"IP": mininet_ip}
-    subs_dict["TOPOLOGY_TYPES"] = _get_topology_types(stream)
-    return subs_dict
-
-
-def get_variables(mininet_ip, stream):
-    """Return dict of variables keyed by the (dot-less) names of files.
-
-    Directory where data files are located is the same as where this file is located.
-    Every dot in file name is replaced by underscore, so that
-    name of the variable is not interpreted as attribute access.
-    Replacements may create collisions, so detect them."""
-    variables = {}
-    subs_dict = _get_stream_specific_dict(mininet_ip, stream)
-    this_dir = os.path.dirname(os.path.abspath(__file__))
-    filename_list = ["empty.json", "filled.json"]
-    for file_basename in filename_list:
-        variable_name = file_basename.replace('.', '_')
-        if variable_name in variables:
-            raise KeyError("Variable " + variable_name + " already exists.")
-        file_fullname = this_dir + "/" + file_basename
-        data_template = string.Template(open(file_fullname).read())
-        variables[variable_name] = data_template.substitute(subs_dict)
-    return variables