Commit d0cde2fa authored by Oleh Lamzin's avatar Oleh Lamzin Committed by Commit Bot

chromeos: Use correct NotSupported shill error name

Use correct shill::kErrorResultNotSupported instead of
NetworkDeviceHandler::kErrorNotSupported to handle failure to change USB
Ethernet MAC address source.

BUG=b:143695438
TEST=unittests
TEST=manual verify on device that we handling correct error

Change-Id: Ida9103e28857c795c33c7311509bce95fd2f5f9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1908540Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Oleh Lamzin <lamzin@google.com>
Cr-Commit-Position: refs/heads/master@{#714422}
parent f8dd1ecf
...@@ -586,7 +586,7 @@ void NetworkDeviceHandlerImpl::OnSetUsbEthernetMacAddressSourceError( ...@@ -586,7 +586,7 @@ void NetworkDeviceHandlerImpl::OnSetUsbEthernetMacAddressSourceError(
const std::string& shill_error_message) { const std::string& shill_error_message) {
HandleShillCallFailure(device_path, error_callback, shill_error_name, HandleShillCallFailure(device_path, error_callback, shill_error_name,
shill_error_message); shill_error_message);
if (shill_error_name == NetworkDeviceHandler::kErrorNotSupported && if (shill_error_name == shill::kErrorResultNotSupported &&
mac_address_source == usb_ethernet_mac_address_source_) { mac_address_source == usb_ethernet_mac_address_source_) {
mac_address_change_not_supported_.insert(device_mac_address); mac_address_change_not_supported_.insert(device_mac_address);
ApplyUsbEthernetMacAddressSourceToShill(); ApplyUsbEthernetMacAddressSourceToShill();
......
...@@ -310,8 +310,8 @@ TEST_F(NetworkDeviceHandlerTest, UsbEthernetMacAddressSourceNotSupported) { ...@@ -310,8 +310,8 @@ TEST_F(NetworkDeviceHandlerTest, UsbEthernetMacAddressSourceNotSupported) {
shill::kUsbEthernetMacAddressSourceProperty, shill::kUsbEthernetMacAddressSourceProperty,
base::Value(kSourceToOverride), base::Value(kSourceToOverride),
/*notify_changed=*/true); /*notify_changed=*/true);
device_test->SetUsbEthernetMacAddressSourceError(kUsbEthernetDevicePath, device_test->SetUsbEthernetMacAddressSourceError(
"not-supported"); kUsbEthernetDevicePath, shill::kErrorResultNotSupported);
network_device_handler_->SetUsbEthernetMacAddressSource("some_source1"); network_device_handler_->SetUsbEthernetMacAddressSource("some_source1");
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
...@@ -356,8 +356,8 @@ TEST_F(NetworkDeviceHandlerTest, UsbEthernetMacAddressSource) { ...@@ -356,8 +356,8 @@ TEST_F(NetworkDeviceHandlerTest, UsbEthernetMacAddressSource) {
device_test->SetDeviceProperty(kUsbEthernetDevicePath2, device_test->SetDeviceProperty(kUsbEthernetDevicePath2,
shill::kLinkUpProperty, base::Value(true), shill::kLinkUpProperty, base::Value(true),
/*notify_changed=*/true); /*notify_changed=*/true);
device_test->SetUsbEthernetMacAddressSourceError(kUsbEthernetDevicePath2, device_test->SetUsbEthernetMacAddressSourceError(
"not-supported"); kUsbEthernetDevicePath2, shill::kErrorResultNotSupported);
constexpr char kUsbEthernetDevicePath3[] = "usb_ethernet_device3"; constexpr char kUsbEthernetDevicePath3[] = "usb_ethernet_device3";
device_test->AddDevice(kUsbEthernetDevicePath3, shill::kTypeEthernet, "eth3"); device_test->AddDevice(kUsbEthernetDevicePath3, shill::kTypeEthernet, "eth3");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment