skip test if readline module missing (add it as optional module installs in GHA workflow)

pull/3267/head
sebres 2022-06-21 17:05:39 +02:00
parent 4337e36616
commit 15f5c36a17
2 changed files with 7 additions and 0 deletions

View File

@ -61,6 +61,8 @@ jobs:
#sudo apt-get -y install python${F2B_PY/2/}-systemd || echo 'systemd not available'
sudo apt-get -y install libsystemd-dev || echo 'systemd dependencies seems to be unavailable'
python -m pip install systemd-python || echo 'systemd not available'
#readline if available as module:
python -c 'import readline' 2> /dev/null || python -m pip install readline || echo 'readline not available'
- name: Before scripts
run: |

View File

@ -568,6 +568,11 @@ class Fail2banClientTest(Fail2banClientServerBase):
os.kill(pid, signal.SIGCONT)
self.assertLogged("timed out")
self.pruneLog()
# check readline module available (expected by interactive client)
try:
import readline
except ImportError as e:
raise unittest.SkipTest('Skip test because of import error: %s' % e)
# interactive client chat with started server:
INTERACT += [
"echo INTERACT-ECHO",