aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2026-07-11 08:08:51 +0000
committerGerrit Code Review <review@openstack.org>2026-07-11 08:08:51 +0000
commitc0c6ec5a00711de6a5f69e692c1049eefa1a1f06 (patch)
treee7585a751b276f6804174df8e95b77f66ea3d36c /tests
parent6b3724a59c94dd7818821f5ea9c9d50b2a880d09 (diff)
parent77d310a9ff344a09f35b2c0536b0f7b9e8677deb (diff)
downloadkolla-c0c6ec5a00711de6a5f69e692c1049eefa1a1f06.tar.gz
kolla-c0c6ec5a00711de6a5f69e692c1049eefa1a1f06.zip
Merge "Add support to override base repos"
Diffstat (limited to 'tests')
-rw-r--r--tests/playbooks/run.yml10
-rw-r--r--tests/templates/repos.yaml.j263
-rw-r--r--tests/templates/template_overrides.j244
3 files changed, 74 insertions, 43 deletions
diff --git a/tests/playbooks/run.yml b/tests/playbooks/run.yml
index ad3c80075..99791da0f 100644
--- a/tests/playbooks/run.yml
+++ b/tests/playbooks/run.yml
@@ -62,6 +62,16 @@
when:
- not publisher
+ - name: Set up base repo overrides
+ vars:
+ kolla_repos_yaml_config:
+ DEFAULT:
+ repos_yaml: /etc/kolla/repos.yaml
+ ansible.builtin.set_fact:
+ kolla_build_config: "{{ kolla_build_config | combine(kolla_repos_yaml_config, recursive=True) }}"
+ kolla_build_repos_yaml_path: "{{ zuul.executor.work_root }}/{{ zuul.projects['opendev.org/openstack/kolla'].src_dir }}/tests/templates/repos.yaml.j2"
+ when: base_distro in ['debian', 'rocky', 'ubuntu']
+
- name: Import kolla-build-config role
import_role:
name: kolla-build-config
diff --git a/tests/templates/repos.yaml.j2 b/tests/templates/repos.yaml.j2
new file mode 100644
index 000000000..42c6724f9
--- /dev/null
+++ b/tests/templates/repos.yaml.j2
@@ -0,0 +1,63 @@
+---
+{% if base_distro == 'debian' %}
+debian:
+ debian:
+ component: "main"
+ gpg_key: "/usr/share/keyrings/debian-archive-keyring.gpg"
+ suite: "trixie trixie-updates trixie-backports"
+ trusted: True
+ url: "http://{{ nodepool_mirror_host }}/debian"
+ debian-security:
+ component: "main"
+ gpg_key: "/usr/share/keyrings/debian-archive-keyring.gpg"
+ suite: "trixie-security"
+ trusted: True
+ url: "http://{{ nodepool_mirror_host }}/debian-security"
+{% elif base_distro == 'rocky' %}
+rocky:
+ appstream:
+ baseurl: "http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/"
+ gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-10"
+ name: "appstream"
+ baseos:
+ baseurl: "http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/"
+ gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-10"
+ name: "baseos"
+ crb:
+ baseurl: "http://dl.rockylinux.org/$contentdir/$releasever/CRB/$basearch/os/"
+ gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-10"
+ name: "crb"
+{% elif base_distro == 'ubuntu' %}
+ubuntu:
+ ubuntu:
+ component: "main universe"
+ gpg_key: "/usr/share/keyrings/ubuntu-archive-keyring.gpg"
+ suite: "noble noble-updates noble-backports"
+ trusted: True
+ url: "http://{{ nodepool_mirror_host }}/ubuntu/"
+ ubuntu-security:
+ component: "main universe"
+ gpg_key: "/usr/share/keyrings/ubuntu-archive-keyring.gpg"
+ suite: "noble-security"
+ trusted: True
+ url: "http://{{ nodepool_mirror_host }}/ubuntu/"
+ ubuntu-cloud-archive:
+ component: "main"
+ gpg_key: "/usr/share/keyrings/ubuntu-cloud-keyring.gpg"
+ suite: "noble-updates/gazpacho"
+ trusted: True
+ url: "http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive"
+ubuntu-aarch64:
+ ubuntu:
+ component: "main universe"
+ gpg_key: "/usr/share/keyrings/ubuntu-archive-keyring.gpg"
+ suite: "noble noble-updates noble-backports"
+ trusted: True
+ url: "http://{{ nodepool_mirror_host }}/ubuntu-ports/"
+ ubuntu-security:
+ component: "main universe"
+ gpg_key: "/usr/share/keyrings/ubuntu-archive-keyring.gpg"
+ suite: "noble-security"
+ trusted: True
+ url: "http://{{ nodepool_mirror_host }}/ubuntu-ports/"
+{% endif %}
diff --git a/tests/templates/template_overrides.j2 b/tests/templates/template_overrides.j2
index ee67e2a62..3baa8d704 100644
--- a/tests/templates/template_overrides.j2
+++ b/tests/templates/template_overrides.j2
@@ -14,42 +14,9 @@ ENV PIP_EXTRA_INDEX_URL {{ nodepool_wheel_mirror }}
{% endblock %}
{% endraw %}
-{% if base_distro == 'rocky' %}
-{% raw %}
-{% block base_centos_repo_overrides_post_copy %}
-{% endraw %}
-RUN sed -i -e "s/^mirrorlist/#mirrorlist/g" -e "s/^#baseurl/baseurl/g" \
- /etc/yum.repos.d/rocky.repo
-{% raw %}
-{% endblock %}
-{% endraw %}
-{% endif %}
-
-{% raw %}
-{% block base_debian_after_sources_list %}
-{% endraw %}
-{% if base_distro == "debian" %}
-
-RUN cp /etc/apt/sources.list.d/debian.sources /tmp/ && \
- sed -i -e "s|^URIs: http://deb.debian.org/debian$|URIs: http://{{ nodepool_mirror_host }}/debian\nTrusted: yes|" \
- -e "s|^URIs: http://deb.debian.org/debian-security|URIs: http://{{ nodepool_mirror_host }}/debian-security\nTrusted: yes|" \
- /etc/apt/sources.list.d/debian.sources
-
-{% elif base_distro == "ubuntu" %}
-
-RUN cp /etc/apt/sources.list.d/ubuntu.sources /tmp/ && \
- sed -i -e "s|^URIs: http://archive.ubuntu.com/ubuntu/$|URIs: http://{{ nodepool_mirror_host }}/ubuntu/\nTrusted: yes|" \
- -e "s|^URIs: http://security.ubuntu.com/ubuntu/$|URIs: http://{{ nodepool_mirror_host }}/ubuntu/\nTrusted: yes|" \
- -e "s|^URIs: http://ports.ubuntu.com/ubuntu-ports/$|URIs: http://{{ nodepool_mirror_host }}/ubuntu-ports/\nTrusted: yes|" \
- -e "s|^URIs: http://ubuntu-cloud.archive.canonical.com/ubuntu$|URIs: http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive\nTrusted: yes|" \
- /etc/apt/sources.list.d/ubuntu.sources
-
-{% endif %}
-{% raw %}
-{% endblock %}
-
{# Revert to upstream mirrors after build is complete #}
+{% raw %}
{% block footer %}
{% endraw %}
@@ -59,15 +26,6 @@ ENV PIP_TRUSTED_HOST=
ENV PIP_EXTRA_INDEX_URL=
{% endif %}
-{% if base_distro == "debian" %}
-RUN if [ -f /tmp/debian.sources ]; then \
- mv -f /tmp/debian.sources /etc/apt/sources.list.d/debian.sources; \
- fi
-{% elif base_distro == "ubuntu" %}
-RUN if [ -f /tmp/ubuntu.sources ]; then \
- mv -f /tmp/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources; \
- fi
-{% endif %}
{% raw %}
{% endblock %}
{% endraw %}