import argparse
import os
+import re
import sys
import functest.ci.tier_builder as tb
def run_all(tiers):
summary = ""
+ BUILD_TAG = os.getenv('BUILD_TAG')
+ if BUILD_TAG is not None and re.search("daily", BUILD_TAG) is not None:
+ CI_LOOP = "daily"
+ else:
+ CI_LOOP = "weekly"
+
+ tiers_to_run = []
+
for tier in tiers.get_tiers():
- summary += ("\n - %s. %s:\n\t %s"
- % (tier.get_order(),
- tier.get_name(),
- tier.get_test_names()))
+ if re.search(CI_LOOP, tier.get_ci_loop()) is not None:
+ tiers_to_run.append(tier)
+ summary += ("\n - %s. %s:\n\t %s"
+ % (tier.get_order(),
+ tier.get_name(),
+ tier.get_test_names()))
logger.info("Tiers to be executed:%s" % summary)
- for tier in tiers.get_tiers():
+ for tier in tiers_to_run:
run_tier(tier)
-
name: healthcheck
order: 0
- ci: daily
+ ci_loop: '(daily)|(weekly)'
description : >-
First tier to be executed to verify the basic
operations in the VIM.
-
name: smoke
order: 1
- ci: daily
+ ci_loop: '(daily)|(weekly)'
description : >-
Set of basic Functional tests to validate the OpenStack deployment.
testcases:
-
name: vping_ssh
description: >-
- This test case verifies: 1) SSH to an instance using floating
- IPs over the public network. 2) Connectivity between 2 instances
+ This test case verifies: 1) SSH to an instance using floating
+ IPs over the public network. 2) Connectivity between 2 instances
over a private network.
dependencies:
installer: ''
-
name: vping_userdata
description: >-
- This test case verifies: 1) Boot a VM with given userdata.
+ This test case verifies: 1) Boot a VM with given userdata.
2) Connectivity between 2 instances over a private network.
dependencies:
installer: ''
-
name: sdn_suites
order: 2
- ci: daily
+ ci_loop: '(daily)|(weekly)'
description : >-
Test suites corresponding to the different
SDN Controllers existing in OPNFV.
-
name: features
order: 3
- ci: daily
+ ci_loop: '(daily)|(weekly)'
description : >-
Test suites from feature projects
integrated in functest
-
name: tempest
order: 4
- ci: weekly
+ ci_loop: 'weekly'
description : >-
This test case runs the full set of the OpenStack Tempest suite.
testcases:
-
name: rally
order: 5
- ci: weekly
+ ci_loop: 'weekly'
description : >-
Rally suite from the OpenStack community.
testcases:
-
name: vnf
order: 6
- ci: weekly
+ ci_loop: 'weekly'
description : >-
Collection of VNF test cases.
testcases:
for dic_tier in self.dic_tier_array:
tier = th.Tier(name=dic_tier['name'],
order=dic_tier['order'],
- ci=dic_tier['ci'],
+ ci_loop=dic_tier['ci_loop'],
description=dic_tier['description'])
for dic_testcase in dic_tier['testcases']:
class Tier:
- def __init__(self, name, order, ci, description=""):
+ def __init__(self, name, order, ci_loop, description=""):
self.tests_array = []
self.name = name
self.order = order
- self.ci = ci
+ self.ci_loop = ci_loop
self.description = description
def add_test(self, testcase):
def get_order(self):
return self.order
+ def get_ci_loop(self):
+ return self.ci_loop
+
def __str__(self):
lines = split_text(self.description, LINE_LENGTH-6)
out += ("| Tier: " + self.name.ljust(LINE_LENGTH - 10) + "|\n")
out += ("+%s+\n" % ("=" * (LINE_LENGTH - 2)))
out += ("| Order: " + str(self.order).ljust(LINE_LENGTH - 10) + "|\n")
+ out += ("| CI Loop: " + str(self.ci_loop).ljust(LINE_LENGTH - 12) +
+ "|\n")
out += ("| Description:".ljust(LINE_LENGTH - 1) + "|\n")
for line in lines:
out += ("| " + line.ljust(LINE_LENGTH - 7) + " |\n")
@openstack.command('fetch-rc', help="Fetch the OpenStack RC file from "
- "the installer")
+ "the installer.")
def os_fetch_rc():
_openstack.fetch_credentials()