Account for upgrades from new relenv-based repos

This commit is contained in:
MKLeb 2023-06-20 17:12:19 -04:00 committed by Gareth J. Greenaway
parent 296ec76a34
commit 7aadeaf792
3 changed files with 36 additions and 11 deletions

View file

@ -234,7 +234,8 @@ jobs:
GITHUB_ACTIONS_PIPELINE: "1"
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
run: |
sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.test-chunk }}
sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.test-chunk }} \
${{ contains(matrix.test-chunk, 'upgrade') && format('--prev-version {0}', matrix.version) || ''}}
- name: Run Package Tests
env:
@ -246,7 +247,8 @@ jobs:
GITHUB_ACTIONS_PIPELINE: "1"
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
run: |
sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.test-chunk }}
sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.test-chunk }} \
${{ contains(matrix.test-chunk, 'upgrade') && format('--prev-version {0}', matrix.version) || ''}}
- name: Fix file ownership
run: |

View file

@ -264,12 +264,14 @@ jobs:
- name: Show System Info & Test Plan
run: |
tools --timestamps --timeout-secs=1800 vm testplan --skip-requirements-install \
--nox-session=${{ inputs.nox-session }} ${{ inputs.distro-slug }} -- ${{ matrix.test-chunk }}
--nox-session=${{ inputs.nox-session }} ${{ inputs.distro-slug }} -- ${{ matrix.test-chunk }} \
${{ contains(matrix.test-chunk, 'upgrade') && format('--prev-version {0}', matrix.version) || ''}}
- name: Run Package Tests
run: |
tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install\
--nox-session=${{ inputs.nox-session }} --rerun-failures ${{ inputs.distro-slug }} -- ${{ matrix.test-chunk }}
--nox-session=${{ inputs.nox-session }} --rerun-failures ${{ inputs.distro-slug }} -- ${{ matrix.test-chunk }} \
${{ contains(matrix.test-chunk, 'upgrade') && format('--prev-version {0}', matrix.version) || ''}}
- name: Download Test Run Artifacts
id: download-artifacts-from-vm

View file

@ -661,6 +661,7 @@ class SaltPkgInstall:
minor_ver = self.minor
pkg_version = self.pkg_version
full_version = f"{self.major}.{self.minor}-{pkg_version}"
relenv = major_ver >= 3006
min_ver = f"{major_ver}"
distro_name = self.distro_name
@ -676,6 +677,9 @@ class SaltPkgInstall:
gpg_key = "SALTSTACK-GPG-KEY.pub"
if self.distro_version == "9":
gpg_key = "SALTSTACK-GPG-KEY2.pub"
if relenv:
gpg_key = "SALT-PROJECT-GPG-PUBKEY-2023.pub"
if platform.is_aarch64():
arch = "aarch64"
else:
@ -713,15 +717,20 @@ class SaltPkgInstall:
else:
arch = "amd64"
pathlib.Path("/etc/apt/keyrings").mkdir(parents=True, exist_ok=True)
gpg_dest = "salt-archive-keyring.gpg"
gpg_key = gpg_dest
if relenv:
gpg_key = "SALT-PROJECT-GPG-PUBKEY-2023.gpg"
download_file(
f"https://repo.saltproject.io/{root_url}{distro_name}/{self.distro_version}/{arch}/{major_ver}/salt-archive-keyring.gpg",
"/etc/apt/keyrings/salt-archive-keyring.gpg",
f"https://repo.saltproject.io/{root_url}{distro_name}/{self.distro_version}/{arch}/{major_ver}/{gpg_key}",
f"/etc/apt/keyrings/{gpg_dest}",
)
with open(
pathlib.Path("/etc", "apt", "sources.list.d", "salt.list"), "w"
) as fp:
fp.write(
f"deb [signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg arch={arch}] "
f"deb [signed-by=/etc/apt/keyrings/{gpg_dest} arch={arch}] "
f"https://repo.saltproject.io/{root_url}{distro_name}/{self.distro_version}/{arch}/{major_ver} {self.distro_codename} main"
)
ret = self.proc.run(self.pkg_mngr, "update")
@ -744,8 +753,15 @@ class SaltPkgInstall:
self.ssm_bin = self.install_dir / "ssm.exe"
if not self.classic:
win_pkg = f"salt-{full_version}-windows-amd64.{self.file_ext}"
win_pkg_url = f"https://repo.saltproject.io/salt/py3/windows/{full_version}/{win_pkg}"
if not relenv:
win_pkg = f"salt-{full_version}-windows-amd64.{self.file_ext}"
win_pkg_url = f"https://repo.saltproject.io/salt/py3/windows/{full_version}/{win_pkg}"
else:
if self.file_ext == "msi":
win_pkg = f"Salt-Minion-{self.prev_version}-1-Py3-AMD64.{self.file_ext}"
elif self.file_ext == "exe":
win_pkg = f"Salt-Minion-{self.prev_version}-1-Py3-AMD64-Setup.{self.file_ext}"
win_pkg_url = f"https://repo.saltproject.io/salt/py3/windows/{major_ver}/{win_pkg}"
else:
if self.file_ext == "msi":
win_pkg = f"Salt-Minion-{min_ver}-1-Py3-AMD64.{self.file_ext}"
@ -785,8 +801,13 @@ class SaltPkgInstall:
mac_pkg = f"salt-{min_ver}.{minor_ver}-1-py3-x86_64.pkg"
mac_pkg_url = f"https://repo.saltproject.io/osx/{mac_pkg}"
else:
mac_pkg = f"salt-{min_ver}.{minor_ver}-1-macos-x86_64.pkg"
mac_pkg_url = f"https://repo.saltproject.io/salt/py3/macos/{major_ver}.{minor_ver}-1/{mac_pkg}"
if not relenv:
mac_pkg = f"salt-{min_ver}.{minor_ver}-1-macos-x86_64.pkg"
mac_pkg_url = f"https://repo.saltproject.io/salt/py3/macos/{major_ver}.{minor_ver}-1/{mac_pkg}"
else:
mac_pkg = f"salt-{self.prev_verison}-x86_64.pkg"
mac_pkg_url = f"https://repo.saltproject.io/salt/py3/macos/{major_ver}/{mac_pkg}"
mac_pkg_path = f"/tmp/{mac_pkg}"
if not os.path.exists(mac_pkg_path):
download_file(