Skip to content

Commit

Permalink
Salt Shaker: allow testing python311-salt in SLMicro and Tumbleweed
Browse files Browse the repository at this point in the history
  • Loading branch information
meaksh committed Feb 20, 2025
1 parent 32383e7 commit 2e44203
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions salt/salt_testenv/salt_classic_package.sls
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,31 @@ salt_testing_repo:
- gpgkey: http://{{ grains.get("mirror") | default("download.opensuse.org", true) }}/repositories/systemsmanagement:{{ grains["salt_obs_flavor"] }}/{{ repo_path }}/repodata/repomd.xml.key

{% set salt_minion_is_installed = salt["pkg.info_installed"]("salt-minion").get("salt-minion", False) %}

{% if grains['os_family'] == 'Suse' and grains['osfullname'] in ['SL-Micro', 'openSUSE Tumbleweed'] %}
{% set salt_classic_pkgs = "python311-salt-testsuite python311-salt" %}
{% set salt_test_executor = "python311-salt-test" %}
{% else %}
{% set salt_classic_pkgs = "python3-salt-testsuite python3-salt" %}
{% set salt_test_executor = "python3-salt-test" %}
{% endif %}

install_salt_testsuite:
{% if grains['os_family'] == 'Suse' and grains['osfullname'] == 'SL-Micro' %}
cmd.run:
- name: transactional-update -c -n pkg in python3-salt-testsuite python3-salt-test python3-salt
- name: transactional-update -c -n pkg in {{ salt_classic_pkgs }} {{ salt_test_executor }}
{% else %}
{# HACK: we call zypper manually to ensure right packages are installed regardless upgrade/downgrade #}
cmd.run:
{# We install docker first to ensure zypper does not resolve this dependency to podman-docker #}
{% if salt_minion_is_installed %}
- name: |
zypper --non-interactive in --force docker
zypper --non-interactive in --force --from salt_testing_repo python3-salt salt python3-salt-testsuite salt-minion
zypper --non-interactive in --force --from salt_testing_repo {{ salt_classic_pkgs }} salt salt-minion
{% else %}
- name: |
zypper --non-interactive in --force docker
zypper --non-interactive in --force --from salt_testing_repo python3-salt salt python3-salt-testsuite
zypper --non-interactive in --force --from salt_testing_repo {{ salt_classic_pkgs }} salt
{% endif %}
- fromrepo: salt_testing_repo
{% endif %}
Expand All @@ -115,7 +124,7 @@ install_salt_testsuite:
install_salt_tests_executor:
{% if grains['os_family'] == 'Suse' and grains['osfullname'] == 'SL-Micro' %}
cmd.run:
- name: transactional-update -c -n pkg in python3-salt-test
- name: transactional-update -c -n pkg in {{ salt_test_executor }}
{% else %}
pkg.installed:
- pkgs:
Expand Down

0 comments on commit 2e44203

Please sign in to comment.