mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
adds java dependency for macos and moves some tests to a separate FreeBSD configuration
This commit is contained in:
@@ -5,5 +5,5 @@
|
||||
|
||||
- name: delete_newroot
|
||||
file:
|
||||
path: "{{ newroot.path }}"
|
||||
path: "{{ ansible_env.HOME }}/newroot"
|
||||
state: absent
|
||||
@@ -0,0 +1,98 @@
|
||||
---
|
||||
# Copyright (c) Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
- name: Accept all licenses
|
||||
shell: 'yes | sdkmanager --licenses'
|
||||
changed_when: false
|
||||
|
||||
- name: Install build-tools;34.0.0
|
||||
android_sdk:
|
||||
name: build-tools;34.0.0
|
||||
state: present
|
||||
register: build_tools_installed
|
||||
|
||||
- name: Install build-tools;34.0.0 second time
|
||||
android_sdk:
|
||||
name: build-tools;34.0.0
|
||||
state: present
|
||||
register: build_tools_installed2
|
||||
|
||||
- name: Stat build-tools
|
||||
stat:
|
||||
path: "{{ android_sdk_location }}/build-tools/34.0.0"
|
||||
register: build_tools_34_0_0
|
||||
|
||||
- name: Delete build-tools;34.0.0
|
||||
android_sdk:
|
||||
name: build-tools;34.0.0
|
||||
state: absent
|
||||
register: build_tools_deleted
|
||||
|
||||
- name: Delete build-tools;34.0.0 second time
|
||||
android_sdk:
|
||||
name: build-tools;34.0.0
|
||||
state: absent
|
||||
register: build_tools_deleted2
|
||||
|
||||
- name: Download old platform-tools
|
||||
unarchive:
|
||||
src: https://dl.google.com/android/repository/platform-tools_r27.0.0-linux.zip
|
||||
remote_src: true
|
||||
dest: "{{ android_sdk_location }}"
|
||||
|
||||
- name: Try installing platform-tools from sdkmanager
|
||||
android_sdk:
|
||||
name: platform-tools
|
||||
state: present
|
||||
register: platform_tools_present
|
||||
|
||||
- name: Install (update) platform-tools
|
||||
android_sdk:
|
||||
name: platform-tools
|
||||
state: latest
|
||||
register: platform_tools_updated
|
||||
|
||||
- name: Create new sdk root
|
||||
file:
|
||||
path: "{{ ansible_env.HOME }}/newroot"
|
||||
state: directory
|
||||
register: newroot
|
||||
notify: delete_newroot
|
||||
|
||||
- name: Accept licenses in the new root
|
||||
shell: "yes | sdkmanager --sdk_root={{ newroot.path }} --licenses"
|
||||
|
||||
- name: Install a package to a new root
|
||||
android_sdk:
|
||||
name: build-tools;34.0.0
|
||||
state: present
|
||||
sdk_root: "{{ newroot.path }}"
|
||||
register: new_root_package
|
||||
|
||||
- name: Check package is installed
|
||||
stat:
|
||||
path: "{{ newroot.path }}/build-tools/34.0.0"
|
||||
register: new_root_package_stat
|
||||
|
||||
- name: Install a package from canary channel
|
||||
android_sdk:
|
||||
name: build-tools;33.0.0
|
||||
state: present
|
||||
channel: canary
|
||||
register: package_canary
|
||||
|
||||
- name: Run tests
|
||||
assert:
|
||||
that:
|
||||
- build_tools_34_0_0.stat.exists
|
||||
- build_tools_installed.changed
|
||||
- not build_tools_installed2.changed
|
||||
- build_tools_deleted.changed
|
||||
- not build_tools_deleted2.changed
|
||||
- not platform_tools_present.changed
|
||||
- platform_tools_updated.changed
|
||||
- new_root_package.changed
|
||||
- new_root_package_stat.stat.exists
|
||||
- package_canary.changed
|
||||
@@ -0,0 +1,78 @@
|
||||
---
|
||||
# Copyright (c) Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
- name: Accept all licenses (FreeBSD)
|
||||
shell: 'yes | sdkmanager --licenses'
|
||||
changed_when: false
|
||||
|
||||
- name: Install sources;android-26 (FreeBSD)
|
||||
android_sdk:
|
||||
name: sources;android-26
|
||||
state: present
|
||||
register: sources_android_26_installed
|
||||
|
||||
- name: Install sources;android-26 (FreeBSD)
|
||||
android_sdk:
|
||||
name: sources;android-26
|
||||
state: present
|
||||
register: sources_android_26_installed2
|
||||
|
||||
- name: Stat build-tools (FreeBSD)
|
||||
stat:
|
||||
path: "{{ android_sdk_location }}/sources/android-26"
|
||||
register: sources_android_26
|
||||
|
||||
- name: Delete sources;android-26 (FreeBSD)
|
||||
android_sdk:
|
||||
name: sources;android-26
|
||||
state: absent
|
||||
register: sources_android_26_deleted
|
||||
|
||||
- name: sources;android-26 second time (FreeBSD)
|
||||
android_sdk:
|
||||
name: sources;android-26
|
||||
state: absent
|
||||
register: sources_android_26_deleted2
|
||||
|
||||
- name: Create new sdk root (FreeBSD)
|
||||
file:
|
||||
path: "{{ ansible_env.HOME }}/newroot"
|
||||
state: directory
|
||||
register: newroot
|
||||
notify: delete_newroot
|
||||
|
||||
- name: Accept licenses in the new root (FreeBSD)
|
||||
shell: "yes | sdkmanager --sdk_root={{ newroot.path }} --licenses"
|
||||
|
||||
- name: Install a package to a new root (FreeBSD)
|
||||
android_sdk:
|
||||
name: sources;android-26
|
||||
state: present
|
||||
sdk_root: "{{ newroot.path }}"
|
||||
register: new_root_package
|
||||
|
||||
- name: Check package is installed (FreeBSD)
|
||||
stat:
|
||||
path: "{{ newroot.path }}/sources/android-26"
|
||||
register: new_root_package_stat
|
||||
|
||||
- name: Install a package from canary channel (FreeBSD)
|
||||
android_sdk:
|
||||
name: sources;android-26
|
||||
state: present
|
||||
channel: canary
|
||||
register: package_canary
|
||||
|
||||
- name: Run tests (FreeBSD)
|
||||
assert:
|
||||
that:
|
||||
- sources_android_26.stat.exists
|
||||
- sources_android_26_installed.changed
|
||||
- not sources_android_26_installed2.changed
|
||||
- sources_android_26_deleted.changed
|
||||
- not sources_android_26_deleted2.changed
|
||||
- new_root_package.changed
|
||||
- new_root_package_stat.stat.exists
|
||||
- package_canary.changed
|
||||
@@ -3,104 +3,24 @@
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
- import_tasks: setup.yml
|
||||
|
||||
- name: Setup environment
|
||||
environment:
|
||||
PATH: '{{ ansible_env.PATH }}:{{ android_sdk_location }}/cmdline-tools/latest/bin'
|
||||
ANDROID_HOME: "{{ android_sdk_location }}"
|
||||
- name: Run android_sdk tests
|
||||
block:
|
||||
- import_tasks: setup.yml
|
||||
|
||||
- name: Accept all licenses
|
||||
shell: 'yes | sdkmanager --licenses'
|
||||
changed_when: false
|
||||
- name: Run default tests
|
||||
environment:
|
||||
PATH: '{{ ansible_env.PATH }}:{{ android_sdk_location }}/cmdline-tools/latest/bin'
|
||||
block:
|
||||
- import_tasks: default-tests.yml
|
||||
when: ansible_os_family != 'FreeBSD'
|
||||
|
||||
- name: Install build-tools;34.0.0
|
||||
android_sdk:
|
||||
name: build-tools;34.0.0
|
||||
state: present
|
||||
register: build_tools_installed
|
||||
|
||||
- name: Install build-tools;34.0.0 second time
|
||||
android_sdk:
|
||||
name: build-tools;34.0.0
|
||||
state: present
|
||||
register: build_tools_installed2
|
||||
|
||||
- name: Stat build-tools
|
||||
stat:
|
||||
path: "{{ android_sdk_location }}/build-tools/34.0.0"
|
||||
register: build_tools_34_0_0
|
||||
|
||||
- name: Delete build-tools;34.0.0
|
||||
android_sdk:
|
||||
name: build-tools;34.0.0
|
||||
state: absent
|
||||
register: build_tools_deleted
|
||||
|
||||
- name: Delete build-tools;34.0.0 second time
|
||||
android_sdk:
|
||||
name: build-tools;34.0.0
|
||||
state: absent
|
||||
register: build_tools_deleted2
|
||||
|
||||
- name: Download old platform-tools
|
||||
unarchive:
|
||||
src: https://dl.google.com/android/repository/platform-tools_r27.0.0-linux.zip
|
||||
remote_src: true
|
||||
dest: "{{ android_sdk_location }}"
|
||||
|
||||
- name: Try installing platform-tools from sdkmanager
|
||||
android_sdk:
|
||||
name: platform-tools
|
||||
state: present
|
||||
register: platform_tools_present
|
||||
|
||||
- name: Install (update) platform-tools
|
||||
android_sdk:
|
||||
name: platform-tools
|
||||
state: latest
|
||||
register: platform_tools_updated
|
||||
|
||||
- name: Create new sdk root
|
||||
file:
|
||||
path: "{{ ansible_env.HOME }}/newroot"
|
||||
state: directory
|
||||
register: newroot
|
||||
notify: delete_newroot
|
||||
|
||||
- name: Accept licenses in the new root
|
||||
shell: "yes | sdkmanager --sdk_root={{ newroot.path }} --licenses"
|
||||
|
||||
- name: Install a package to a new root
|
||||
android_sdk:
|
||||
name: build-tools;34.0.0
|
||||
state: present
|
||||
sdk_root: "{{ newroot.path }}"
|
||||
register: new_root_package
|
||||
|
||||
- name: Check package is installed
|
||||
stat:
|
||||
path: "{{ newroot.path }}/build-tools/34.0.0"
|
||||
register: new_root_package_stat
|
||||
|
||||
- name: Install a package from canary channel
|
||||
android_sdk:
|
||||
name: build-tools;33.0.0
|
||||
state: present
|
||||
channel: canary
|
||||
register: package_canary
|
||||
|
||||
- name: Run tests
|
||||
assert:
|
||||
that:
|
||||
- build_tools_34_0_0.stat.exists
|
||||
- build_tools_installed.changed
|
||||
- not build_tools_installed2.changed
|
||||
- build_tools_deleted.changed
|
||||
- not build_tools_deleted2.changed
|
||||
- not platform_tools_present.changed
|
||||
- platform_tools_updated.changed
|
||||
- new_root_package.changed
|
||||
- new_root_package_stat.stat.exists
|
||||
- package_canary.changed
|
||||
# Most of the important Android SDK packages are not available on FreeBSD (like, build-tools, platform-tools and so on),
|
||||
# but at least some of the functionality can be tested (like, downloading sources)
|
||||
- name: Run FreeBSD tests
|
||||
environment:
|
||||
PATH: '{{ ansible_env.PATH }}:{{ android_sdk_location }}/cmdline-tools/latest/bin'
|
||||
block:
|
||||
- import_tasks: freebsd-tests.yml
|
||||
when: ansible_os_family == 'FreeBSD'
|
||||
when:
|
||||
- "not (ansible_os_family == 'RedHat' and ansible_distribution_version is version('8.0', '<'))"
|
||||
|
||||
6
tests/integration/targets/android_sdk/vars/Darwin.yml
Normal file
6
tests/integration/targets/android_sdk/vars/Darwin.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
# Copyright (c) Ansible Project
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
openjdk_pkg: openjdk@17
|
||||
Reference in New Issue
Block a user