Merge ~daniel-thewatkins/curtin/+git/curtin:tests into curtin:master

Proposed by Dan Watkins on 2019-10-23
Status: Merged
Approved by: Ryan Harper on 2019-10-23
Approved revision: 14a994fab9281d12561be52670b87e367d84fe54
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~daniel-thewatkins/curtin/+git/curtin:tests
Merge into: curtin:master
Diff against target: 13 lines (+1/-1)
1 file modified
tests/unittests/ (+1/-1)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve on 2019-10-23
Ryan Harper 2019-10-23 Approve on 2019-10-23
Review via email:

Commit message

test_block_dasd: fix random_device_id to only generate valid IDs

Previously we could generate an invalid one iff `random.randint(1,
0x10000)` returned 0x10000.

LP: #1849549

To post a comment you must log in.
Ryan Harper (raharper) wrote :

Thanks! We rolled that number far more often than I thought we would.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/tests/unittests/ b/tests/unittests/
index 97ba77c..95788b0 100644
--- a/tests/unittests/
+++ b/tests/unittests/
@@ -12,7 +12,7 @@ from .helpers import CiTestCase
12def random_device_id():12def random_device_id():
13 return "%x.%x.%04x" % (random.randint(0, 255),13 return "%x.%x.%04x" % (random.randint(0, 255),
14 random.randint(0, 255),14 random.randint(0, 255),
15 random.randint(1, 0x10000))15 random.randint(1, 0x10000 - 1))
18class TestDasdValidDeviceId(CiTestCase):18class TestDasdValidDeviceId(CiTestCase):


People subscribed via source and target branches