← Back to team overview

curtin-dev team mailing list archive

Re: [Merge] ~slyon/curtin:slyon/lp1895192 into curtin:master

 

Review: Needs Fixing

The failures are flake8 related:

03:04:15 tests/unittests/test_curthooks.py:548:80: E501 line too long (104 > 79 characters)
03:04:15 tests/unittests/test_curthooks.py:574:80: E501 line too long (246 > 79 characters)
03:04:15 tests/unittests/test_curthooks.py:588:80: E501 line too long (112 > 79 characters)

Otherwise this seems fine. It might be a bit cleaner to generate the zipl.conf file in block_meta and just copy it over in curthooks, as is done with fstab but that would also be a fair bit more involved. I won't insist on it!

Diff comments:

> diff --git a/tests/unittests/test_curthooks.py b/tests/unittests/test_curthooks.py
> index ca0fc90..a4224a5 100644
> --- a/tests/unittests/test_curthooks.py
> +++ b/tests/unittests/test_curthooks.py
> @@ -543,9 +543,39 @@ class TestSetupZipl(CiTestCase):
>  
>      @patch('curtin.block.get_devices_for_mp')
>      @patch('platform.machine')
> -    def test_setup_zipl_writes_etc_zipl_conf(self, m_machine, m_get_devices):
> +    @patch('curtin.util.subp')
> +    @patch('curtin.commands.block_meta._get_volume_type')
> +    def test_setup_zipl_writes_etc_zipl_conf(self, m_get_volume_type, m_subp, m_machine, m_get_devices):

I wonder if this should mock get_volume_spec rather than subp?

>          m_machine.return_value = 's390x'
>          m_get_devices.return_value = ['/dev/mapper/ubuntu--vg-root']
> +        m_subp.return_value = ('''DEVPATH='/devices/virtual/block/dm-1'
> +DEVNAME='/dev/dm-1'
> +DEVTYPE='disk'
> +MAJOR='253'
> +MINOR='1'
> +SUBSYSTEM='block'
> +USEC_INITIALIZED='34095224'
> +DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG='1'
> +DM_UDEV_PRIMARY_SOURCE_FLAG='1'
> +DM_UDEV_RULES='1'
> +DM_UDEV_RULES_VSN='2'
> +DM_NAME='ubuntu--vg-root'
> +DM_UUID='LVM-HNzpRb1VyhlJwt3nlvXsJH5KTpBUl2LpN08GkOLhEwDmN4an0K13rMAg7eJxxeBT'
> +DM_SUSPENDED='0'
> +DM_VG_NAME='ubuntu-vg'
> +DM_LV_NAME='root'
> +ID_FS_UUID='d1a2762f-133c-4297-af04-14f549376bda'
> +ID_FS_UUID_ENC='d1a2762f-133c-4297-af04-14f549376bda'
> +ID_FS_VERSION='1.0'
> +ID_FS_TYPE='ext4'
> +ID_FS_USAGE='filesystem'
> +DM_TABLE_STATE='LIVE'
> +DM_STATE='ACTIVE'
> +DEVLINKS='/dev/disk/by-id/dm-name-ubuntu--vg-root /dev/mapper/ubuntu--vg-root /dev/ubuntu-vg/root /dev/disk/by-uuid/d1a2762f-133c-4297-af04-14f549376bda /dev/disk/by-id/dm-uuid-LVM-HNzpRb1VyhlJwt3nlvXsJH5KTpBUl2LpN08GkOLhEwDmN4an0K13rMAg7eJxxeBT'
> +TAGS=':systemd:'
> +CURRENT_TAGS=':systemd:'
> +''', None)
> +        m_get_volume_type.return_value = 'lvm'
>          curthooks.setup_zipl(None, self.target)
>          m_get_devices.assert_called_with(self.target)
>          with open(os.path.join(self.target, 'etc', 'zipl.conf')) as stream:


-- 
https://code.launchpad.net/~slyon/curtin/+git/curtin/+merge/406305
Your team curtin developers is subscribed to branch curtin:master.



References