summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2017-05-19 14:57:04 -0400
committerScott Moser <smoser@brickies.net>2017-05-22 16:37:40 -0400
commit3507b59eaa4914ba041f9c7ae987a2cfb036d8b5 (patch)
tree728581fd09b35e746f3f6c22f224ed51564efde1 /tests
parent9fa17d4bc1ef2564e30ab655bf6de462296aecad (diff)
downloadvyos-cloud-init-3507b59eaa4914ba041f9c7ae987a2cfb036d8b5.tar.gz
vyos-cloud-init-3507b59eaa4914ba041f9c7ae987a2cfb036d8b5.zip
disk_setup: fix several issues with gpt disk partitions.
This fixes several shortcomings of disk_setup with gpt disks. * 'sgdisk -p' was being used to determine the size of a disk. this can fail if it believes there is a bad gpt partition table. Instead we just use blockdev now for both mbr or gpt disks. * parsing of sgdisk -p output assumed that the 'name' of the partition type would not have any spaces (Microsoft basic data) * interaction with sgdisk did not realize that sgdisk wants input of '8300' rather than '83' and will output the same. LP: #1692087
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_handler/test_handler_disk_setup.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unittests/test_handler/test_handler_disk_setup.py b/tests/unittests/test_handler/test_handler_disk_setup.py
index 35dff3ee..e3226978 100644
--- a/tests/unittests/test_handler/test_handler_disk_setup.py
+++ b/tests/unittests/test_handler/test_handler_disk_setup.py
@@ -66,7 +66,7 @@ class TestGetMbrHddSize(TestCase):
size_in_sectors = size_in_bytes / sector_size
self._configure_subp_mock(size_in_bytes, sector_size)
self.assertEqual(size_in_sectors,
- cc_disk_setup.get_mbr_hdd_size('/dev/sda1'))
+ cc_disk_setup.get_hdd_size('/dev/sda1'))
def test_size_for_512_byte_sectors(self):
self._test_for_sector_size(512)