Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove packages installed in the server container for testsuite #1772

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading