Merge "Replaces uuid.uuid4 with uuidutils.generate_uuid()"
This commit is contained in:
commit
e1e3fd71fc
|
@ -15,7 +15,8 @@ import shlex
|
|||
import six
|
||||
import subprocess
|
||||
import time
|
||||
import uuid
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from tempest.lib.cli import base
|
||||
from tempest.lib import exceptions
|
||||
|
@ -30,8 +31,8 @@ class GnocchiClient(object):
|
|||
def __init__(self):
|
||||
self.cli_dir = os.environ.get('GNOCCHI_CLIENT_EXEC_DIR')
|
||||
self.endpoint = os.environ.get('PIFPAF_GNOCCHI_HTTP_URL')
|
||||
self.user_id = str(uuid.uuid4())
|
||||
self.project_id = str(uuid.uuid4())
|
||||
self.user_id = uuidutils.generate_uuid()
|
||||
self.project_id = uuidutils.generate_uuid()
|
||||
|
||||
def gnocchi(self, action, flags='', params='',
|
||||
fail_ok=False, merge_stderr=False, input=None):
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import uuid
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from gnocchiclient.tests.functional import base
|
||||
|
||||
|
@ -17,7 +17,7 @@ from gnocchiclient.tests.functional import base
|
|||
class ArchivePolicyClientTest(base.ClientTestBase):
|
||||
def test_archive_policy_scenario(self):
|
||||
# CREATE
|
||||
apname = str(uuid.uuid4())
|
||||
apname = uuidutils.generate_uuid()
|
||||
result = self.gnocchi(
|
||||
u'archive-policy', params=u"create %s"
|
||||
u" --back-window 0"
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import uuid
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from gnocchiclient.tests.functional import base
|
||||
|
||||
|
||||
class ArchivePolicyRuleClientTest(base.ClientTestBase):
|
||||
def test_archive_policy_rule_scenario(self):
|
||||
apname = str(uuid.uuid4())
|
||||
apname = uuidutils.generate_uuid()
|
||||
# Create an archive policy
|
||||
self.gnocchi(
|
||||
u'archive-policy', params=u"create %s"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import uuid
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from gnocchiclient.tests.functional import base
|
||||
|
||||
|
@ -22,7 +22,7 @@ class BenchmarkMetricTest(base.ClientTestBase):
|
|||
self.assertIn("0 must be greater than 0", result)
|
||||
|
||||
def test_benchmark_metric_create(self):
|
||||
apname = str(uuid.uuid4())
|
||||
apname = uuidutils.generate_uuid()
|
||||
# PREPARE AN ARCHIVE POLICY
|
||||
self.gnocchi("archive-policy", params="create %s "
|
||||
"--back-window 0 -d granularity:1s,points:86400" % apname)
|
||||
|
@ -43,7 +43,7 @@ class BenchmarkMetricTest(base.ClientTestBase):
|
|||
self.assertNotIn('delete executed', result)
|
||||
|
||||
def test_benchmark_metric_get(self):
|
||||
apname = str(uuid.uuid4())
|
||||
apname = uuidutils.generate_uuid()
|
||||
# PREPARE AN ARCHIVE POLICY
|
||||
self.gnocchi("archive-policy", params="create %s "
|
||||
"--back-window 0 -d granularity:1s,points:86400" % apname)
|
||||
|
@ -59,7 +59,7 @@ class BenchmarkMetricTest(base.ClientTestBase):
|
|||
self.assertLessEqual(int(result['show failures']), 10)
|
||||
|
||||
def test_benchmark_measures_add(self):
|
||||
apname = str(uuid.uuid4())
|
||||
apname = uuidutils.generate_uuid()
|
||||
# PREPARE AN ARCHIVE POLICY
|
||||
self.gnocchi("archive-policy", params="create %s "
|
||||
"--back-window 0 -d granularity:1s,points:86400" % apname)
|
||||
|
@ -92,7 +92,7 @@ class BenchmarkMetricTest(base.ClientTestBase):
|
|||
self.assertIn("extra wait to process measures", result)
|
||||
|
||||
def test_benchmark_measures_show(self):
|
||||
apname = str(uuid.uuid4())
|
||||
apname = uuidutils.generate_uuid()
|
||||
# PREPARE AN ARCHIVE POLICY
|
||||
self.gnocchi("archive-policy", params="create %s "
|
||||
"--back-window 0 -d granularity:1s,points:86400" % apname)
|
||||
|
|
|
@ -12,14 +12,15 @@
|
|||
import json
|
||||
import os
|
||||
import tempfile
|
||||
import uuid
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from gnocchiclient.tests.functional import base
|
||||
|
||||
|
||||
class MetricClientTest(base.ClientTestBase):
|
||||
def test_delete_several_metrics(self):
|
||||
apname = str(uuid.uuid4())
|
||||
apname = uuidutils.generate_uuid()
|
||||
# PREPARE AN ARCHIVE POLICY
|
||||
self.gnocchi("archive-policy", params="create %s "
|
||||
"--back-window 0 -d granularity:1s,points:86400" % apname)
|
||||
|
|
|
@ -10,18 +10,18 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import uuid
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from gnocchiclient.tests.functional import base
|
||||
from gnocchiclient import utils
|
||||
|
||||
|
||||
class ResourceClientTest(base.ClientTestBase):
|
||||
RESOURCE_ID = str(uuid.uuid4())
|
||||
RESOURCE_ID2 = str(uuid.uuid4())
|
||||
RAW_RESOURCE_ID2 = str(uuid.uuid4()) + "/foo"
|
||||
RESOURCE_ID = uuidutils.generate_uuid()
|
||||
RESOURCE_ID2 = uuidutils.generate_uuid()
|
||||
RAW_RESOURCE_ID2 = uuidutils.generate_uuid() + "/foo"
|
||||
RESOURCE_ID2 = utils.encode_resource_id(RAW_RESOURCE_ID2)
|
||||
PROJECT_ID = str(uuid.uuid4())
|
||||
PROJECT_ID = uuidutils.generate_uuid()
|
||||
|
||||
def test_help(self):
|
||||
self.gnocchi("help", params="resource list")
|
||||
|
@ -29,7 +29,7 @@ class ResourceClientTest(base.ClientTestBase):
|
|||
self.gnocchi("help", params="resource search")
|
||||
|
||||
def test_resource_scenario(self):
|
||||
apname = str(uuid.uuid4())
|
||||
apname = uuidutils.generate_uuid()
|
||||
# Create an archive policy
|
||||
self.gnocchi(
|
||||
u'archive-policy', params=u"create %s"
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import uuid
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from gnocchiclient.tests.functional import base
|
||||
|
||||
|
||||
class ResourceTypeClientTest(base.ClientTestBase):
|
||||
RESOURCE_TYPE = str(uuid.uuid4())
|
||||
RESOURCE_TYPE = uuidutils.generate_uuid()
|
||||
|
||||
def test_help(self):
|
||||
self.gnocchi("help", params="resource list")
|
||||
|
|
Loading…
Reference in New Issue