Skip to content

qa/tasks: avoid podman TTY flake, verify gateway/host creation#67241

Open
rkachach wants to merge 2 commits intoceph:mainfrom
rkachach:fix_iscsi_test_script
Open

qa/tasks: avoid podman TTY flake, verify gateway/host creation#67241
rkachach wants to merge 2 commits intoceph:mainfrom
rkachach:fix_iscsi_test_script

Conversation

@rkachach
Copy link
Contributor

@rkachach rkachach commented Feb 6, 2026

This PR applies minimal changes to test_iscsi_setup.sh to reduce intermittent gwcli failures.

Changes:

  • Introduce ISCSI_INITIATOR_IQN variable (replace repeated literal IQN)
  • Use podman exec -i (drop -t) for more reliable non-interactive runs
  • Add small waits to confirm gateway and host appear in gwcli before configuring CHAP / adding disks
  • Add a best-effort gwcli state dump on failure via trap ERR

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

This PR applies minimal changes to test_iscsi_setup.sh to reduce
intermittent gwcli failures.

Changes:
- Introduce ISCSI_INITIATOR_IQN variable (replace repeated literal IQN)
- Use podman exec -i (drop -t) for more reliable non-interactive runs
- Add small waits to confirm gateway and host appear in gwcli before
configuring CHAP / adding disks
- Add a best-effort gwcli state dump on failure via trap ERR

Signed-off-by: Redouane Kachach <rkachach@ibm.com>
@rkachach rkachach marked this pull request as ready for review February 24, 2026 17:05
@rkachach rkachach requested review from a team and adk3798 February 25, 2026 08:57
@rkachach rkachach changed the title [WIP] qa/tasks: avoid podman TTY flake, verify gateway/host creation qa/tasks: avoid podman TTY flake, verify gateway/host creation Feb 25, 2026
@rkachach rkachach removed the rocky10 label Feb 25, 2026
@rkachach
Copy link
Contributor Author

I removed the rocky10 tag. This PR is meant to add some logic/logging to get better information when the test fails. It's not directly related to rocky10 or python312 changes.

Signed-off-by: Redouane Kachach <rkachach@ibm.com>
Comment on lines +55 to +57
container_gwcli /iscsi-targets/iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw ls
container_gwcli /iscsi-targets/iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw/gateways ls
container_gwcli /iscsi-targets/iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw/hosts ls
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw is repeated in a lot of place.
Can we introduce something similar to ISCSI_INITIATOR_IQN for the target as well?

May be something like:
ISCSI_TARGET_IQN="iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw:
GWCLI_TARGET="/iscsi-targets/${ISCSI_TARGET_IQN}"

Comment on lines +61 to +74
wait_for_ls_contains() {
# Usage: wait_for_ls_contains <path> <needle> [retries] [sleep_s]
local path="$1"
local needle="$2"
local retries="${3:-30}"
local sleep_s="${4:-1}"

for ((i=1; i<=retries; i++)); do
if container_gwcli "${path}" ls 2>/dev/null | grep -qF "${needle}"; then
return 0
fi
sleep "${sleep_s}"
done
return 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a possibility to optionally log the last seen output. It can help confirm whether the list was empty or the command failing.

Copy link
Contributor

@ashjosh1git ashjosh1git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from Kushal's comments, the rest looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants