summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--setup.py33
-rw-r--r--sfc/__init__.py (renamed from tests/__init__.py)0
-rw-r--r--sfc/lib/__init__.py0
-rw-r--r--sfc/lib/config.py (renamed from tests/functest/odl-sfc/config.py)13
-rw-r--r--sfc/lib/results.py (renamed from tests/functest/odl-sfc/results.py)0
-rw-r--r--sfc/lib/utils.py (renamed from tests/functest/odl-sfc/utils.py)15
-rw-r--r--sfc/tests/NAME_tests.py (renamed from tests/NAME_tests.py)0
-rw-r--r--sfc/tests/__init__.py0
-rw-r--r--sfc/tests/functest/README.sfc-test-2 (renamed from tests/functest/odl-sfc/README.sfc-test-2)0
-rw-r--r--sfc/tests/functest/__init__.py0
-rw-r--r--sfc/tests/functest/config.yaml (renamed from tests/functest/odl-sfc/config.yaml)0
-rw-r--r--sfc/tests/functest/run_tests.py (renamed from tests/functest/odl-sfc/run_tests.py)7
-rw-r--r--sfc/tests/functest/setup_scripts/__init__.py0
-rw-r--r--[-rwxr-xr-x]sfc/tests/functest/setup_scripts/compute_presetup_CI.bash (renamed from tests/functest/odl-sfc/setup_scripts/compute_presetup_CI.bash)0
-rw-r--r--[-rwxr-xr-x]sfc/tests/functest/setup_scripts/delete.sh (renamed from tests/functest/odl-sfc/setup_scripts/delete.sh)2
-rw-r--r--[-rwxr-xr-x]sfc/tests/functest/setup_scripts/prepare_odl_sfc.py (renamed from tests/functest/odl-sfc/prepare_odl_sfc.py)4
-rw-r--r--[-rwxr-xr-x]sfc/tests/functest/setup_scripts/server_presetup_CI.bash (renamed from tests/functest/odl-sfc/setup_scripts/server_presetup_CI.bash)0
-rw-r--r--[-rwxr-xr-x]sfc/tests/functest/setup_scripts/tacker_client_install.sh (renamed from tests/functest/odl-sfc/setup_scripts/tacker_client_install.sh)0
-rw-r--r--[-rwxr-xr-x]sfc/tests/functest/sfc.py (renamed from tests/functest/odl-sfc/sfc.py)19
-rw-r--r--[-rwxr-xr-x]sfc/tests/functest/sfc_one_chain_two_service_functions_different_computes.py (renamed from tests/functest/odl-sfc/sfc_one_chain_two_service_functions_different_computes.py)19
-rw-r--r--[-rwxr-xr-x]sfc/tests/functest/sfc_tacker_test2.bash (renamed from tests/functest/odl-sfc/sfc_tacker_test2.bash)0
-rw-r--r--sfc/tests/functest/vnfd-templates/test-vnfd1.yaml (renamed from tests/functest/odl-sfc/vnfd-templates/test-vnfd1.yaml)0
-rw-r--r--sfc/tests/functest/vnfd-templates/test-vnfd2.yaml (renamed from tests/functest/odl-sfc/vnfd-templates/test-vnfd2.yaml)0
-rw-r--r--sfc/tests/functest/vnfd-templates/test2-vnfd1.yaml (renamed from tests/functest/odl-sfc/vnfd-templates/test2-vnfd1.yaml)0
-rw-r--r--sfc/tests/functest/vnfd-templates/test2-vnfd2.yaml (renamed from tests/functest/odl-sfc/vnfd-templates/test2-vnfd2.yaml)0
-rwxr-xr-xtests/functest/odl-sfc/setup_scripts/prepare_odl_sfc.py90
26 files changed, 75 insertions, 127 deletions
diff --git a/setup.py b/setup.py
index e602f9f6..07de7888 100644
--- a/setup.py
+++ b/setup.py
@@ -1,25 +1,20 @@
-import os
-from setuptools import setup
+##############################################################################
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
-# Utility function to read the README file.
-# Used for the long_description. It's nice, because now 1) we have a top level
-# README file and 2) it's easier to type in the README file than to put a raw
-# string in below ...
+from setuptools import setup, find_packages
-def read(fname):
- return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
- name="vnf manager simulator",
- version="1.0",
- author="Manuel Buil, Brady A. Johnson",
- author_email="manuel.buil@ericsson.com, brady.allen.johnson@ericsson.com",
- description=("A script which simulates an orchestrator"),
- license="Apache License Version 2.0",
- keywords="example documentation tutorial",
- url="https://gerrit.opnfv.org/gerrit/#/c/2519",
- packages=[".."],
- scripts=[".."],
- long_description=read('README'),
+ name="sfc",
+ version="danube",
+ packages=find_packages(),
+ include_package_data=True,
+ package_data={
+ },
+ url="https://www.opnfv.org"
)
diff --git a/tests/__init__.py b/sfc/__init__.py
index e69de29b..e69de29b 100644
--- a/tests/__init__.py
+++ b/sfc/__init__.py
diff --git a/sfc/lib/__init__.py b/sfc/lib/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/sfc/lib/__init__.py
diff --git a/tests/functest/odl-sfc/config.py b/sfc/lib/config.py
index 3b76e3bc..97fa9122 100644
--- a/tests/functest/odl-sfc/config.py
+++ b/sfc/lib/config.py
@@ -1,3 +1,13 @@
+#!/usr/bin/python
+#
+# Copyright (c) 2016 All rights reserved
+# This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
import yaml
import os
@@ -17,8 +27,7 @@ class CommonConfig(object):
self.line_length = 30
self.test_db = ft_utils.get_functest_config("results.test_db_url")
self.repo_path = ft_constants.SFC_REPO_DIR
- self.sfc_test_dir = os.path.join(self.repo_path, "tests",
- "functest", "odl-sfc")
+ self.sfc_test_dir = os.path.join(self.repo_path, "tests", "functest")
self.vnfd_dir = os.path.join(self.sfc_test_dir, "vnfd-templates")
self.functest_results_dir = os.path.join(
ft_constants.FUNCTEST_RESULTS_DIR, "odl-sfc")
diff --git a/tests/functest/odl-sfc/results.py b/sfc/lib/results.py
index 5fa9aa05..5fa9aa05 100644
--- a/tests/functest/odl-sfc/results.py
+++ b/sfc/lib/results.py
diff --git a/tests/functest/odl-sfc/utils.py b/sfc/lib/utils.py
index b4e40622..00f98985 100644
--- a/tests/functest/odl-sfc/utils.py
+++ b/sfc/lib/utils.py
@@ -1,11 +1,22 @@
+#!/usr/bin/python
+#
+# Copyright (c) 2016 All rights reserved
+# This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+import json
import os
+import re
import subprocess
import time
+
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
-import re
-import json
import opnfv.utils.SSHUtils as ssh_utils
diff --git a/tests/NAME_tests.py b/sfc/tests/NAME_tests.py
index e95004bc..e95004bc 100644
--- a/tests/NAME_tests.py
+++ b/sfc/tests/NAME_tests.py
diff --git a/sfc/tests/__init__.py b/sfc/tests/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/sfc/tests/__init__.py
diff --git a/tests/functest/odl-sfc/README.sfc-test-2 b/sfc/tests/functest/README.sfc-test-2
index 5a9f2ebe..5a9f2ebe 100644
--- a/tests/functest/odl-sfc/README.sfc-test-2
+++ b/sfc/tests/functest/README.sfc-test-2
diff --git a/sfc/tests/functest/__init__.py b/sfc/tests/functest/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/sfc/tests/functest/__init__.py
diff --git a/tests/functest/odl-sfc/config.yaml b/sfc/tests/functest/config.yaml
index 78cf42fb..78cf42fb 100644
--- a/tests/functest/odl-sfc/config.yaml
+++ b/sfc/tests/functest/config.yaml
diff --git a/tests/functest/odl-sfc/run_tests.py b/sfc/tests/functest/run_tests.py
index cb96c206..e66e4c11 100644
--- a/tests/functest/odl-sfc/run_tests.py
+++ b/sfc/tests/functest/run_tests.py
@@ -14,12 +14,13 @@ import importlib
import os
import sys
import time
-import opnfv.utils.ovs_logger as ovs_log
+import yaml
+
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
-import yaml
-import utils
+import opnfv.utils.ovs_logger as ovs_log
import opnfv.utils.SSHUtils as ssh_utils
+import sfc.lib.utils as utils
parser = argparse.ArgumentParser()
diff --git a/sfc/tests/functest/setup_scripts/__init__.py b/sfc/tests/functest/setup_scripts/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/sfc/tests/functest/setup_scripts/__init__.py
diff --git a/tests/functest/odl-sfc/setup_scripts/compute_presetup_CI.bash b/sfc/tests/functest/setup_scripts/compute_presetup_CI.bash
index 36148aa1..36148aa1 100755..100644
--- a/tests/functest/odl-sfc/setup_scripts/compute_presetup_CI.bash
+++ b/sfc/tests/functest/setup_scripts/compute_presetup_CI.bash
diff --git a/tests/functest/odl-sfc/setup_scripts/delete.sh b/sfc/tests/functest/setup_scripts/delete.sh
index 3da36148..2c9de04b 100755..100644
--- a/tests/functest/odl-sfc/setup_scripts/delete.sh
+++ b/sfc/tests/functest/setup_scripts/delete.sh
@@ -1,4 +1,4 @@
-source ${repos_dir}/sfc/tests/functest/odl-sfc/tackerc
+source ${repos_dir}/sfc/sfc/tests/functest/tackerc
tacker sfc-classifier-delete red_http
tacker sfc-classifier-delete blue_ssh
tacker sfc-classifier-delete red_ssh
diff --git a/tests/functest/odl-sfc/prepare_odl_sfc.py b/sfc/tests/functest/setup_scripts/prepare_odl_sfc.py
index c3162cba..280977bf 100755..100644
--- a/tests/functest/odl-sfc/prepare_odl_sfc.py
+++ b/sfc/tests/functest/setup_scripts/prepare_odl_sfc.py
@@ -26,9 +26,9 @@ except:
logger.debug("INSTALLER_IP does not exist. We create 10.20.0.2")
INSTALLER_IP = "10.20.0.2"
-os.environ['ODL_SFC_LOG'] = "/home/opnfv/functest/results/odl-sfc.log"
+os.environ['ODL_SFC_LOG'] = "/home/opnfv/functest/results/sfc.log"
os.environ['ODL_SFC_DIR'] = os.path.join(SFC_REPO_DIR,
- "tests/functest/odl-sfc")
+ "sfc/tests/functest")
SETUP_SCRIPTS_DIR = os.path.join(os.environ['ODL_SFC_DIR'], 'setup_scripts')
command = SETUP_SCRIPTS_DIR + ("/server_presetup_CI.bash | "
diff --git a/tests/functest/odl-sfc/setup_scripts/server_presetup_CI.bash b/sfc/tests/functest/setup_scripts/server_presetup_CI.bash
index 240353f5..240353f5 100755..100644
--- a/tests/functest/odl-sfc/setup_scripts/server_presetup_CI.bash
+++ b/sfc/tests/functest/setup_scripts/server_presetup_CI.bash
diff --git a/tests/functest/odl-sfc/setup_scripts/tacker_client_install.sh b/sfc/tests/functest/setup_scripts/tacker_client_install.sh
index adb9a44b..adb9a44b 100755..100644
--- a/tests/functest/odl-sfc/setup_scripts/tacker_client_install.sh
+++ b/sfc/tests/functest/setup_scripts/tacker_client_install.sh
diff --git a/tests/functest/odl-sfc/sfc.py b/sfc/tests/functest/sfc.py
index 5d1024db..45fb9b0f 100755..100644
--- a/tests/functest/odl-sfc/sfc.py
+++ b/sfc/tests/functest/sfc.py
@@ -1,14 +1,25 @@
+#!/bin/python
+#
+# Copyright (c) 2015 All rights reserved
+# This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
import argparse
import os
import sys
+import threading
+
import functest.utils.functest_logger as ft_logger
import functest.utils.openstack_utils as os_utils
import functest.utils.openstack_tacker as os_tacker
-import threading
import opnfv.utils.ovs_logger as ovs_log
-import utils as test_utils
-import config as sfc_config
-from results import Results
+import sfc.lib.utils as test_utils
+import sfc.lib.config as sfc_config
+from sfc.lib.results import Results
parser = argparse.ArgumentParser()
diff --git a/tests/functest/odl-sfc/sfc_one_chain_two_service_functions_different_computes.py b/sfc/tests/functest/sfc_one_chain_two_service_functions_different_computes.py
index 8f289670..f901a041 100755..100644
--- a/tests/functest/odl-sfc/sfc_one_chain_two_service_functions_different_computes.py
+++ b/sfc/tests/functest/sfc_one_chain_two_service_functions_different_computes.py
@@ -1,15 +1,26 @@
+#!/bin/python
+#
+# Copyright (c) 2015 All rights reserved
+# This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
import argparse
import os
+import re
import sys
import time
+
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
import functest.utils.openstack_tacker as os_tacker
-import re
import opnfv.utils.ovs_logger as ovs_log
-import utils as test_utils
-import config as sfc_config
+import sfc.lib.utils as test_utils
+import sfc.lib.config as sfc_config
parser = argparse.ArgumentParser()
@@ -24,7 +35,7 @@ args = parser.parse_args()
logger = ft_logger.Logger("ODL_SFC").getLogger()
REPO_PATH = os.path.join(os.environ['REPOS_DIR'], 'sfc/')
-SFC_TEST_DIR = os.path.join(REPO_PATH, "tests/functest/odl-sfc/")
+SFC_TEST_DIR = os.path.join(REPO_PATH, "sfc/tests/functest")
TACKER_SCRIPT = os.path.join(SFC_TEST_DIR, "sfc_tacker_test2.bash")
TACKER_VNFD1 = os.path.join(SFC_TEST_DIR, "vnfd-templates", "test2-vnfd1.yaml")
TACKER_VNFD2 = os.path.join(SFC_TEST_DIR, "vnfd-templates", "test2-vnfd2.yaml")
diff --git a/tests/functest/odl-sfc/sfc_tacker_test2.bash b/sfc/tests/functest/sfc_tacker_test2.bash
index 156b19cb..156b19cb 100755..100644
--- a/tests/functest/odl-sfc/sfc_tacker_test2.bash
+++ b/sfc/tests/functest/sfc_tacker_test2.bash
diff --git a/tests/functest/odl-sfc/vnfd-templates/test-vnfd1.yaml b/sfc/tests/functest/vnfd-templates/test-vnfd1.yaml
index 5c672e38..5c672e38 100644
--- a/tests/functest/odl-sfc/vnfd-templates/test-vnfd1.yaml
+++ b/sfc/tests/functest/vnfd-templates/test-vnfd1.yaml
diff --git a/tests/functest/odl-sfc/vnfd-templates/test-vnfd2.yaml b/sfc/tests/functest/vnfd-templates/test-vnfd2.yaml
index 8a570ab9..8a570ab9 100644
--- a/tests/functest/odl-sfc/vnfd-templates/test-vnfd2.yaml
+++ b/sfc/tests/functest/vnfd-templates/test-vnfd2.yaml
diff --git a/tests/functest/odl-sfc/vnfd-templates/test2-vnfd1.yaml b/sfc/tests/functest/vnfd-templates/test2-vnfd1.yaml
index 5c672e38..5c672e38 100644
--- a/tests/functest/odl-sfc/vnfd-templates/test2-vnfd1.yaml
+++ b/sfc/tests/functest/vnfd-templates/test2-vnfd1.yaml
diff --git a/tests/functest/odl-sfc/vnfd-templates/test2-vnfd2.yaml b/sfc/tests/functest/vnfd-templates/test2-vnfd2.yaml
index 8a570ab9..8a570ab9 100644
--- a/tests/functest/odl-sfc/vnfd-templates/test2-vnfd2.yaml
+++ b/sfc/tests/functest/vnfd-templates/test2-vnfd2.yaml
diff --git a/tests/functest/odl-sfc/setup_scripts/prepare_odl_sfc.py b/tests/functest/odl-sfc/setup_scripts/prepare_odl_sfc.py
deleted file mode 100755
index c3162cba..00000000
--- a/tests/functest/odl-sfc/setup_scripts/prepare_odl_sfc.py
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# Author: George Paraskevopoulos (geopar@intracom-telecom.com)
-# Manuel Buil (manuel.buil@ericsson.com)
-# Prepares the controller and the compute nodes for the odl-sfc testcase
-#
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-
-import os
-import sys
-import subprocess
-import paramiko
-import functest.utils.functest_logger as ft_logger
-
-logger = ft_logger.Logger("ODL_SFC").getLogger()
-
-SFC_REPO_DIR = "/home/opnfv/repos/sfc"
-
-try:
- INSTALLER_IP = os.environ['INSTALLER_IP']
-except:
- logger.debug("INSTALLER_IP does not exist. We create 10.20.0.2")
- INSTALLER_IP = "10.20.0.2"
-
-os.environ['ODL_SFC_LOG'] = "/home/opnfv/functest/results/odl-sfc.log"
-os.environ['ODL_SFC_DIR'] = os.path.join(SFC_REPO_DIR,
- "tests/functest/odl-sfc")
-SETUP_SCRIPTS_DIR = os.path.join(os.environ['ODL_SFC_DIR'], 'setup_scripts')
-
-command = SETUP_SCRIPTS_DIR + ("/server_presetup_CI.bash | "
- "tee -a ${ODL_SFC_LOG} 1>/dev/null 2>&1")
-
-output = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
-
-# This code is for debugging purposes
-# for line in iter(output.stdout.readline, ''):
-# i = line.rstrip()
-# print(i)
-
-# Make sure the process is finished before checking the returncode
-if not output.poll():
- output.wait()
-
-# Get return value
-if output.returncode:
- print("The presetup of the server did not work")
- sys.exit(output.returncode)
-
-logger.info("The presetup of the server worked ")
-
-ssh_options = "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
-ssh = paramiko.SSHClient()
-ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
-
-try:
- ssh.connect(INSTALLER_IP, username="root",
- password="r00tme", timeout=2)
- command = "fuel node | grep compute | awk '{print $10}'"
- logger.info("Executing ssh to collect the compute IPs")
- (stdin, stdout, stderr) = ssh.exec_command(command)
-except:
- logger.debug("Something went wrong in the ssh to collect the computes IP")
-
-output = stdout.readlines()
-for ip in output:
- command = SETUP_SCRIPTS_DIR + ("/compute_presetup_CI.bash " + ip.rstrip() +
- "| tee -a ${ODL_SFC_LOG} 1>/dev/null 2>&1")
-
- output = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
-
-# This code is for debugging purposes
-# for line in iter(output.stdout.readline, ''):
-# print(line)
-# sys.stdout.flush()
-
- output.stdout.close()
-
- if not (output.poll()):
- output.wait()
-
- # Get return value
- if output.returncode:
- print("The compute config did not work on compute %s" % ip)
- sys.exit(output.returncode)
-
-sys.exit(0)