~lool/linaro-image-tools/efikamx

« back to all changes in this revision

Viewing changes to linaro_media_create/tests/test_media_create.py

  • Committer: Loïc Minier
  • Date: 2011-02-10 19:08:06 UTC
  • mfrom: (285.2.11 part-size-rework)
  • Revision ID: lool@dooz.org-20110210190806-baves2btz9pab1o2
Merge lp:~lool/linaro-image-tools/part-size-rework; fixes various issues with
the partition-handling code; prepares the ground for aligned partitions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
722
722
            [129024L, 32256L, 10321920L, 161280L],
723
723
            [vfat_size, vfat_offset, linux_size, linux_offset])
724
724
 
 
725
    def test_partition_numbering(self):
 
726
        # another Linux partition after the boot/root parts
 
727
        tempfile = self._create_qemu_img_with_partitions(
 
728
            ',1,0x0C,*\n,1,,-\n,,,-')
 
729
        vfat_size, vfat_offset, linux_size, linux_offset = (
 
730
            calculate_partition_size_and_offset(tempfile))
 
731
        # check that the linux partition offset starts on second cylinder so
 
732
        # that it's the partition immediately following the vfat one
 
733
        self.assertEqual(linux_offset, 5 * 63 * 512)
 
734
 
725
735
    def test_get_boot_and_root_partitions_for_media_beagle(self):
726
736
        self.useFixture(MockSomethingFixture(
727
737
            partitions, '_get_device_file_for_partition_number',
829
839
            'root', 'ext3', True, True, True)
830
840
        self.assertEqual(
831
841
             # This is the call that would create the image file.
832
 
            [['qemu-img', 'create', '-f', 'raw', tempfile, '2G'],
 
842
            [['qemu-img', 'create', '-f', 'raw', tempfile, '2147483648'],
833
843
             # This call would partition the image file.
834
844
             ['sudo', 'sfdisk', '-D', '-H', '255', '-S', '63', '-C', '261',
835
845
              tempfile],