Fix gating plan
- removed unnecessary older VERSION= tests - removed bootstrap test - fix pip_install_upgrade to run pip-3.14 - fix bash completion + remove unused metadata file
This commit is contained in:
parent
acadd434d6
commit
137e95d8ab
46
plan.fmf
46
plan.fmf
@ -6,61 +6,37 @@ discover:
|
|||||||
how: shell
|
how: shell
|
||||||
url: https://gitlab.com/redhat/centos-stream/tests/python.git
|
url: https://gitlab.com/redhat/centos-stream/tests/python.git
|
||||||
tests:
|
tests:
|
||||||
- name: smoke39
|
|
||||||
path: /smoke
|
|
||||||
test: VERSION=3.9 ./venv.sh
|
|
||||||
- name: smoke312
|
|
||||||
path: /smoke
|
|
||||||
test: VERSION=3.12 ./venv.sh
|
|
||||||
- name: smoke314
|
- name: smoke314
|
||||||
path: /smoke
|
path: /smoke
|
||||||
test: VERSION=3.14 ./venv.sh
|
test: VERSION=3.14 ./venv.sh
|
||||||
- name: smoke39_virtualenv
|
|
||||||
path: /smoke
|
|
||||||
test: VERSION=3.9 METHOD=virtualenv ./venv.sh
|
|
||||||
- name: smoke312_virtualenv
|
|
||||||
path: /smoke
|
|
||||||
test: VERSION=3.12 METHOD=virtualenv ./venv.sh
|
|
||||||
- name: smoke314_virtualenv
|
- name: smoke314_virtualenv
|
||||||
path: /smoke
|
path: /smoke
|
||||||
test: VERSION=3.14 METHOD=virtualenv ./venv.sh
|
test: VERSION=3.14 METHOD=virtualenv ./venv.sh
|
||||||
- name: rpms_pyproject-rpm-macros
|
|
||||||
how: shell
|
|
||||||
url: https://gitlab.com/redhat/centos-stream/rpms/pyproject-rpm-macros.git
|
|
||||||
ref: c9s
|
|
||||||
tests:
|
|
||||||
- name: pyproject_isort
|
|
||||||
path: /tests
|
|
||||||
test: ./mocktest.sh python-isort
|
|
||||||
- name: same_repo
|
- name: same_repo
|
||||||
how: shell
|
how: shell
|
||||||
dist-git-source: true
|
|
||||||
dist-git-download-only: true
|
|
||||||
tests:
|
tests:
|
||||||
- name: mock_bootstrap_build
|
|
||||||
test: |
|
|
||||||
cd $TMT_SOURCE_DIR &&
|
|
||||||
$TMT_TREE/../discover/rpms_pyproject-rpm-macros/tests/tests/mocktest.sh python-pip --without tests --without man
|
|
||||||
- name: pip_install_upgrade
|
- name: pip_install_upgrade
|
||||||
path: /tests/pip_install_upgrade/
|
path: /tests/pip_install_upgrade/
|
||||||
test: ./runtest.sh
|
test: pybasever=3.14 ./runtest.sh
|
||||||
- name: bash_completion
|
- name: bash_completion
|
||||||
path: /tests/bash_completion
|
path: /tests/bash_completion
|
||||||
test: ./pip_completion_full_test.sh
|
test: PACKAGE=python3.14-pip ./pip_completion_full_test.sh
|
||||||
prepare:
|
prepare:
|
||||||
|
- name: Enable CRB
|
||||||
|
how: feature
|
||||||
|
crb: enabled
|
||||||
|
- name: Enable EPEL for tox and virtualenv
|
||||||
|
how: feature
|
||||||
|
epel: enabled
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
how: install
|
how: install
|
||||||
package:
|
package:
|
||||||
- gcc
|
- gcc
|
||||||
- virtualenv
|
- virtualenv
|
||||||
- python3.9
|
- tox
|
||||||
- python3.12-devel
|
|
||||||
- python3.14-devel
|
- python3.14-devel
|
||||||
- python3-devel
|
- python3.14-pip
|
||||||
- python3-tox
|
- bash-completion
|
||||||
- mock
|
|
||||||
- rpmdevtools
|
|
||||||
- rpm-build
|
|
||||||
- grep
|
- grep
|
||||||
- util-linux
|
- util-linux
|
||||||
- shadow-utils
|
- shadow-utils
|
||||||
|
|||||||
@ -1,35 +0,0 @@
|
|||||||
summary: PIP bash completion functionality smoke test
|
|
||||||
description: |
|
|
||||||
Comprehensive test for pip bash completion functionality on Fedora/RHEL systems.
|
|
||||||
|
|
||||||
The test performs the following steps:
|
|
||||||
1. Finds the bash completion script in the given (e.g. python3-pip) RPM package
|
|
||||||
2. Discovers all pip executables in the package (e.g. /usr/bin/pip and /usr/bin/pip3.14)
|
|
||||||
3. Sources the completion script and verifies completion for all executables is registered
|
|
||||||
4. Runs functional TAB completion tests using expect (for regular and POSIX mode of Bash)
|
|
||||||
5. Validates that completion works for basic pip commands
|
|
||||||
|
|
||||||
This is a smoke test to ensure pip bash completion is properly
|
|
||||||
installed and functional after package installation.
|
|
||||||
|
|
||||||
component:
|
|
||||||
- python3-pip
|
|
||||||
|
|
||||||
test: ./pip_completion_full_test.sh
|
|
||||||
|
|
||||||
framework: shell
|
|
||||||
|
|
||||||
duration: 5m
|
|
||||||
tier: 1
|
|
||||||
|
|
||||||
|
|
||||||
require:
|
|
||||||
- python3-pip
|
|
||||||
- bash-completion
|
|
||||||
- expect
|
|
||||||
- rpm
|
|
||||||
- bash
|
|
||||||
|
|
||||||
|
|
||||||
environment:
|
|
||||||
PACKAGE: python3-pip
|
|
||||||
@ -9,7 +9,7 @@ PACKAGE="${PACKAGE:-python3-pip}"
|
|||||||
# Step 1: Find bash completion scripts in python3-pip RPM package
|
# Step 1: Find bash completion scripts in python3-pip RPM package
|
||||||
echo "Step 1: Finding bash completion scripts in $PACKAGE RPM package..."
|
echo "Step 1: Finding bash completion scripts in $PACKAGE RPM package..."
|
||||||
|
|
||||||
COMPLETION_FILE=$(rpm -ql $PACKAGE 2>/dev/null | grep -E "/usr/share/bash-completion/completions/" || true)
|
COMPLETION_FILE=$(rpm -ql "$PACKAGE" 2>/dev/null | grep -E "/usr/share/bash-completion/completions/" || true)
|
||||||
|
|
||||||
if [[ -z "$COMPLETION_FILE" ]]; then
|
if [[ -z "$COMPLETION_FILE" ]]; then
|
||||||
echo "✗ No bash completion files found in $PACKAGE package"
|
echo "✗ No bash completion files found in $PACKAGE package"
|
||||||
@ -34,7 +34,7 @@ echo "$COMPLETION_FILE" | sed 's/^/ - /'
|
|||||||
echo
|
echo
|
||||||
echo "Step 2: Finding all pip binaries..."
|
echo "Step 2: Finding all pip binaries..."
|
||||||
PIP_BINARIES=()
|
PIP_BINARIES=()
|
||||||
PIP_FILES=$(rpm -ql $PACKAGE | grep /bin/p)
|
PIP_FILES=$(rpm -ql "$PACKAGE" | grep /bin/pip)
|
||||||
for pip_file in $PIP_FILES; do
|
for pip_file in $PIP_FILES; do
|
||||||
if [[ -x "$pip_file" ]]; then
|
if [[ -x "$pip_file" ]]; then
|
||||||
pip_cmd=$(basename "$pip_file")
|
pip_cmd=$(basename "$pip_file")
|
||||||
|
|||||||
@ -10,6 +10,11 @@ set timeout 5
|
|||||||
set completion_file [lindex $argv 0]
|
set completion_file [lindex $argv 0]
|
||||||
set pip_exec [lindex $argv 1]
|
set pip_exec [lindex $argv 1]
|
||||||
|
|
||||||
|
if {$completion_file eq "" || $pip_exec eq ""} {
|
||||||
|
puts "Usage: test_pip_completion.exp <completion_file> <pip_binary>"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
puts "=== PIP Bash Completion Test (using expect) ==="
|
puts "=== PIP Bash Completion Test (using expect) ==="
|
||||||
puts "Testing completion file: $completion_file"
|
puts "Testing completion file: $completion_file"
|
||||||
@ -28,11 +33,15 @@ if {[info exists env(AS_POSIX)] && $env(AS_POSIX) == "1"} {
|
|||||||
} else {
|
} else {
|
||||||
spawn bash --norc
|
spawn bash --norc
|
||||||
}
|
}
|
||||||
expect "$ "
|
|
||||||
|
send "PS1='READY> '\r"
|
||||||
|
expect "READY> "
|
||||||
|
send "\r"
|
||||||
|
expect "READY> "
|
||||||
|
|
||||||
# Source the completion file
|
# Source the completion file
|
||||||
send "source $completion_file\r"
|
send "source $completion_file\r"
|
||||||
expect "$ "
|
expect "READY> "
|
||||||
puts "Attempted to source completion file"
|
puts "Attempted to source completion file"
|
||||||
|
|
||||||
# Test 1: Basic pip command completion
|
# Test 1: Basic pip command completion
|
||||||
@ -44,12 +53,12 @@ send "\x09\x09"
|
|||||||
expect {
|
expect {
|
||||||
-re "(install|uninstall|list|show)" {
|
-re "(install|uninstall|list|show)" {
|
||||||
puts "✓ Basic pip commands found in completion"
|
puts "✓ Basic pip commands found in completion"
|
||||||
expect "$ "
|
expect "READY> "
|
||||||
}
|
}
|
||||||
-re "Display all" {
|
-re "Display all" {
|
||||||
puts "✓ Completion showing options menu"
|
puts "✓ Completion showing options menu"
|
||||||
send "n\r"
|
send "n\r"
|
||||||
expect "$ "
|
expect "READY> "
|
||||||
}
|
}
|
||||||
timeout {
|
timeout {
|
||||||
puts "✗ Timeout waiting for completion - test failed"
|
puts "✗ Timeout waiting for completion - test failed"
|
||||||
@ -59,9 +68,9 @@ expect {
|
|||||||
|
|
||||||
# Clear the line and ensure clean prompt
|
# Clear the line and ensure clean prompt
|
||||||
send "\x03"
|
send "\x03"
|
||||||
expect "$ "
|
expect "READY> "
|
||||||
send "\r"
|
send "\r"
|
||||||
expect "$ "
|
expect "READY> "
|
||||||
|
|
||||||
# Test 2: Test partial command completion (simpler test)
|
# Test 2: Test partial command completion (simpler test)
|
||||||
puts "\nTest 2: Testing '$pip_exec insta' + TAB completion..."
|
puts "\nTest 2: Testing '$pip_exec insta' + TAB completion..."
|
||||||
@ -72,7 +81,7 @@ send "\x09"
|
|||||||
expect {
|
expect {
|
||||||
-re "install" {
|
-re "install" {
|
||||||
puts "✓ Partial command completion works (insta -> install)"
|
puts "✓ Partial command completion works (insta -> install)"
|
||||||
expect "$ "
|
expect "READY> "
|
||||||
}
|
}
|
||||||
timeout {
|
timeout {
|
||||||
puts "✗ Timeout on partial completion test - test failed"
|
puts "✗ Timeout on partial completion test - test failed"
|
||||||
@ -82,9 +91,9 @@ expect {
|
|||||||
|
|
||||||
# Clear the line and ensure clean prompt
|
# Clear the line and ensure clean prompt
|
||||||
send "\x03"
|
send "\x03"
|
||||||
expect "$ "
|
expect "READY> "
|
||||||
send "\r"
|
send "\r"
|
||||||
expect "$ "
|
expect "READY> "
|
||||||
|
|
||||||
# Test 3: Test help completion
|
# Test 3: Test help completion
|
||||||
puts "\nTest 3: Testing '$pip_exec --' + TAB completion..."
|
puts "\nTest 3: Testing '$pip_exec --' + TAB completion..."
|
||||||
@ -94,7 +103,7 @@ send "\x09\x09"
|
|||||||
expect {
|
expect {
|
||||||
-re "(--help|--version)" {
|
-re "(--help|--version)" {
|
||||||
puts "✓ Command options found in completion"
|
puts "✓ Command options found in completion"
|
||||||
expect "$ "
|
expect "READY> "
|
||||||
}
|
}
|
||||||
timeout {
|
timeout {
|
||||||
puts "✗ Timeout on options completion test - test failed"
|
puts "✗ Timeout on options completion test - test failed"
|
||||||
@ -104,9 +113,9 @@ expect {
|
|||||||
|
|
||||||
# Final cleanup - make sure we're at clean prompt
|
# Final cleanup - make sure we're at clean prompt
|
||||||
send "\x03"
|
send "\x03"
|
||||||
expect "$ "
|
expect "READY> "
|
||||||
send "\r"
|
send "\r"
|
||||||
expect "$ "
|
expect "READY> "
|
||||||
|
|
||||||
# Exit bash cleanly
|
# Exit bash cleanly
|
||||||
send "exit\r"
|
send "exit\r"
|
||||||
|
|||||||
@ -2,39 +2,41 @@
|
|||||||
# This script requires root privileges and you should never run it on your own machine
|
# This script requires root privileges and you should never run it on your own machine
|
||||||
test $EUID -eq 0
|
test $EUID -eq 0
|
||||||
|
|
||||||
PYTHON_VERSION=$(/usr/bin/python3 -c 'import sys; print("{}.{}".format(*sys.version_info))')
|
pybasever=${pybasever:-3}
|
||||||
|
|
||||||
|
PYTHON_VERSION=$(/usr/bin/python${pybasever} -c 'import sys; print("{}.{}".format(*sys.version_info))')
|
||||||
RPM_SITELIB="/usr/lib/python${PYTHON_VERSION}/site-packages"
|
RPM_SITELIB="/usr/lib/python${PYTHON_VERSION}/site-packages"
|
||||||
LOCAL_SITELIB="/usr/local/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"
|
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
|
# First, let's install older Pello with pip as if it was installed by RPM
|
||||||
# This is an approximation, but it usually works
|
# This is an approximation, but it usually works
|
||||||
RPM_BUILD_ROOT=/ /usr/bin/pip install 'Pello==1.0.1'
|
RPM_BUILD_ROOT=/ /usr/bin/pip-${pybasever} install 'Pello==1.0.1'
|
||||||
|
|
||||||
# Now, we'll upgrade it with regular pip
|
# Now, we'll upgrade it with regular pip
|
||||||
/usr/bin/pip install --upgrade 'Pello==1.0.2'
|
/usr/bin/pip-${pybasever} install --upgrade 'Pello==1.0.2'
|
||||||
|
|
||||||
# pip should see it
|
# pip should see it
|
||||||
/usr/bin/pip freeze | grep '^Pello==1\.0\.2$'
|
/usr/bin/pip-${pybasever} freeze | grep '^Pello==1\.0\.2$'
|
||||||
|
|
||||||
# Both installations should still exist
|
# Both installations should still exist
|
||||||
test -d "${RPM_SITELIB}/pello-1.0.1.dist-info"
|
test -d "${RPM_SITELIB}/pello-1.0.1.dist-info"
|
||||||
test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info"
|
test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info"
|
||||||
|
|
||||||
# Let's ditch the local one
|
# Let's ditch the local one
|
||||||
/usr/bin/pip uninstall --yes Pello
|
/usr/bin/pip-${pybasever} uninstall --yes Pello
|
||||||
|
|
||||||
# It should only remove one of them
|
# It should only remove one of them
|
||||||
test -d "${RPM_SITELIB}/pello-1.0.1.dist-info"
|
test -d "${RPM_SITELIB}/pello-1.0.1.dist-info"
|
||||||
! test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info"
|
! test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info"
|
||||||
|
|
||||||
# And pip should still see the RPM-installed one
|
# And pip should still see the RPM-installed one
|
||||||
/usr/bin/pip freeze | grep '^Pello==1\.0\.1$'
|
/usr/bin/pip-${pybasever} freeze | grep '^Pello==1\.0\.1$'
|
||||||
|
|
||||||
# Again, but as regular user
|
# Again, but as regular user
|
||||||
useradd fedora-test-user
|
useradd fedora-test-user
|
||||||
su fedora-test-user -c '/usr/bin/pip install "Pello==1.0.2"'
|
su fedora-test-user -c '/usr/bin/pip-${pybasever} install "Pello==1.0.2"'
|
||||||
test -d "${USER_SITELIB}/Pello-1.0.2.dist-info"
|
test -d "${USER_SITELIB}/Pello-1.0.2.dist-info"
|
||||||
su fedora-test-user -c '/usr/bin/pip freeze' | grep '^Pello==1\.0\.2$'
|
su fedora-test-user -c '/usr/bin/pip-${pybasever} freeze' | grep '^Pello==1\.0\.2$'
|
||||||
su fedora-test-user -c '/usr/bin/pip uninstall --yes Pello'
|
su fedora-test-user -c '/usr/bin/pip-${pybasever} uninstall --yes Pello'
|
||||||
su fedora-test-user -c '/usr/bin/pip freeze' | grep '^Pello==1\.0\.1$'
|
su fedora-test-user -c '/usr/bin/pip-${pybasever} freeze' | grep '^Pello==1\.0\.1$'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user