aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack
diff options
context:
space:
mode:
authorJose Lausuch <jose.lausuch@ericsson.com>2017-02-10 11:26:13 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-02-10 11:26:13 +0000
commit8d949aff05d479c9dc037419fc54e24382904bf3 (patch)
tree133f1a377efda64fcbcb153f22244a45819f3e42 /functest/opnfv_tests/openstack
parent7ddaeed03b3360ec1041a50836bbd063a1533aed (diff)
parenta3d2b6df1fc22c05f2cccd6e2c7ab225899be109 (diff)
Merge "Refactor configure_tempest() function"
Diffstat (limited to 'functest/opnfv_tests/openstack')
-rw-r--r--functest/opnfv_tests/openstack/tempest/conf_utils.py51
1 files changed, 36 insertions, 15 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index 91a5bb4b0..f013b4421 100644
--- a/functest/opnfv_tests/openstack/tempest/conf_utils.py
+++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py
@@ -110,24 +110,23 @@ def get_verifier_deployment_dir(verifier_id, deployment_id):
def configure_tempest(deployment_dir, IMAGE_ID=None, FLAVOR_ID=None):
"""
- Add/update needed parameters into tempest.conf file generated by Rally
+ Calls rally verify and updates the generated tempest.conf with
+ given parameters
"""
- tempest_conf_file = os.path.join(deployment_dir, "tempest.conf")
- if os.path.isfile(tempest_conf_file):
- logger.debug("Verifier is already configured.")
- logger.debug("Reconfiguring the current verifier...")
- cmd = "rally verify configure-verifier --reconfigure"
+ conf_verifier_result = configure_verifier(deployment_dir)
+ if conf_verifier_result == releng_constants.EXIT_RUN_ERROR:
+ return releng_constants.EXIT_RUN_ERROR
else:
- logger.info("Configuring the verifier...")
- cmd = "rally verify configure-verifier"
- ft_utils.execute_command(cmd)
+ configure_tempest_update_params(conf_verifier_result,
+ IMAGE_ID, FLAVOR_ID)
+ return releng_constants.EXIT_OK
- logger.debug("Looking for tempest.conf file...")
- if not os.path.isfile(tempest_conf_file):
- logger.error("Tempest configuration file %s NOT found."
- % tempest_conf_file)
- return releng_constants.EXIT_RUN_ERROR
+def configure_tempest_update_params(tempest_conf_file,
+ IMAGE_ID=None, FLAVOR_ID=None):
+ """
+ Add/update needed parameters into tempest.conf file
+ """
logger.debug("Updating selected tempest.conf parameters...")
config = ConfigParser.RawConfigParser()
config.read(tempest_conf_file)
@@ -178,7 +177,29 @@ def configure_tempest(deployment_dir, IMAGE_ID=None, FLAVOR_ID=None):
shutil.copyfile(tempest_conf_file,
os.path.join(TEMPEST_RESULTS_DIR, 'tempest.conf'))
- return releng_constants.EXIT_OK
+
+def configure_verifier(deployment_dir):
+ """
+ Execute rally verify configure-verifier, which generates tempest.conf
+ """
+ tempest_conf_file = os.path.join(deployment_dir, "tempest.conf")
+ if os.path.isfile(tempest_conf_file):
+ logger.debug("Verifier is already configured.")
+ logger.debug("Reconfiguring the current verifier...")
+ cmd = "rally verify configure-verifier --reconfigure"
+ else:
+ logger.info("Configuring the verifier...")
+ cmd = "rally verify configure-verifier"
+ ft_utils.execute_command(cmd)
+ logger.debug("Looking for tempest.conf file...")
+
+ if not os.path.isfile(tempest_conf_file):
+ logger.error("Tempest configuration file %s NOT found."
+ % tempest_conf_file)
+ return releng_constants.EXIT_RUN_ERROR
+
+ else:
+ return tempest_conf_file
def configure_tempest_multisite(deployment_dir):
0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
---
defaults:
  # odl-sfc uses custom flavors as per below params
  flavor: custom
  ram_size_in_mb: 500
  disk_size_in_gb: 1
  vcpu_count: 1
  image_name: sfc_nsh_fraser
  installer:
    fuel:
      user: root
      password: r00tme
      cluster: 1  # Change this to the id of the desired fuel env (1, 2, 3...)
    apex:
      user: stack
      pkey_file: "/root/.ssh/id_rsa"
    osa:
      user: root
      pkey_file: "/root/.ssh/id_rsa"
    compass:
      user: root
      pkey_file: "/root/.ssh/id_rsa"
  image_format: qcow2
  image_url: "http://artifacts.opnfv.org/sfc/images/sfc_nsh_fraser.qcow2"
  vnfd-dir: "vnfd-templates"
  vnfd-default-params-file: "test-vnfd-default-params.yaml"


testcases:
  sfc_one_chain_two_service_functions:
    enabled: true
    order: 0
    description: "ODL-SFC Testing SFs when they are located on the same chain"
    net_name: example-net
    subnet_name: example-subnet
    router_name: example-router
    subnet_cidr: "11.0.0.0/24"
    secgroup_name: "example-sg"
    secgroup_descr: "Example Security group"
    test_vnfd_red: "test-one-chain-vnfd1.yaml"
    test_vnfd_blue: "test-one-chain-vnfd2.yaml"
    test_vnffgd_red: "test-one-chain-vnffgd-pike.yaml"

  sfc_two_chains_SSH_and_HTTP:
    enabled: false
    order: 1
    description: "ODL-SFC tests with two chains and one SF per chain"
    net_name: example-net
    subnet_name: example-subnet
    router_name: example-router
    subnet_cidr: "11.0.0.0/24"
    secgroup_name: "example-sg"
    secgroup_descr: "Example Security group"
    test_vnfd_red: "test-two-chains-vnfd1.yaml"
    test_vnfd_blue: "test-two-chains-vnfd2.yaml"
    test_vnffgd_red: "test-two-chains-vnffgd1-pike.yaml"
    test_vnffgd_blue: "test-two-chains-vnffgd2-pike.yaml"

  sfc_symmetric_chain:
    enabled: false
    order: 2
    description: "Verify the behavior of a symmetric service chain"
    net_name: example-net
    subnet_name: example-subnet
    router_name: example-router
    subnet_cidr: "11.0.0.0/24"
    secgroup_name: "example-sg"
    secgroup_descr: "Example Security group"
    test_vnfd: "test-symmetric-vnfd.yaml"
    test_vnffgd: "test-symmetric-vnffgd.yaml"
    source_port: 22222

  sfc_chain_deletion:
    enabled: false
    order: 3
    description: "Verify if chains work correctly after deleting one"
    net_name: example-net
    subnet_name: example-subnet
    router_name: example-router
    subnet_cidr: "11.0.0.0/24"
    secgroup_name: "example-sg"
    secgroup_descr: "Example Security group"
    test_vnfd_red: "test-one-chain-vnfd1.yaml"
    test_vnffgd_red: "test-deletion-vnffgd-pike.yaml"