Skip to content

Override Eject function for Streamer device (#1538)#1545

Merged
rdmark merged 3 commits intodevelopfrom
1538-tape-device-after-ejecting-an-image-it-cannot-be-inserted-again
Nov 23, 2025
Merged

Override Eject function for Streamer device (#1538)#1545
rdmark merged 3 commits intodevelopfrom
1538-tape-device-after-ejecting-an-image-it-cannot-be-inserted-again

Conversation

@rdmark
Copy link
Copy Markdown
Member

@rdmark rdmark commented Nov 10, 2025

In order for the Eject command to properly release the image and reset the status, we need to override the Eject function with the appropriate logic

The other removable disk drive devices inherit the Disk class, and hence do not need this

Improves the test suite to more thoroughly test the eject scenario with all removable device types, plus other fixes to the tests

Shifts the backend test container registry to GHCR, away from Docker Hub

@rdmark rdmark requested a review from akuker as a code owner November 10, 2025 22:46
@rdmark rdmark linked an issue Nov 10, 2025 that may be closed by this pull request
@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Nov 10, 2025

@bog-dan-ro This got Eject on Tape devices working for me. Please give a test yourself if you have the opportunity!

Note to self: add unit tests to cover this scenario.

Copy link
Copy Markdown
Member

@nucleogenic nucleogenic left a comment

Choose a reason for hiding this comment

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

LGTM, but seems like I should wait for the tests before 👍 on this?

@rdmark rdmark force-pushed the 1538-tape-device-after-ejecting-an-image-it-cannot-be-inserted-again branch 4 times, most recently from 5b78df4 to 0786966 Compare November 12, 2025 06:12
@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Nov 12, 2025

Something really weird happens when attaching a Tape device in the integration tests. The type parameter doesn't get captured for whatever reason. It works for all the other devices, and it works in the Web UI, so I'm stumped right now.

Failure in the integration tests

backend-1  | [2025-11-12 18:45:25.168] [trace] Received ATTACH command
backend-1  | [2025-11-12 18:45:25.168] [info] Validating: operation=ATTACH, command params='locale=en', 'token=???', device id=6, lun=0, type=, vendor='', product='', revision='', block size=0
backend-1  | [2025-11-12 18:45:25.168] [error] Unknown device type 

Success in the Web UI

Nov 12 18:50:50 piscsi PISCSI[342]: [2025-11-12 18:50:50.454] [trace] Received ATTACH command
Nov 12 18:50:50 piscsi PISCSI[342]: [2025-11-12 18:50:50.456] [info] Validating: operation=ATTACH, command params='locale=en', 'token=???', device=4:0, type=SCTP, vendor='', product='', revision='', block size=0
Nov 12 18:50:50 piscsi PISCSI[342]: [2025-11-12 18:50:50.458] [info] Executing: operation=ATTACH, command params='locale=en', 'token=???', device=4:0, type=SCTP, vendor='', product='', revision='', block size=0
Nov 12 18:50:50 piscsi PISCSI[342]: [2025-11-12 18:50:50.458] [info] Attached SCTP 4:0

@rdmark rdmark marked this pull request as draft November 14, 2025 22:56
In order for the Eject command to properly release the image and reset the status,
we need to override the Eject function with the appropriate logic

The other removable disk drive devices inherit the Disk class,
and hence do not need this
@rdmark rdmark force-pushed the 1538-tape-device-after-ejecting-an-image-it-cannot-be-inserted-again branch from 778c864 to 3b36730 Compare November 21, 2025 17:29
@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Nov 22, 2025

With a small fix the tests are running better (namely: don't pass block_size to SCTP which is won't accept) but there are failures later in two tests.

However the tests pass with flying colors on my local RPi so there's something in the CI environment now that causes the failures.

Edit: The failures were due to a stale backend test container! Updated the workflow to push to GHCR instead of Docker Hub. Not sure what was up with the Docker Hub registry, but having them here on GHCR is preferable in the long term anyways.

Additional fixes:
- add support for SCTP to the attach test
- remove device_props test data that was ignored
@rdmark rdmark force-pushed the 1538-tape-device-after-ejecting-an-image-it-cannot-be-inserted-again branch 2 times, most recently from 56f2b82 to 1a828e6 Compare November 22, 2025 16:45
@rdmark rdmark requested a review from nucleogenic November 22, 2025 16:50
@rdmark rdmark force-pushed the 1538-tape-device-after-ejecting-an-image-it-cannot-be-inserted-again branch from bb02854 to 1a828e6 Compare November 22, 2025 16:58
@rdmark rdmark marked this pull request as ready for review November 22, 2025 17:16
@rdmark rdmark force-pushed the 1538-tape-device-after-ejecting-an-image-it-cannot-be-inserted-again branch 2 times, most recently from 12004f6 to 50bdee3 Compare November 22, 2025 17:59
@sonarqubecloud
Copy link
Copy Markdown

@rdmark rdmark merged commit 2f25bd1 into develop Nov 23, 2025
12 checks passed
@rdmark rdmark deleted the 1538-tape-device-after-ejecting-an-image-it-cannot-be-inserted-again branch November 23, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tape device: After ejecting an image it cannot be inserted again

2 participants