1
0
Fork 0
mirror of https://github.com/JasonN3/build-container-installer.git synced 2025-12-25 10:57:55 +01:00

add flatpak test

This commit is contained in:
Jason N. 2024-03-05 16:58:24 -05:00
parent d14ca6c503
commit 1b0319ae83
4 changed files with 52 additions and 20 deletions

View file

@ -208,12 +208,14 @@ jobs:
fi fi
echo "VM ready for tests at IP ${VM_IP}" echo "VM ready for tests at IP ${VM_IP}"
for check in $(ls tests/vm) echo "Creating Ansible inventory"
do cat << EOF > ansible_inventory
if [[ -f $check && $check != "README.md" ]] hosts:
then vm:
chmod +x $check ansible_host: ${VM_IP}
./${check} ansible_user: ${VM_USER}
fi ansible_password: ${VM_PASS}
done EOF
make test-vm

View file

@ -187,11 +187,16 @@ clean:
install-deps: install-deps:
dnf install -y lorax xorriso skopeo flatpak dbus-daemon ostree dnf install -y lorax xorriso skopeo flatpak dbus-daemon ostree
test: test-iso test: test-iso test-vm
test-iso: test-iso:
$(eval _TESTS = $(filter-out README.md,$(shell ls tests/iso))) $(eval _TESTS = $(filter-out README.md,$(shell ls tests/iso)))
$(foreach test,$(_TESTS),chmod +x tests/iso/$(test)) $(foreach test,$(_TESTS),chmod +x tests/iso/$(test))
$(foreach test,$(_TESTS),./tests/iso/$(test) deploy.iso) $(foreach test,$(_TESTS),./tests/iso/$(test) deploy.iso)
.PHONY: clean install-deps test test-iso test-vm:
$(eval _TESTS = $(filter-out README.md,$(shell ls tests/vm)))
$(foreach test,$(_TESTS),chmod +x tests/vm/$(test))
$(foreach test,$(_TESTS),./tests/vm/$(test) deploy.iso)
.PHONY: clean install-deps test test-iso test-vm

View file

@ -21,16 +21,19 @@ See [Customizing](#customizing) for information about customizing the ISO that g
## Customizing ## Customizing
The following variables can be used to customize the created ISO. The following variables can be used to customize the created ISO.
| Variable | Description | Default Value | | Variable | Description | Default Value |
| ----------------- | -------------------------------------------------------- | ------------------------------ | | ------------------- | -------------------------------------------------------- | -------------------------------------------- |
| ARCH | Architecture for image to build | x86_64 | | ARCH | Architecture for image to build | x86_64 |
| VERSION | Fedora version of installer to build | 39 | | VERSION | Fedora version of installer to build | 39 |
| IMAGE_REPO | Repository containing the source container image | quay.io/fedora-ostree-desktops | | IMAGE_REPO | Repository containing the source container image | quay.io/fedora-ostree-desktops |
| IMAGE_NAME | Name of the source container image | base | | IMAGE_NAME | Name of the source container image | base |
| IMAGE_TAG | Tag of the source container image | *VERSION* | | IMAGE_TAG | Tag of the source container image | *VERSION* |
| EXTRA_BOOT_PARAMS | Extra params used by grub to boot the anaconda installer | \[empty\] | | EXTRA_BOOT_PARAMS | Extra params used by grub to boot the anaconda installer | \[empty\] |
| VARIANT | Source container variant\* | Server | | VARIANT | Source container variant\* | Server |
| WEB_UI | Enable Anaconda WebUI (experimental) | false | | WEB_UI | Enable Anaconda WebUI (experimental) | false |
| FLATPAK_REMOTE_NAME | Name of the Flatpak repo | flathub |
| FLATPAK_REMOTE_URL | URL to the flatpakrepo file | https://flathub.org/repo/flathub.flatpakrepo |
| FLATPAK_REMOTE_REFS | Space delimited list of Flatpak package refs to install | \[empty\] |
Available options for VARIANT can be found by running `dnf provides system-release`. Available options for VARIANT can be found by running `dnf provides system-release`.
Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinoite Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinoite

22
tests/vm/flatpaks.yml Normal file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env ansible-playbook -i ansible_inventory
---
- name: Test for flatpaks
hosts: vm
gather_facts: no
tasks:
- name: Get gpg key
ansible.builtin.set-fact:
found_gpg: "{{ slurpfile['/ostree/deploy/default/var/lib/flatpak/repo'] | base64 }}"
expected_gpg: "{{ lookup('ansible.builtin.url', 'https://flathub.org/repo/flathub.flatpakrepo', split_lines=True) | regex_search('^GPGKey=(.*)$', '\\1' multiline=True, ignorecase=True) }}"
- name: Test GPG key
ansible.builtin.assert:
that:
- found_gpg == found_gpg
fail_msg: "Installed GPG key does not match GPG key in flatpakrepo file"
success_msg: "GPG key matches"
- name: Test updating flatpak packages
ansible.builtin.command:
cmd: /usr/bin/flatpak update -y