← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~goneri/cloud-init:freebsd_nocloud into cloud-init:master

 

added 2 comments - don't understand that in detail yet...

Diff comments:

> diff --git a/tests/unittests/test_datasource/test_nocloud.py b/tests/unittests/test_datasource/test_nocloud.py
> index b785362..7053da5 100644
> --- a/tests/unittests/test_datasource/test_nocloud.py
> +++ b/tests/unittests/test_datasource/test_nocloud.py
> @@ -278,6 +278,27 @@ class TestNoCloudDataSource(CiTestCase):
>          self.assertEqual(netconf, dsrc.network_config)
>          self.assertNotIn(gateway, str(dsrc.network_config))
>  
> +    @mock.patch("cloudinit.util.blkid")
> +    def test_nocloud_get_devices_freebsd(self, m_is_lxd, fake_blkid):
> +        populate_dir(os.path.join(self.paths.seed_dir, "nocloud"),
> +                     {'user-data': b"ud", 'meta-data': "instance-id: IID\n"})
> +
> +        sys_cfg = {'datasource': {'NoCloud': {'fs_label': None}}}
> +
> +        self.mocks.enter_context(
> +            mock.patch.object(util, 'is_FreeBSD', return_value=True))
> +
> +        self.mocks.enter_context(
> +            mock.patch.object(os.path, 'exists', return_value=True))
> +
> +        self.mocks.enter_context(
> +            mock.patch.object(os.path, 'exists', return_value=True))

why is the same done twice here?

> +
> +        dsrc = dsNoCloud(sys_cfg=sys_cfg, distro=None, paths=self.paths)

shouldn't that be initiated with distro = FreeBSD or something similar?

> +        ret = dsrc._get_devices('foo')
> +        self.assertEqual(['/dev/msdosfs/foo', '/dev/iso9660/foo'], ret)
> +        fake_blkid.assert_not_called()
> +
>  
>  class TestParseCommandLineData(CiTestCase):
>  


-- 
https://code.launchpad.net/~goneri/cloud-init/+git/cloud-init/+merge/365630
Your team cloud-init commiters is requested to review the proposed merge of ~goneri/cloud-init:freebsd_nocloud into cloud-init:master.


References