diff options
Diffstat (limited to 'functest/ci')
-rwxr-xr-x | functest/ci/config_functest.yaml | 108 | ||||
-rwxr-xr-x | functest/ci/exec_test.sh | 15 | ||||
-rwxr-xr-x | functest/ci/prepare_env.py | 66 | ||||
-rwxr-xr-x | functest/ci/run_tests.py | 61 | ||||
-rwxr-xr-x | functest/ci/testcases.yaml | 71 |
5 files changed, 216 insertions, 105 deletions
diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml index 15e0d3a1..25be1724 100755 --- a/functest/ci/config_functest.yaml +++ b/functest/ci/config_functest.yaml @@ -16,7 +16,7 @@ general: dir_repo_rally: /home/opnfv/repos/rally repo_tempest: /home/opnfv/repos/tempest dir_repo_releng: /home/opnfv/repos/releng - dir_repo_vims_test: /home/opnfv/repos/vims-test + repo_vims_test: /home/opnfv/repos/vnfs/vims-test repo_sdnvpn: /home/opnfv/repos/sdnvpn repo_sfc: /home/opnfv/repos/sfc dir_repo_onos: /home/opnfv/repos/onos @@ -88,6 +88,7 @@ onos_sfc: image_file_name: firewall_block_image.img tempest: + deployment_name: opnfv-tempest identity: tenant_name: tempest tenant_description: Tenant for Tempest test suite @@ -109,53 +110,64 @@ rally: subnet_cidr: 192.168.140.0/24 router_name: rally-router -vIMS: - general: - tenant_name: vIMS - tenant_description: vIMS Functionality Testing - images: - ubuntu: - image_url: http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img - image_name: ubuntu_14.04 - centos: - image_url: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1510.qcow2 - image_name: centos_7 - cloudify: - blueprint: - url: https://github.com/boucherv-orange/cloudify-manager-blueprints.git - branch: "3.3.1-build" - requierments: - ram_min: 3000 - os_image: centos_7 - inputs: - keystone_username: "" - keystone_password: "" - keystone_tenant_name: "" - keystone_url: "" - manager_public_key_name: 'manager-kp' - agent_public_key_name: 'agent-kp' - image_id: "" - flavor_id: "3" - external_network_name: "" - ssh_user: centos - agents_user: ubuntu - clearwater: - blueprint: - file_name: 'openstack-blueprint.yaml' - name: "clearwater-opnfv" - destination_folder: "opnfv-cloudify-clearwater" - url: https://github.com/Orange-OpenSource/opnfv-cloudify-clearwater.git - branch: "stable" - deployment-name: 'clearwater-opnfv' - requierments: - ram_min: 1700 - os_image: ubuntu_14.04 - inputs: - image_id: '' - flavor_id: '' - agent_user: 'ubuntu' - external_network_name: '' - public_domain: clearwater.opnfv +vnf: + aaa: + tenant_name: aaa + tenant_description: Freeradius server + tenant_images: {} + juju_epc: + tenant_name: epc + tenant_description: OAI EPC deployed with Juju + tenant_images: {} + cloudify_ims: + tenant_name: cloudify_ims + tenant_description: vIMS + tenant_images: + ubuntu_14.04: http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img + centos_7: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1510.qcow2 + cloudify: + blueprint: + url: https://github.com/boucherv-orange/cloudify-manager-blueprints.git + branch: "3.3.1-build" + requierments: + ram_min: 3000 + os_image: centos_7 + inputs: + keystone_username: "" + keystone_password: "" + keystone_tenant_name: "" + keystone_url: "" + manager_public_key_name: 'manager-kp' + agent_public_key_name: 'agent-kp' + image_id: "" + flavor_id: "3" + external_network_name: "" + ssh_user: centos + agents_user: ubuntu + clearwater: + blueprint: + file_name: 'openstack-blueprint.yaml' + name: "clearwater-opnfv" + destination_folder: "opnfv-cloudify-clearwater" + url: https://github.com/Orange-OpenSource/opnfv-cloudify-clearwater.git + branch: "stable" + deployment_name: 'clearwater-opnfv' + requirements: + ram_min: 1700 + os_image: ubuntu_14.04 + inputs: + image_id: '' + flavor_id: '' + agent_user: 'ubuntu' + external_network_name: '' + public_domain: clearwater.opnfv + orchestra_ims: + tenant_name: orchestra_ims + tenant_description: ims deployed with openbaton + opera_ims: + tenant_name: opera_ims + tenant_description: ims deployed with open-o + ONOS: general: onosbench_username: 'root' diff --git a/functest/ci/exec_test.sh b/functest/ci/exec_test.sh index 109de078..7c96d69c 100755 --- a/functest/ci/exec_test.sh +++ b/functest/ci/exec_test.sh @@ -47,11 +47,13 @@ function odl_tests(){ neutron_ip=$(openstack catalog show network | grep publicURL | cut -f3 -d"/" | cut -f1 -d":") odl_ip=${neutron_ip} odl_port=8080 + odl_restport=8181 if [ "$INSTALLER_TYPE" == "fuel" ]; then odl_port=8282 elif [ "$INSTALLER_TYPE" == "apex" ]; then odl_ip=$SDN_CONTROLLER_IP - odl_port=8181 + odl_port=8081 + odl_restport=8081 elif [ "$INSTALLER_TYPE" == "joid" ]; then odl_ip=$SDN_CONTROLLER elif [ "$INSTALLER_TYPE" == "compass" ]; then @@ -78,10 +80,15 @@ function run_test(){ odl_tests [[ "$report" == "-r" ]] && args=-p ${FUNCTEST_TEST_DIR}/sdn/odl/odl.py \ - --keystoneip $keystone_ip --neutronip $neutron_ip \ - --osusername ${OS_USERNAME} --ostenantname ${OS_TENANT_NAME} \ + --keystoneip $keystone_ip \ + --neutronip $neutron_ip \ + --odlip $odl_ip \ + --odlrestconfport $odl_restport \ + --odlwebport $odl_port \ --ospassword ${OS_PASSWORD} \ - --odlip $odl_ip --odlwebport $odl_port ${args} + --ostenantname ${OS_TENANT_NAME} \ + --osusername ${OS_USERNAME} \ + ${args} ;; "vims") python ${FUNCTEST_TEST_DIR}/vnf/ims/vims.py $clean_flag $report diff --git a/functest/ci/prepare_env.py b/functest/ci/prepare_env.py index 3df3a0e0..74c751af 100755 --- a/functest/ci/prepare_env.py +++ b/functest/ci/prepare_env.py @@ -29,12 +29,6 @@ import functest.utils.openstack_utils as os_utils from functest.utils.constants import CONST actions = ['start', 'check'] -parser = argparse.ArgumentParser() -parser.add_argument("action", help="Possible actions are: " - "'{d[0]}|{d[1]}' ".format(d=actions)) -parser.add_argument("-d", "--debug", help="Debug mode", action="store_true") -args = parser.parse_args() - """ logging configuration """ logger = ft_logger.Logger("prepare_env").getLogger() @@ -48,6 +42,19 @@ with open(CONFIG_PATCH_PATH) as f: functest_patch_yaml = yaml.safe_load(f) +class PrepareEnvParser(): + + def __init__(self): + self.parser = argparse.ArgumentParser() + self.parser.add_argument("action", help="Possible actions are: " + "'{d[0]}|{d[1]}' ".format(d=actions)) + self.parser.add_argument("-d", "--debug", help="Debug mode", + action="store_true") + + def parse_args(self, argv=[]): + return vars(self.parser.parse_args(argv)) + + def print_separator(): logger.info("==============================================") @@ -227,32 +234,36 @@ def install_rally(): rally_conf = os_utils.get_credentials_for_rally() with open('rally_conf.json', 'w') as fp: json.dump(rally_conf, fp) - cmd = "rally deployment create --file=rally_conf.json --name=" - cmd += CONST.rally_deployment_name - ft_utils.execute_command(cmd, - error_msg="Problem creating Rally deployment") - - logger.info("Installing tempest from existing repo...") - cmd = ("rally verify install --source " + - CONST.dir_repo_tempest + - " --system-wide") + cmd = ("rally deployment create " + "--file=rally_conf.json --name={}" + .format(CONST.rally_deployment_name)) ft_utils.execute_command(cmd, - error_msg="Problem installing Tempest.") + error_msg=("Problem while creating " + "Rally deployment")) cmd = "rally deployment check" ft_utils.execute_command(cmd, error_msg=("OpenStack not responding or " "faulty Rally deployment.")) - cmd = "rally show images" + cmd = "rally deployment list" ft_utils.execute_command(cmd, error_msg=("Problem while listing " - "OpenStack images.")) + "Rally deployment.")) - cmd = "rally show flavors" + cmd = "rally plugin list | head -5" ft_utils.execute_command(cmd, error_msg=("Problem while showing " - "OpenStack flavors.")) + "Rally plugins.")) + + +def install_tempest(): + logger.info("Installing tempest from existing repo...") + cmd = ("rally verify create-verifier --source {0} " + "--name {1} --type tempest" + .format(CONST.dir_repo_tempest, CONST.tempest_deployment_name)) + ft_utils.execute_command(cmd, + error_msg="Problem while installing Tempest.") def check_environment(): @@ -267,15 +278,15 @@ def check_environment(): logger.error(msg_not_active) sys.exit(1) - logger.info("Functest environment installed.") + logger.info("Functest environment is installed.") -def main(): - if not (args.action in actions): +def main(**kwargs): + if not (kwargs['action'] in actions): logger.error('Argument not valid.') sys.exit() - if args.action == "start": + if kwargs['action'] == "start": logger.info("######### Preparing Functest environment #########\n") check_env_variables() create_directories() @@ -283,17 +294,20 @@ def main(): patch_config_file() verify_deployment() install_rally() + install_tempest() with open(CONST.env_active, "w") as env_file: env_file.write("1") check_environment() - if args.action == "check": + if kwargs['action'] == "check": check_environment() exit(0) if __name__ == '__main__': - main() + parser = PrepareEnvParser() + args = parser.parse_args(sys.argv[1:]) + main(**args) diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index 40d71db9..a5f1ab9e 100755 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -26,17 +26,6 @@ import functest.utils.openstack_snapshot as os_snapshot import functest.utils.openstack_utils as os_utils from functest.utils.constants import CONST -parser = argparse.ArgumentParser() -parser.add_argument("-t", "--test", dest="test", action='store', - help="Test case or tier (group of tests) to be executed. " - "It will run all the test if not specified.") -parser.add_argument("-n", "--noclean", help="Do not clean OpenStack resources" - " after running each test (default=false).", - action="store_true") -parser.add_argument("-r", "--report", help="Push results to database " - "(default=false).", action="store_true") -args = parser.parse_args() - """ logging configuration """ logger = ft_logger.Logger("run_tests").getLogger() @@ -49,6 +38,26 @@ EXEC_SCRIPT = ("%s/functest/ci/exec_test.sh" % CONST.dir_repo_functest) # this variable will change to -1 +class RunTestsParser(): + + def __init__(self): + self.parser = argparse.ArgumentParser() + self.parser.add_argument("-t", "--test", dest="test", action='store', + help="Test case or tier (group of tests) " + "to be executed. It will run all the test " + "if not specified.") + self.parser.add_argument("-n", "--noclean", help="Do not clean " + "OpenStack resources after running each " + "test (default=false).", + action="store_true") + self.parser.add_argument("-r", "--report", help="Push results to " + "database (default=false).", + action="store_true") + + def parse_args(self, argv=[]): + return vars(self.parser.parse_args(argv)) + + class GlobalVariables: EXECUTED_TEST_CASES = [] OVERALL_RESULT = 0 @@ -118,7 +127,7 @@ def get_run_dict_if_defined(testname): return None -def run_test(test, tier_name): +def run_test(test, tier_name, testcases=None): result_str = "PASS" start = datetime.datetime.now() test_name = test.get_name() @@ -174,7 +183,7 @@ def run_test(test, tier_name): result_str = "FAIL" if test.is_blocking(): - if not args.test or args.test == "all": + if not testcases or testcases == "all": logger.info("This test case is blocking. Aborting overall " "execution.") # if it is a single test we don't print the whole results table @@ -223,7 +232,7 @@ def run_all(tiers): generate_report.main(GlobalVariables.EXECUTED_TEST_CASES) -def main(): +def main(**kwargs): CI_INSTALLER_TYPE = CONST.INSTALLER_TYPE CI_SCENARIO = CONST.DEPLOY_SCENARIO @@ -231,27 +240,29 @@ def main(): file = CONST.functest_testcases_yaml _tiers = tb.TierBuilder(CI_INSTALLER_TYPE, CI_SCENARIO, file) - if args.noclean: + if kwargs['noclean']: GlobalVariables.CLEAN_FLAG = False - if args.report: + if kwargs['report']: GlobalVariables.REPORT_FLAG = True - if args.test: + if kwargs['test']: source_rc_file() - if _tiers.get_tier(args.test): - run_tier(_tiers.get_tier(args.test)) + if _tiers.get_tier(kwargs['test']): + run_tier(_tiers.get_tier(kwargs['test'])) - elif _tiers.get_test(args.test): - run_test(_tiers.get_test(args.test), _tiers.get_tier(args.test)) + elif _tiers.get_test(kwargs['test']): + run_test(_tiers.get_test(kwargs['test']), + _tiers.get_tier(kwargs['test']), + kwargs['test']) - elif args.test == "all": + elif kwargs['test'] == "all": run_all(_tiers) else: logger.error("Unknown test case or tier '%s', or not supported by " "the given scenario '%s'." - % (args.test, CI_SCENARIO)) + % (kwargs['test'], CI_SCENARIO)) logger.debug("Available tiers are:\n\n%s" % _tiers) else: @@ -262,4 +273,6 @@ def main(): if __name__ == '__main__': - main() + parser = RunTestsParser() + args = parser.parse_args(sys.argv[1:]) + main(**args) diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml index 446a3b85..ede08285 100755 --- a/functest/ci/testcases.yaml +++ b/functest/ci/testcases.yaml @@ -70,6 +70,7 @@ tiers: run: module: 'functest.opnfv_tests.openstack.tempest.tempest' class: 'TempestSmokeSerial' + - name: rally_sanity criteria: 'success_rate == 100%' @@ -214,7 +215,6 @@ tiers: dependencies: installer: 'apex' scenario: '^((?!fdio).)*$' - - name: copper criteria: 'status == "PASS"' @@ -227,7 +227,6 @@ tiers: run: module: 'functest.opnfv_tests.features.copper' class: 'Copper' - - name: moon criteria: 'status == "PASS"' @@ -282,6 +281,18 @@ tiers: run: module: 'functest.opnfv_tests.vnf.rnc.parser' class: 'Parser' + - + name: orchestra + criteria: 'ret == 0' + blocking: false + description: >- + Test OpenBaton (Orchestra) stack + dependencies: + installer: 'joid' + scenario: 'unknown' + run: + module: 'functest.opnfv_tests.features.orchestrator.orchestra' + class: 'OpenbatonOrchestrator' - name: components order: 3 @@ -323,7 +334,7 @@ tiers: Collection of VNF test cases. testcases: - - name: vims + name: cloudify_ims criteria: 'status == "PASS"' blocking: false description: >- @@ -332,3 +343,57 @@ tiers: dependencies: installer: '' scenario: '(ocl)|(nosdn)|^(os-odl)((?!bgpvpn).)*$' + run: + module: 'functest.opnfv_tests.vnf.ims.cloudify_ims' + class: 'ImsVnf' + - + name: aaa + criteria: 'ret == 0' + blocking: false + description: >- + Test suite from Parser project. + dependencies: + installer: '' + scenario: '' + run: + module: 'functest.opnfv_tests.vnf.aaa.aaa' + class: 'AaaVnf' + + - + name: juju_epc + criteria: 'ret == 0' + blocking: false + description: >- + Test suite from OAI project, vEPC deployed with Juju. + dependencies: + installer: 'unknown' + scenario: 'unknown' + run: + module: 'functest.opnfv_tests.vnf.epc.epc' + class: 'EpcVnf' + + - + name: orchestra_ims + criteria: 'ret == 0' + blocking: false + description: >- + VNF deployment with OpenBaton (Orchestra) + dependencies: + installer: 'unknown' + scenario: 'unknown' + run: + module: 'functest.opnfv_tests.vnf.ims.orchestra_ims' + class: 'ImsVnf' + + - + name: opera_ims + criteria: 'ret == 0' + blocking: false + description: >- + Evolution of vIMS + dependencies: + installer: 'unknown' + scenario: 'unknown' + run: + module: 'functest.opnfv_tests.vnf.ims.opera_ims' + class: 'ImsVnf' |