Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions common/contrail_test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
DEFAULT_CI_SVC_IMAGE = os.getenv('DEFAULT_CI_SVC_IMAGE', 'cirros_in_net')
CI_IMAGES = [DEFAULT_CI_IMAGE, DEFAULT_CI_SVC_IMAGE]

# License: PSF License 2.0
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
# https://hg.python.org/cpython/file/d37f963394aa/Lib/subprocess.py

# monkey patch subprocess.check_output cos its not supported in 2.6
if "check_output" not in dir(subprocess): # duck punch it in!
def f(*popenargs, **kwargs):
Expand Down
2 changes: 2 additions & 0 deletions common/log_orig.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
if not '_loggers' in locals():
_loggers = {}

# License: Apache-2.0
# https://github.com/klarna/op5lib
class NullHandler(logging.Handler):
"""
For backward-compatibility with Python 2.6, a local class definition
Expand Down
3 changes: 3 additions & 0 deletions fixtures/ceilometer/ceilometer_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

VERSION = 2

# License: Apache-2.0
# (c) Copyright 2012, OpenStack Foundation.
# https://docs.openstack.org/horizon/9.1.1/_modules/openstack_dashboard/api/ceilometer.html
def make_query(user_id=None, tenant_id=None, resource_id=None,
user_ids=None, tenant_ids=None, resource_ids=None):
"""Returns query built from given parameters.
Expand Down
6 changes: 6 additions & 0 deletions fixtures/vcenter_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import time


# License: Apache-2.0
# https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/getvnicinfo.py
def GetVMHosts(content):
print("Getting all ESX hosts ...")
host_view = content.viewManager.CreateContainerView(content.rootFolder,
Expand Down Expand Up @@ -44,6 +46,10 @@ def getvmnics(content,vm,hosts):
vlanId = None
vSwitch = None
if hasattr(dev_backing, 'port'):
#
# License: Apache-2.0
# https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/getvnicinfo.py
#
portGroupKey = dev.backing.port.portgroupKey
dvsUuid = dev.backing.port.switchUuid
try:
Expand Down
1 change: 1 addition & 0 deletions tcutils/timeout.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# License: CC-BY-SA-3.0"
# From http://stackoverflow.com/questions/2281850/timeout-function-if-it-takes-too-long-to-finish
#
# Usage :
Expand Down
14 changes: 14 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
import logging as std_logging
from tcutils.util import get_unique_random_name


# License: Apache-2.0
# Copyright 2012 OpenStack Foundation
# https://github.com/openstack/tempest/blob/master/tempest/test.py
def attr(*args, **kwargs):
"""A decorator which applies the testtools attr decorator

Expand Down Expand Up @@ -77,10 +81,17 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
# License: Apache-2.0
# Copyright 2012 OpenStack Foundation
# https://github.com/openstack/tempest/blob/master/tempest/test.py

#cls.logger.cleanUp()
if hasattr(super(BaseTestCase, cls), 'tearDownClass'):
super(BaseTestCase, cls).tearDownClass()

# License: Apache-2.0
# Copyright 2012 OpenStack Foundation
# https://github.com/openstack/tempest/blob/master/tempest/test.py
def setUp(self):
super(BaseTestCase, self).setUp()
if not self.setUpClassCalled:
Expand Down Expand Up @@ -127,6 +138,9 @@ def is_test_applicable(self):
return (True, None)


# License: Apache-2.0
# Copyright 2012 OpenStack Foundation
# https://github.com/openstack/tempest/blob/master/tempest/test.py
def call_until_true(func, duration, sleep_for):
"""
Call the given function until it returns True (and return True) or
Expand Down