diff --git a/coriolis/osmorphing/redhat.py b/coriolis/osmorphing/redhat.py index b2b08ccc..3d0d7d73 100644 --- a/coriolis/osmorphing/redhat.py +++ b/coriolis/osmorphing/redhat.py @@ -235,6 +235,7 @@ def pre_packages_install(self, package_names): def post_packages_install(self, package_names): self._configure_cloud_init() self._run_dracut() + self._set_selinux_autorelabel() super(BaseRedHatMorphingTools, self).post_packages_install( package_names) diff --git a/coriolis/osmorphing/suse.py b/coriolis/osmorphing/suse.py index 9dd4125d..6e0cf06f 100644 --- a/coriolis/osmorphing/suse.py +++ b/coriolis/osmorphing/suse.py @@ -189,6 +189,7 @@ def pre_packages_install(self, package_names): def post_packages_install(self, package_names): self._configure_cloud_init() self._run_dracut() + self._set_selinux_autorelabel() super(BaseSUSEMorphingTools, self).post_packages_install(package_names) def _enable_sles_module(self, module): diff --git a/coriolis/tests/osmorphing/test_redhat.py b/coriolis/tests/osmorphing/test_redhat.py index 761d0725..f2d06f84 100644 --- a/coriolis/tests/osmorphing/test_redhat.py +++ b/coriolis/tests/osmorphing/test_redhat.py @@ -687,17 +687,20 @@ def test_pre_packages_install_has_grubby( mock_yum_clean_all.assert_called_once() mock_yum_install.assert_not_called() + @mock.patch.object( + redhat.BaseRedHatMorphingTools, '_set_selinux_autorelabel') @mock.patch.object(redhat.BaseRedHatMorphingTools, '_configure_cloud_init') @mock.patch.object(redhat.BaseRedHatMorphingTools, '_run_dracut') @mock.patch.object(base.BaseLinuxOSMorphingTools, 'post_packages_install') def test_post_packages_install( self, mock_post_packages_install, mock__run_dracut, - mock__configure_cloud_init): + mock__configure_cloud_init, mock__set_selinux_autorelabel): self.morphing_tools.post_packages_install(self.package_names) mock__configure_cloud_init.assert_called_once() mock__run_dracut.assert_called_once() + mock__set_selinux_autorelabel.assert_called_once() mock_post_packages_install.assert_called_once_with(self.package_names) @mock.patch.object(redhat.BaseRedHatMorphingTools, '_yum_install') diff --git a/coriolis/tests/osmorphing/test_suse.py b/coriolis/tests/osmorphing/test_suse.py index fe0006c7..c6da736a 100644 --- a/coriolis/tests/osmorphing/test_suse.py +++ b/coriolis/tests/osmorphing/test_suse.py @@ -205,17 +205,19 @@ def test__has_systemd_with_exception(self, mock_exec_cmd_chroot): self.assertFalse(result) + @mock.patch.object(suse.BaseSUSEMorphingTools, '_set_selinux_autorelabel') @mock.patch.object(suse.BaseSUSEMorphingTools, '_configure_cloud_init') @mock.patch.object(suse.BaseSUSEMorphingTools, '_run_dracut') @mock.patch.object(base.BaseLinuxOSMorphingTools, 'post_packages_install') def test_post_packages_install( self, mock_post_packages_install, mock__run_dracut, - mock__configure_cloud_init): + mock__configure_cloud_init, mock__set_selinux_autorelabel): self.morphing_tools.post_packages_install(self.package_names) mock__configure_cloud_init.assert_called_once() mock__run_dracut.assert_called_once() + mock__set_selinux_autorelabel.assert_called_once() mock_post_packages_install.assert_called_once_with(self.package_names) @mock.patch.object(base.BaseLinuxOSMorphingTools, '_exec_cmd_chroot')