import fileinput
import os
import re
-import shutil
import sys
import urlparse
res_dir = '/home/opnfv/functest/results/odl/'
logger = ft_logger.Logger("opendaylight").getLogger()
- @classmethod
- def copy_opnf_testcases(cls):
- opnfv_testcases_dir = (os.path.dirname(os.path.abspath(__file__)) +
- "/custom_tests/neutron/")
- file = opnfv_testcases_dir + "001__reachability.robot"
- try:
- shutil.copy(file, cls.neutron_suite_dir)
- except IOError as e:
- cls.logger.error(
- "Cannot copy OPNFV's testcase to ODL directory: %s" % str(e))
- return False
- return True
-
@classmethod
def set_robotframework_vars(cls, odlusername="admin", odlpassword="admin"):
odl_variables_files = cls.odl_test_repo + 'csit/variables/Variables.py'
cls.logger.error("Cannot run ODL testcases. Please check "
"%s" % str(e))
return False
- if (cls.copy_opnf_testcases() and
- cls.set_robotframework_vars(odlusername, odlpassword)):
+ if cls.set_robotframework_vars(odlusername, odlpassword):
try:
os.makedirs(cls.res_dir)
except OSError:
+++ /dev/null
-*** Variables ***
-${NeutronNorthbound} /controller/nb/v2/neutron
-${NetworkNorthbound} ${NeutronNorthbound}/networks
-${SubnetNorthbound} ${NeutronNorthbound}/subnets
-${PortNorthbound} ${NeutronNorthbound}/ports
-
-*** Settings ***
-Suite Setup Create Session ODL http://${ODL_SYSTEM_IP}:${PORT} headers=${HEADERS} auth=${AUTH}
-Suite Teardown Delete All Sessions
-Library RequestsLibrary
-Variables ../../../variables/Variables.py
-
-*** Test Cases ***
-Get the complete list of networks
- [Documentation] Get the complete list of networks
- [Tags] reachability
- ${resp} get request ODL ${NetworkNorthbound}
- Should be Equal As Strings ${resp.status_code} 200
-
-Get the complete list of subnets
- [Documentation] Get the complete list of subnets
- [Tags] reachability
- ${resp} get request ODL ${SubnetNorthbound}
- Should be Equal As Strings ${resp.status_code} 200
-
-Get the complete list of ports
- [Documentation] Get the complete list of ports
- [Tags] reachability
- ${resp} get request ODL ${PortNorthbound}
- Should be Equal As Strings ${resp.status_code} 200