コード例 #1
0
ファイル: test_init.py プロジェクト: cloud-init/cloud-init
    def test_apply_v2_renames(self, m_rename_interfaces, m_device_driver,
                              m_device_devid):
        m_device_driver.return_value = 'virtio_net'
        m_device_devid.return_value = '0x15d8'

        net.apply_network_config_names(yaml.load(self.V2_CONFIG))

        call = ['52:54:00:12:34:00', 'interface0', 'virtio_net', '0x15d8']
        m_rename_interfaces.assert_called_with([call])
コード例 #2
0
    def test_apply_v2_renames(self, m_rename_interfaces, m_device_driver,
                              m_device_devid):
        m_device_driver.return_value = 'virtio_net'
        m_device_devid.return_value = '0x15d8'

        net.apply_network_config_names(yaml.load(self.V2_CONFIG))

        call = ['52:54:00:12:34:00', 'interface0', 'virtio_net', '0x15d8']
        m_rename_interfaces.assert_called_with([call])
コード例 #3
0
 def test_apply_v2_renames_raises_runtime_error_on_unknown_version(self):
     with self.assertRaises(RuntimeError):
         net.apply_network_config_names(yaml.load("version: 3"))
コード例 #4
0
 def test_apply_v2_renames_skips_without_mac(self, m_rename_interfaces):
     net.apply_network_config_names(yaml.load(self.V2_CONFIG_NO_MAC))
     m_rename_interfaces.assert_called_with([])
コード例 #5
0
 def apply_network_config_names(self, netconfig):
     net.apply_network_config_names(netconfig)
コード例 #6
0
ファイル: networking.py プロジェクト: waquidvp/cloud-init
 def apply_network_config_names(self, netcfg: NetworkConfig) -> None:
     return net.apply_network_config_names(netcfg)
コード例 #7
0
ファイル: __init__.py プロジェクト: larsks/cloud-init
 def apply_network_config_names(self, netconfig):
     net.apply_network_config_names(netconfig)
コード例 #8
0
ファイル: test_init.py プロジェクト: cloud-init/cloud-init
 def test_apply_v2_renames_raises_runtime_error_on_unknown_version(self):
     with self.assertRaises(RuntimeError):
         net.apply_network_config_names(yaml.load("version: 3"))
コード例 #9
0
ファイル: test_init.py プロジェクト: cloud-init/cloud-init
 def test_apply_v2_renames_skips_without_mac(self, m_rename_interfaces):
     net.apply_network_config_names(yaml.load(self.V2_CONFIG_NO_MAC))
     m_rename_interfaces.assert_called_with([])