Skip to content

Commit

Permalink
[ci] Add API-33 to the nightly build (#7552)
Browse files Browse the repository at this point in the history
Fixes: #7490

Add API-33 to the nightly build tests.  Note that the `default` image
is not available so we have to use the `google_apis` image instead. 

Also it seems that under API-33 dotnet is unable to get the hardware
address of the network adapters.  As a result the tests which compare
these were failing.

Ignore the hardware address check on API-33, while continuing to
check other aspects of the network adapters.

API-34+ will *not* ignore the hardware address check.  This will be
reconsidered when API-34 actually exists.
  • Loading branch information
dellis1972 authored Nov 21, 2022
1 parent ba08edc commit 672a784
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build-tools/automation/azure-pipelines-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ stages:
avdApiLevel: 31
avdAbi: x86_64
avdType: default
Android33-x86_64:
avdApiLevel: 33
avdAbi: x86_64
avdType: google_apis
pool:
vmImage: $(HostedMacImage)
workspace:
Expand Down
4 changes: 4 additions & 0 deletions tests/Mono.Android-Tests/System.Net/NetworkInterfaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ bool AddressesAreEqual (List <IPAddress> one, List <IPAddress> two)

bool HardwareAddressesAreEqual (byte[] one, byte[] two)
{
// Under API 33 .Net doesn't return the hardware address. So we need to ignore it
if (Android.OS.Build.VERSION.SdkInt == Android.OS.BuildVersionCodes.Tiramisu)
return true;
if (one == two)
return true;
if (one == null || two == null)
Expand Down Expand Up @@ -184,6 +187,7 @@ byte[] GetHardwareAddress (MNetworkInterface inf)
// if all the bytes are zero return null like Java does.
if (bytes.All (x => x == 0))
return null;

return bytes;
}

Expand Down

0 comments on commit 672a784

Please sign in to comment.