tests/unittests/test_handler/test_handler_ntp.py::TestNtp::test_ntp_handler_real_distro_ntp_templates distro=alpine client=ntp
distro=debian client=ntp
distro=fedora client=ntp
distro=opensuse client=ntp
distro=photon client=ntp
distro=rhel client=ntp
distro=sles client=ntp
distro=ubuntu client=ntp
distro=alpine client=chrony
distro=debian client=chrony
distro=fedora client=chrony
distro=opensuse client=chrony
distro=photon client=chrony
distro=rhel client=chrony
distro=sles client=chrony
distro=ubuntu client=chrony
PASSED
tests/unittests/test_handler/test_handler_ntp.py::TestNtp::test_ntp_handler_schema_validation_allows_empty_ntp_config FAILED

====================================================================== FAILURES ======================================================================
_________________________________________ TestNtp.test_ntp_handler_schema_validation_allows_empty_ntp_config _________________________________________

self = <tests.unittests.test_handler.test_handler_ntp.TestNtp testMethod=test_ntp_handler_schema_validation_allows_empty_ntp_config>
m_select = <MagicMock name='select_ntp_client' id='140374295711408'>

    @mock.patch('cloudinit.config.cc_ntp.select_ntp_client')
    def test_ntp_handler_schema_validation_allows_empty_ntp_config(self,
                                                                   m_select):
        """Ntp schema validation allows for an empty ntp: configuration."""
        valid_empty_configs = [{'ntp': {}}, {'ntp': None}]
        for valid_empty_config in valid_empty_configs:
            for distro in cc_ntp.distros:
                mycloud = self._get_cloud(distro)
                ntpconfig = self._mock_ntp_client_config(distro=distro)
                confpath = ntpconfig['confpath']
                m_select.return_value = ntpconfig
>               cc_ntp.handle('cc_ntp', valid_empty_config, mycloud, None, [])

tests/unittests/test_handler/test_handler_ntp.py:351:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cloudinit/config/cc_ntp.py:594: in handle
    install_ntp_client(cloud.distro.install_packages,
cloudinit/config/cc_ntp.py:381: in install_ntp_client
    install_func(packages)
cloudinit/distros/photon.py:89: in install_packages
    self.package_command('install', pkgs=pkglist)
cloudinit/distros/photon.py:318: in package_command
    subp(cmd, capture=False)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tests.unittests.test_distros.test_netconfig.TestNetCfgDistroPhoton testMethod=test_photon_network_config_v1>
args = (['tdnf', '-y', 'install', 'ntp'],), kwargs = {'capture': False}, cmd = 'tdnf', pass_through = False

    def _fake_subp(self, *args, **kwargs):
        if 'args' in kwargs:
            cmd = kwargs['args']
        else:
            if not args:
                raise TypeError(
                    "subp() missing 1 required positional argument: 'args'")
            cmd = args[0]

        if not isinstance(cmd, str):
            cmd = cmd[0]
        pass_through = False
        if not isinstance(self.allowed_subp, (list, bool)):
            raise TypeError("self.allowed_subp supports list or bool.")
        if isinstance(self.allowed_subp, bool):
            pass_through = self.allowed_subp
        else:
            pass_through = (
                (cmd in self.allowed_subp) or
                (self.SUBP_SHELL_TRUE in self.allowed_subp and
                 kwargs.get('shell')))
        if pass_through:
            return _real_subp(*args, **kwargs)
>       raise Exception(
            "called subp. set self.allowed_subp=True to allow\n subp(%s)" %
            ', '.join([str(repr(a)) for a in args] +
                      ["%s=%s" % (k, repr(v)) for k, v in kwargs.items()]))
E       Exception: called subp. set self.allowed_subp=True to allow
E        subp(['tdnf', '-y', 'install', 'ntp'], capture=False)

cloudinit/tests/helpers.py:165: Exception
================================================================== warnings summary ==================================================================
../../usr/lib/python3.9/site-packages/_pytest/config/__init__.py:1183
  /usr/lib/python3.9/site-packages/_pytest/config/__init__.py:1183: PytestDeprecationWarning: The --strict option is deprecated, use --strict-markers instead.
    self.issue_config_time_warning(

conftest.py:68
  /root/cloud-init.git/conftest.py:68: PytestDeprecationWarning: @pytest.yield_fixture is deprecated.
  Use @pytest.fixture instead; they are the same.
    @pytest.yield_fixture(autouse=True)

conftest.py:169
  /root/cloud-init.git/conftest.py:169: PytestDeprecationWarning: @pytest.yield_fixture is deprecated.
  Use @pytest.fixture instead; they are the same.
    def httpretty():

cloudinit/patcher.py:9
  /root/cloud-init.git/cloudinit/patcher.py:9: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp

-- Docs: https://docs.pytest.org/en/stable/warnings.html
============================================================== short test summary info ===============================================================
FAILED tests/unittests/test_handler/test_handler_ntp.py::TestNtp::test_ntp_handler_schema_validation_allows_empty_ntp_config - Exception: called su...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================== 1 failed, 1613 passed, 10 skipped, 4 warnings in 29.48s ===============================================
