Skip to content

Commit

Permalink
Remove packages installed in the server container for testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
cbosdo committed Jan 21, 2025
1 parent 7cdaed1 commit 920486d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 32 deletions.
4 changes: 4 additions & 0 deletions backend_modules/libvirt/host/user_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ zypper:
name: tools_pool_repo

runcmd:
%{ if container_server && testsuite }
# Packages needed for the testsuite
- "zypper -n in expect"
%{ endif }
%{ if install_salt_bundle }
- "zypper -n in venv-salt-minion avahi nss-mdns"
%{ else }
Expand Down
7 changes: 0 additions & 7 deletions salt/build_host/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,4 @@ update_ca_truststore_registry_build_host:
{# already a systemd unit that watches for changes and runs it: #}
{# /usr/lib/systemd/system/ca-certificates.path #}

{% if "opensuse" not in grains['oscodename']|lower %}

cloud_flavor_check:
pkg.installed:
- name: python-instance-billing-flavor-check

{% endif %}
{% endif %}
8 changes: 4 additions & 4 deletions salt/server/download_ubuntu_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -e

DIR=/srv/www/htdocs/pub/$1
DIR=$1/htdocs/pub/$2
mkdir -p $DIR
cd $DIR
wget -r -np -A deb,dsc,tar.xz,tar.gz,gz,key,gpg,Packages,Release,Sources http://$2
mv $2/* .
HOST=$(echo $2 | awk -F/ '{print $1}')
wget -r -np -A deb,dsc,tar.xz,tar.gz,gz,key,gpg,Packages,Release,Sources http://$3
mv $3/* .
HOST=$(echo $3 | awk -F/ '{print $1}')
if [ -n "$HOST" -a x"$HOST" != "x/" ]; then
rm -rf "$HOST"
fi
Expand Down
2 changes: 1 addition & 1 deletion salt/server/testsuite.sls
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ another_test_repo:
test_repo_debian_updates:
cmd.script:
- name: salt://server/download_ubuntu_repo.sh
- args: "TestRepoDebUpdates {{ grains.get('mirror') | default('download.opensuse.org', true) }}/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Updates/deb/"
- args: "/srv/www TestRepoDebUpdates {{ grains.get('mirror') | default('download.opensuse.org', true) }}/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Updates/deb/"
- creates: /srv/www/htdocs/pub/TestRepoDebUpdates/Release
- require:
- pkg: testsuite_packages
Expand Down
22 changes: 2 additions & 20 deletions salt/server_containerized/testsuite.sls
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,15 @@ test_repo_debian_updates_script:
- source: salt://server/download_ubuntu_repo.sh
- mode: 755

test_repo_debian_updates_script_copy:
cmd.run:
- name: "mgrctl cp /root/download_ubuntu_repo.sh server:/root/download_ubuntu_repo.sh"

test_repo_debian_updates:
cmd.run:
- name: mgrctl exec /root/download_ubuntu_repo.sh "TestRepoDebUpdates {{ grains.get('mirror') | default('download.opensuse.org', true) }}/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Updates/deb/"
- name: /root/download_ubuntu_repo.sh /var/lib/containers/storage/volumes/srv-www/_data TestRepoDebUpdates {{ grains.get('mirror') | default('download.opensuse.org', true) }}/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Updates/deb/
- unless: mgrctl exec "ls -d /srv/www/htdocs/pub/TestRepoDebUpdates"
- require:
- cmd: test_repo_debian_updates_script_copy
- file: test_repo_debian_updates_script
{% if grains['osfullname'] not in ['SLE Micro', 'SL-Micro', 'openSUSE Leap Micro'] %}
- pkg: uyuni-tools
{% endif %}
- cmd: testsuite_packages

# modify cobbler to be executed from remote-machines..
cobbler_configuration:
Expand Down Expand Up @@ -119,19 +114,6 @@ suse_staging_key_import:
- file: suse_staging_key_copy_host
{% endif %}

testsuite_refresh_repos:
cmd.run:
- name: mgrctl exec "zypper --non-interactive --gpg-auto-import-keys refresh --force; exit 0"

testsuite_packages:
cmd.run:
- name: mgrctl exec "zypper -n in iputils expect wget OpenIPMI"
- require:
- cmd: testsuite_refresh_repos
{% if grains['osfullname'] not in ['SLE Micro', 'SL-Micro', 'openSUSE Leap Micro'] %}
- pkg: uyuni-tools
{% endif %}

{% set products_to_use_salt_bundle = ["uyuni-master", "uyuni-pr", "head", "5.0-nightly", "5.0-released"] %}
{% if grains.get('product_version') | default('', true) in products_to_use_salt_bundle %}

Expand Down

0 comments on commit 920486d

Please sign in to comment.