~maas-deployers/maas-deployer/next

« back to all changes in this revision

Viewing changes to maas_deployer/tests/maasclient/test_bootimages.py

  • Committer: billy.olsen at canonical
  • Date: 2015-12-15 18:10:00 UTC
  • mfrom: (55.1.1 next)
  • Revision ID: billy.olsen@canonical.com-20151215181000-qhr9mg2howt9wtys
[billy-olsen,r=hopem] Fix faulty sequence generator.

The sequence number generator for the boot images polling request could
only perform 4096 queries before failing. This changes that to simply
be a forever incrementing generator.

Closes-Bug: LP #1487938

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Copyright 2015 Canonical, Ltd.
 
3
#
 
4
# Unit tests for maasclient's bootimages
 
5
 
 
6
import unittest
 
7
 
 
8
from maas_deployer.vmaas.maasclient import bootimages
 
9
 
 
10
 
 
11
class TestBootImages(unittest.TestCase):
 
12
 
 
13
    def test_sequence_no(self):
 
14
        sequence = bootimages.sequence_no(1)
 
15
        for i in xrange(500, 1000000):
 
16
            sequence.next()