def test_configure_network(self): """ Test if it configure Network Interface """ with patch( "salt.modules.ilo.__execute_cmd", MagicMock(return_value={"Configure_Network": {}}), ): ret = { "Network Settings": { "IP_ADDRESS": { "VALUE": "10.0.0.10" }, "SUBNET_MASK": { "VALUE": "255.255.255.0" }, "GATEWAY_IP_ADDRESS": { "VALUE": "10.0.0.1" }, } } with patch.object(ilo, "network", return_value=ret): self.assertTrue( ilo.configure_network("10.0.0.10", "255.255.255.0", "10.0.0.1")) with patch.object(ilo, "network", return_value=ret): with patch.object(ilo, "__execute_cmd", return_value={"Network Settings": {}}): self.assertDictEqual( ilo.configure_network("10.0.0.100", "255.255.255.10", "10.0.0.10"), {"Network Settings": {}}, )
def test_configure_network(self): ''' Test if it configure Network Interface ''' with patch('salt.modules.ilo.__execute_cmd', MagicMock(return_value={'Configure_Network': {}})): ret = { 'Network Settings': { 'IP_ADDRESS': { 'VALUE': '10.0.0.10' }, 'SUBNET_MASK': { 'VALUE': '255.255.255.0' }, 'GATEWAY_IP_ADDRESS': { 'VALUE': '10.0.0.1' } } } with patch.object(ilo, 'network', return_value=ret): self.assertTrue( ilo.configure_network('10.0.0.10', '255.255.255.0', '10.0.0.1')) with patch.object(ilo, 'network', return_value=ret): with patch.object(ilo, '__execute_cmd', return_value={'Network Settings': {}}): self.assertDictEqual( ilo.configure_network('10.0.0.100', '255.255.255.10', '10.0.0.10'), {'Network Settings': {}})
def test_configure_network(self): ''' Test if it configure Network Interface ''' ret = {'Network Settings': {'IP_ADDRESS': {'VALUE': '10.0.0.10'}, 'SUBNET_MASK': {'VALUE': '255.255.255.0'}, 'GATEWAY_IP_ADDRESS': {'VALUE': '10.0.0.1'}}} with patch.object(ilo, 'network', return_value=ret): self.assertTrue(ilo.configure_network('10.0.0.10', '255.255.255.0', '10.0.0.1')) with patch.object(ilo, 'network', return_value=ret): with patch.object(ilo, '__execute_cmd', return_value={'Network Settings': {}}): self.assertDictEqual(ilo.configure_network('10.0.0.100', '255.255.255.10', '10.0.0.10'), {'Network Settings': {}})