Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test aosp atd emulators #9058

Draft
wants to merge 68 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
70a324c
Try the new aosp_atd emulators
dellis1972 Nov 29, 2023
7e8b85f
revert to default for api 33 emulator
dellis1972 Nov 30, 2023
33b3e99
Test a Container
dellis1972 Jan 10, 2024
020b6d1
ff
dellis1972 Jan 10, 2024
f3a15f3
ff
dellis1972 Jan 10, 2024
5ba6aee
ff
dellis1972 Jan 10, 2024
af2a894
ff
dellis1972 Jan 10, 2024
d890852
ff
dellis1972 Jan 11, 2024
4f2563d
ff
dellis1972 Jan 11, 2024
8655176
ff
dellis1972 Jan 11, 2024
3217ffe
ff
dellis1972 Jan 11, 2024
a3b2360
ff
dellis1972 Jan 11, 2024
5a93c58
ff
dellis1972 Jan 11, 2024
64cc751
ff
dellis1972 Jan 11, 2024
8aa3fdb
ff
dellis1972 Jan 11, 2024
b8a0679
ff
dellis1972 Jan 11, 2024
95650fa
ff
dellis1972 Jan 11, 2024
78b8224
ff
dellis1972 Jan 11, 2024
495b84f
ff
dellis1972 Jan 11, 2024
2c12fef
try adding kernel stuff
dellis1972 Feb 1, 2024
42b39c9
try adding kernel stuff
dellis1972 Feb 1, 2024
0d4d469
try adding kernel stuff
dellis1972 Feb 1, 2024
be99c56
Update to use aosp_atd again
dellis1972 Apr 16, 2024
b7e10ad
use aops_atd for nightly api 33
dellis1972 Apr 16, 2024
8d68868
fix build error
dellis1972 Apr 16, 2024
c21e556
update documentation url for aosp_atd images
dellis1972 Apr 17, 2024
772fa75
ff
dellis1972 Apr 17, 2024
927429a
diagnostics
dellis1972 Apr 17, 2024
1d37e7b
use aosp_atd for Nightly builds
dellis1972 Apr 19, 2024
7d43e63
use pool
dellis1972 Jun 26, 2024
92e2bc9
try this
dellis1972 Jun 26, 2024
ef32d81
try this
dellis1972 Jun 26, 2024
07cfc9a
try this
dellis1972 Jun 26, 2024
bf948e8
try this
dellis1972 Jun 26, 2024
b10940e
try this
dellis1972 Jun 27, 2024
5d6f56f
try this
dellis1972 Jun 27, 2024
9fcf34f
try this
dellis1972 Jun 27, 2024
6e5cdba
try this
dellis1972 Jun 27, 2024
d066e6f
try this
dellis1972 Jun 27, 2024
c034dca
try this
dellis1972 Jun 27, 2024
543d4fe
try this
dellis1972 Jun 27, 2024
c3a43d1
try this
dellis1972 Jun 27, 2024
47b3381
try this
dellis1972 Jun 27, 2024
de2f163
try this
dellis1972 Jun 27, 2024
c51ea0e
try this
dellis1972 Jun 27, 2024
2d90438
try this
dellis1972 Jun 27, 2024
2bfeb45
try this
dellis1972 Jun 27, 2024
b59f539
try this
dellis1972 Jun 27, 2024
83df7b7
try this
dellis1972 Jun 27, 2024
10c2bca
try this
dellis1972 Jun 27, 2024
9a1c5b8
try this
dellis1972 Jun 28, 2024
fbea3dd
try this
dellis1972 Jun 28, 2024
a85a547
try this
dellis1972 Jun 28, 2024
a91f5c1
try this
dellis1972 Jun 28, 2024
5f8595d
try this
dellis1972 Jun 28, 2024
55cd762
try this
dellis1972 Jun 28, 2024
16d898c
add a Docker file and test it under windows
dellis1972 Jun 28, 2024
e388dfe
try this
dellis1972 Jun 28, 2024
ca9c735
try this
dellis1972 Jun 28, 2024
b5574f4
try this
dellis1972 Jun 28, 2024
c3b7a11
ff
dellis1972 Jul 1, 2024
365f6ff
ff
dellis1972 Jul 1, 2024
7bb648e
ff
dellis1972 Jul 1, 2024
1962650
ff
dellis1972 Jul 1, 2024
bed6c1d
ff
dellis1972 Jul 2, 2024
07a4c95
ff
dellis1972 Jul 2, 2024
f3bfeaa
ff
dellis1972 Jul 2, 2024
27782c7
ff
dellis1972 Jul 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build-tools/automation/azure-pipelines-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ stages:
Android30-x86_64:
avdApiLevel: 30
avdAbi: x86_64
avdType: default
avdType: aosp_atd
Android31-x86_64:
avdApiLevel: 31
avdAbi: x86_64
avdType: default
avdType: aosp_atd
Android33-x86_64:
avdApiLevel: 33
avdAbi: x86_64
avdType: google_apis
avdType: aosp_atd
pool:
vmImage: $(HostedMacImage)
workspace:
Expand Down
130 changes: 130 additions & 0 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,136 @@ extends:

- template: /build-tools/automation/yaml-templates/build-linux.yaml@self

- stage: TestContainer
displayName: Test Container
jobs:
- job: Test
pool:
name: MAUI-1ESPT
image: $(LinuxPoolImage1ESPT)
os: linux
timeoutInMinutes: 180
workspace:
clean: all
steps:
- script: |
printenv
whoami
curl -h
sudo -h
grep -c -w "vmx\|svm" /proc/cpuinfo
find /dev -name kvm
displayName: Display Environment
- script: |
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "platform-tools"
displayName: Install platfom-tools
- template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self

- script: |
sudo apt-get install curl ca-certificates -y
curl https://repo.waydro.id | sudo bash
sudo apt-get install waydroid -y
displayName: Install WayDroid
- script: |
sudo apt install linux-generic -y
sudo apt install --reinstall linux-image-$(uname -r) -y
sudo apt install --reinstall linux-modules-$(uname -r) -y
sudo apt install --reinstall linux-modules-extra-$(uname -r) -y
sudo apt install -y dbus-x11
sudo apt install weston
sudo apt install xvfb
displayName: Install Kernel Stuff
- script: |
export $(dbus-launch)
export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir
mkdir "${XDG_RUNTIME_DIR}"
chmod 0700 "${XDG_RUNTIME_DIR}"
sudo waydroid init -f
displayName: waydroid init -f
- script: |
export $(dbus-launch)
export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir
sudo waydroid init
displayName: waydroid init
- script: |
export $(dbus-launch)
export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir
xvfb-run weston -B headless-backend.so --width=1024 --height=768 --xwayland &
sleep 10
displayName: Start Weston
- script: |
export $(dbus-launch)
export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir
sudo waydroid container start &
sleep 10
displayName: Start Container
- script: |
export $(dbus-launch)
export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir
waydroid session start &
sleep 10
displayName: Start waydroid
- bash: |
ipAddress=$(sudo waydroid shell ip addr show eth0 | grep "inet " | awk '{print $2}' | cut -d/ -f1)
done=0
while [ -z "$ipAddress" ]; do
if [ $done == '180' ]; then
break
fi
echo "Waiting for waydroid to start"
sleep 1
ipAddress=$(sudo waydroid shell ip addr show eth0 | grep "inet " | awk '{print $2}' | cut -d/ -f1)
((done++))
done
echo "Waydroid started with ip address: $ipAddress"
$ANDROID_HOME/platform-tools/adb connect $ipAddress:5555
displayName: Wait for waydroid
- script: |
$ANDROID_HOME/platform-tools/adb devices
# $ANDROID_HOME/platform-tools/adb shell getprop
# $ANDROID_HOME/platform-tools/adb shell screencap /data/local/tmp/screenshot.png
# $ANDROID_HOME/platform-tools/adb pull /data/local/tmp/screenshot.png $(Build.StagingDirectory)/screenshot.png
# $ANDROID_HOME/platform-tools/adb exec-out uiautomator dump /dev/tty > $(Build.StagingDirectory)/ui.xml
displayName: Logging
#- script: |
# $ANDROID_HOME/platform-tools/adb shell settings put global development_settings_enabled 1
# displayName: adb developer mode
- template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self
parameters:
project: samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj
arguments: >-
-t:Install -c Release -tl:off -v:diag
-p:DotNetPreviewTool=$(System.DefaultWorkingDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet
displayName: Test Install
continueOnError: true
- template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self
parameters:
project: samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj
arguments: >-
-t:Run -c Release -tl:off -v:diag
-p:DotNetPreviewTool=$(System.DefaultWorkingDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet
displayName: Test Run
continueOnError: true
- script: |
$ANDROID_HOME/platform-tools/adb devices
displayName: Capture Output
- script: |
$ANDROID_HOME/platform-tools/adb shell screencap /data/local/tmp/screenshot.png
displayName: Capture Screenshot
- script: |
$ANDROID_HOME/platform-tools/adb pull /data/local/tmp/screenshot.png $(Build.StagingDirectory)/screenshot1.png
displayName: copy screen shot
- script: |
waydroid session stop
sudo waydroid container stop
displayName: Stop WayDroid
- template: /build-tools/automation/yaml-templates/publish-artifact.yaml@self
parameters:
displayName: upload container tests
artifactName: Test Results - Container
targetPath: $(Build.StagingDirectory)
#condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true'))

- stage: smoke_tests
displayName: Package Tests
dependsOn: mac_build
Expand Down
1 change: 1 addition & 0 deletions build-tools/scripts/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RUN apk add bash sudo shadow
4 changes: 2 additions & 2 deletions build-tools/scripts/TestApks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<PropertyGroup>
<!-- APK tests might run on 32-bit emulators -->
<RuntimeIdentifiers>android-arm64;android-x86;android-x64;</RuntimeIdentifiers>
<TestAvdApiLevel Condition=" '$(TestAvdApiLevel)' == '' ">29</TestAvdApiLevel>
<TestAvdApiLevel Condition=" '$(TestAvdApiLevel)' == '' ">33</TestAvdApiLevel>
<TestAvdAbi Condition=" '$(TestAvdAbi)' == '' and '$(HostOS)' == 'Darwin' and '$(HostOSArchitecture)' == 'Arm64' ">arm64-v8a</TestAvdAbi>
<TestAvdAbi Condition=" '$(TestAvdAbi)' == '' ">x86_64</TestAvdAbi>
<TestAvdType Condition=" '$(TestAvdType)' == '' ">default</TestAvdType>
<TestAvdType Condition=" '$(TestAvdType)' == '' ">aosp_atd</TestAvdType>
<TestAvdForceCreation Condition=" '$(TestAvdForceCreation)' == '' ">true</TestAvdForceCreation>
<TestAvdShowWindow Condition=" '$(TestAvdShowWindow)' == '' and '$(RunningOnCI)' == 'true' ">false</TestAvdShowWindow>
<TestAvdExtraBootArgs Condition=" '$(TestAvdShowWindow)' == 'false' ">-no-window -no-boot-anim $(TestAvdExtraBootArgs)</TestAvdExtraBootArgs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public AndroidToolchain ()
//
// https://dl-ssl.google.com/android/repository/sys-img/android/sys-img2-1.xml
// https://dl-ssl.google.com/android/repository/sys-img/google_apis/sys-img2-1.xml
// https://dl-ssl.google.com/android/repository/sys-img/aosp_atd/sys-img2-1.xml
// * system images
//
Components = new List<AndroidToolchainComponent> {
Expand Down Expand Up @@ -97,6 +98,12 @@ public AndroidToolchain ()
pkgRevision: "8",
dependencyType: AndroidToolchainComponentType.EmulatorDependency
),
new AndroidToolchainComponent (isArm64Apple ? $"{systemImageArch}-33_r02" : $"{systemImageArch}-33_r02",
destDir: Path.Combine ("system-images", "android-33", "aosp_atd", systemImageArch),
relativeUrl: new Uri ("sys-img/aosp_atd/", UriKind.Relative),
pkgRevision: "2",
dependencyType: AndroidToolchainComponentType.EmulatorDependency
),
new AndroidToolchainComponent ($"android-ndk-r{AndroidNdkVersion}-{osTag}",
destDir: AndroidNdkDirectory,
pkgRevision: AndroidPkgRevision,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void Check (Context context, string packageCacheDir, string sdkRoot, AndroidTool
Component = component,
PackageName = packageName,
Url = GetPackageUrl (component, packageName),
LocalPackagePath = Path.Combine (packageCacheDir, packageName),
LocalPackagePath = Path.Combine (packageCacheDir, component.RelativeUrl?.ToString () ?? string.Empty, packageName),
DestinationDir = GetDestinationDir (component, sdkRoot),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,14 @@ public void AssertHasDevices (bool fail = true)
[OneTimeSetUp]
public void DeviceSetup ()
{
TestContext.Out.WriteLine ($"LOG DeviceSetup: Enter!!!");
Console.WriteLine ($"LOG DeviceSetup: Enter Console!!!");
if (!string.IsNullOrEmpty (DeviceAbi))
return;
if (IsDeviceAttached ()) {
try {
DeviceSdkVersion = GetSdkVersion ();
TestContext.Out.WriteLine ($"LOG DeviceSetup: {DeviceSdkVersion}");
if (DeviceSdkVersion != -1) {
if (DeviceSdkVersion >= 21)
DeviceAbi = RunAdbCommand ("shell getprop ro.product.cpu.abilist64").Trim ();
Expand Down
Loading