#74 Support for installing required packages on Atomic
Merged 6 years ago by astepano. Opened 6 years ago by psss.
psss/standard-test-roles dependencies  into  master

@@ -12,5 +12,8 @@ 

       where the logs are stored.  Note: if this variable is left

       undefined, it will default to /tmp/artifacts

   * required_packages: A list of prerequisite packages required by

-      beakerlib tests. Note: will be disregarded on Atomic Host, etc.

-      where additional packages can't be installed

+      beakerlib tests. Please note that for Atomic Host, additional

+      packages will be installed using the rpm-ostree command which

+      is affecting the test subject (it's similar as rebuilding an

+      rpm package to be tested) so this should be used with caution

+      and only when necessary.

@@ -46,6 +46,23 @@ 

    # Only manually install packages on non atomic hosts

    when: ansible_pkg_mgr != 'unknown'

  

+ - block:

+   - name: Check packages required by the test (atomic)

+     shell: rpm -q {{ required_packages|join(" ") }}

+     register: package_check

+     changed_when: no

+     failed_when: no

+     args: { warn: no }

+ 

+   - name: Install packages required by the test (atomic)

+     shell:

+       rpm-ostree install {{ required_packages|join(" ") }}

+       && rpm-ostree ex livefs

+     when: package_check.rc != 0

+ 

+   tags: atomic

+   when: required_packages.0 is defined

+ 

  - name: Define remote_artifacts if it is not already defined

    set_fact:

      remote_artifacts: /tmp/artifacts

It seems the need for installing extra packages to satisfy test
dependencies is quite common. Despite using rpm-ostree is probably
not a completely clear solution I believe we should make this
option available. This commit adds support to the beakerlib role.

Not the best approach. Why:
For each installed package you invoke immediately "livefs".
For each installed package you create a layer, snapshot.
For example if you have 20 packages: there be 20 layers, (snapshots) for Atomic.

Better approach is to divide in two parts: 1) installing all packages + 2) activate them.

1 new commit added

  • Improve package installation on Atomic
6 years ago

Thanks for the suggestion, Andrei. I've improved the patch to only
call the rpm-ostree commands once and only if necessary. The docs
have been updated as well. Please, review. Thanks.

@psss
Updated PR seems fine for me. But,
Could you please update it, and keep only one commit?
Currently PR has 2 commits: the old one + the new one.
push one commit with --force to forks/psss/standard-test-roles dependencies.

Thanks.

rebased onto 15ceacf

6 years ago

Thanks for the review, Andrei.
Commits have been squashed.

Pull-Request has been merged by astepano

6 years ago