Adam Litke has uploaded a new change for review.
Change subject: tests: Add gen_uuid test helper ......................................................................
tests: Add gen_uuid test helper
The test code is sprinkled with lots of boilerplate code to generate UUIDs in the proper format. Add a helper to testlib so we can reduce this duplicated logic in tests.
Change-Id: I622928911c3f07739fd61f61a58cee2e692c7eeb Signed-off-by: Adam Litke alitke@redhat.com --- M tests/testlib.py 1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/64542/1
diff --git a/tests/testlib.py b/tests/testlib.py index c341c24..b75e7a2 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -28,6 +28,7 @@ import pickle import platform import unittest +import uuid from functools import wraps import shutil import sys @@ -588,3 +589,10 @@ """ while job.active: time.sleep(1) + + +def gen_uuid(): + """ + Return a new UUID in the format used for all vdsm APIs that accept UUIDs. + """ + return str(uuid.uuid4())
gerrit-hooks has posted comments on this change.
Change subject: tests: Add gen_uuid test helper ......................................................................
Patch Set 1:
* update_tracker: OK * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Nir Soffer has posted comments on this change.
Change subject: tests: Add gen_uuid test helper ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/64542/1/tests/testlib.py File tests/testlib.py:
Line 592: Line 593: Line 594: def gen_uuid(): Line 595: """ Line 596: Return a new UUID in the format used for all vdsm APIs that accept UUIDs. Return a new UUID version 4 string... Line 597: """
Nir Soffer has posted comments on this change.
Change subject: tests: Add gen_uuid test helper ......................................................................
Patch Set 1:
(1 comment)
https://gerrit.ovirt.org/#/c/64542/1/tests/testlib.py File tests/testlib.py:
Line 590: while job.active: Line 591: time.sleep(1) Line 592: Line 593: Line 594: def gen_uuid(): uuid_string? uuid_str? make_uuid? Line 595: """ Line 596: Return a new UUID in the format used for all vdsm APIs that accept UUIDs. Line 597: """
Adam Litke has posted comments on this change.
Change subject: tests: Add gen_uuid test helper ......................................................................
Patch Set 1:
(2 comments)
https://gerrit.ovirt.org/#/c/64542/1/tests/testlib.py File tests/testlib.py:
Line 590: while job.active: Line 591: time.sleep(1) Line 592: Line 593: Line 594: def gen_uuid():
uuid_string? uuid_str? make_uuid?
make_uuid Line 595: """ Line 596: Return a new UUID in the format used for all vdsm APIs that accept UUIDs. Line 597: """
Line 592: Line 593: Line 594: def gen_uuid(): Line 595: """ Line 596: Return a new UUID in the format used for all vdsm APIs that accept UUIDs.
Return a new UUID version 4 string...
Done Line 597: """
gerrit-hooks has posted comments on this change.
Change subject: tests: Add make_uuid test helper ......................................................................
Patch Set 2:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Nir Soffer has posted comments on this change.
Change subject: tests: Add make_uuid test helper ......................................................................
Patch Set 2: Code-Review+2
Nir Soffer has posted comments on this change.
Change subject: tests: Add make_uuid test helper ......................................................................
Patch Set 2: Verified+1
Verified by the next patch.
Nir Soffer has submitted this change and it was merged.
Change subject: tests: Add make_uuid test helper ......................................................................
tests: Add make_uuid test helper
The test code is sprinkled with lots of boilerplate code to generate UUIDs in the proper format. Add a helper to testlib so we can reduce this duplicated logic in tests.
Change-Id: I622928911c3f07739fd61f61a58cee2e692c7eeb Signed-off-by: Adam Litke alitke@redhat.com Reviewed-on: https://gerrit.ovirt.org/64542 Reviewed-by: Nir Soffer nsoffer@redhat.com Continuous-Integration: Jenkins CI Tested-by: Nir Soffer nsoffer@redhat.com --- M tests/testlib.py 1 file changed, 8 insertions(+), 0 deletions(-)
Approvals: Nir Soffer: Verified; Looks good to me, approved Jenkins CI: Passed CI tests
gerrit-hooks has posted comments on this change.
Change subject: tests: Add make_uuid test helper ......................................................................
Patch Set 3:
* #64542::Update tracker: OK * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org