Use osci+tmt for gating
This commit is contained in:
parent
13be3bc23d
commit
85631c121e
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
||||
@ -3,4 +3,4 @@ product_versions:
|
||||
- rhel-8
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
|
||||
47
plan.fmf
Normal file
47
plan.fmf
Normal file
@ -0,0 +1,47 @@
|
||||
execute:
|
||||
how: tmt
|
||||
|
||||
discover:
|
||||
- name: tests_python
|
||||
how: shell
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/python.git
|
||||
tests:
|
||||
- name: smoke36
|
||||
path: /smoke
|
||||
test: VERSION=3.6 TOX=false CYTHON=false ./venv.sh
|
||||
- name: smoke36_virtualenv
|
||||
path: /smoke
|
||||
test: VERSION=3.6 METHOD=virtualenv TOX=false ./venv.sh
|
||||
- name: smoke312
|
||||
path: /smoke
|
||||
test: VERSION=3.12 TOX=false ./venv.sh
|
||||
- name: same_repo
|
||||
how: shell
|
||||
tests:
|
||||
- name: pip_install_upgrade
|
||||
path: /tests/pip_install_upgrade/
|
||||
test: ./runtest.sh
|
||||
|
||||
prepare:
|
||||
- name: Enable CRB
|
||||
how: feature
|
||||
crb: enabled
|
||||
- name: Enable EPEL
|
||||
how: feature
|
||||
epel: enabled
|
||||
- name: Install dependencies
|
||||
how: install
|
||||
package:
|
||||
- gcc
|
||||
- virtualenv
|
||||
- platform-python-devel
|
||||
- python3.12-devel
|
||||
- grep
|
||||
- util-linux
|
||||
- shadow-utils
|
||||
- expect
|
||||
- dnf
|
||||
- name: Update packages
|
||||
how: shell
|
||||
script: dnf upgrade -y
|
||||
|
||||
40
tests/pip_install_upgrade/runtest.sh
Executable file
40
tests/pip_install_upgrade/runtest.sh
Executable file
@ -0,0 +1,40 @@
|
||||
#!/bin/sh -eux
|
||||
# This script requires root privileges and you should never run it on your own machine
|
||||
test $EUID -eq 0
|
||||
|
||||
PYTHON_VERSION=$(/usr/bin/python3 -c 'import sys; print("{}.{}".format(*sys.version_info))')
|
||||
RPM_SITELIB="/usr/lib/python${PYTHON_VERSION}/site-packages"
|
||||
LOCAL_SITELIB="/usr/local/lib/python${PYTHON_VERSION}/site-packages"
|
||||
USER_SITELIB="/home/fedora-test-user/.local/lib/python${PYTHON_VERSION}/site-packages"
|
||||
|
||||
# First, let's install older Pello with pip as if it was installed by RPM
|
||||
# This is an approximation, but it usually works
|
||||
RPM_BUILD_ROOT=/ /usr/bin/pip-${PYTHON_VERSION} install 'Pello==1.0.1'
|
||||
|
||||
# Now, we'll upgrade it with regular pip
|
||||
/usr/bin/pip-${PYTHON_VERSION} install --upgrade 'Pello==1.0.2'
|
||||
|
||||
# pip should see it
|
||||
/usr/bin/pip-${PYTHON_VERSION} freeze | grep '^Pello==1\.0\.2$'
|
||||
|
||||
# Both installations should still exist
|
||||
test -d "${RPM_SITELIB}/Pello-1.0.1-py${PYTHON_VERSION}.egg-info" || test -d "${RPM_SITELIB}/Pello-1.0.1.dist-info"
|
||||
test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info"
|
||||
|
||||
# Let's ditch the local one
|
||||
/usr/bin/pip-${PYTHON_VERSION} uninstall --yes Pello
|
||||
|
||||
# It should only remove one of them
|
||||
test -d "${RPM_SITELIB}/Pello-1.0.1-py${PYTHON_VERSION}.egg-info" || test -d "${RPM_SITELIB}/Pello-1.0.1.dist-info"
|
||||
! test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info"
|
||||
|
||||
# And pip should still see the RPM-installed one
|
||||
/usr/bin/pip-${PYTHON_VERSION} freeze | grep '^Pello==1\.0\.1$'
|
||||
|
||||
# Again, but as regular user
|
||||
useradd fedora-test-user
|
||||
su fedora-test-user -c "/usr/bin/pip-${PYTHON_VERSION} install --user 'Pello==1.0.2'"
|
||||
test -d "${USER_SITELIB}/Pello-1.0.2.dist-info"
|
||||
su fedora-test-user -c "/usr/bin/pip-${PYTHON_VERSION} freeze" | grep '^Pello==1\.0\.2$'
|
||||
su fedora-test-user -c "/usr/bin/pip-${PYTHON_VERSION} uninstall --yes Pello"
|
||||
su fedora-test-user -c "/usr/bin/pip-${PYTHON_VERSION} freeze" | grep '^Pello==1\.0\.1$'
|
||||
Loading…
Reference in New Issue
Block a user