~maas-committers/maas/2.0

« back to all changes in this revision

Viewing changes to src/maasserver/models/tests/test_bootresourceset.py

  • Committer: MAAS Lander
  • Author(s): Blake Rouse
  • Date: 2016-07-21 17:25:42 UTC
  • mfrom: (5169.1.1 fix-1604465-2.0)
  • Revision ID: maas_lander-20160721172542-19ek99lh31mq4wh6
[r=blake-rouse][bug=1604465][author=blake-rouse] Add size to the largefile model. Add migration that fills in the size on all largefiles that already exist in MAAS. Update the current size field when images are imported. Use aggragated queries in boot resource code to speep up the database queries. Adjust image status interval check to every 30 seconds from 10 seconds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
        self.assertEqual(0, resource_set.progress)
136
136
        for _ in range(total_size):
137
137
            stream.write(b"a")
 
138
            largefile.size += 1
 
139
            largefile.save()
138
140
            current_size += 1
139
141
            self.assertAlmostEqual(
140
142
                100.0 * current_size / float(total_size),