Commit Graph
106 Commits
Author SHA1 Message Date
Gleb Chesnokov 3d4f88273b tests: Add named CI selections for Ginkgo
Keep CI selection policy in shared ci-pr and ci-push label sets. Resolve
them to ordinary Ginkgo expressions for local discovery and execution,
and before booting CI guests so report validation still checks the exact
filter. Preserve ordinary expressions and the full manual selection.

Mark both ACG teardown scenarios as race and exclude that category from
master push runs. Keep their strict overlap, recovery and cleanup checks
unchanged. PR runs retain basic/smoke coverage through ci-pr.

Document the named selections and check their filtering behavior and
propagation through the VM supervisor.
2026-10-16 23:41:25 +03:00
Gleb Chesnokov 0906b897ac docs: Remove case descriptions from test guides
Remove the issue #367 walkthrough from the KUnit guide and the smoke and
SCSI case lists from the Ginkgo guide. Keep scenario expectations with
the tests instead of duplicating them in runner documentation.

Retain label selection, environment requirements and artifact guidance.
Describe optional kernel-log collection without tying it to an issue.
2026-10-16 14:46:19 +03:00
Gleb Chesnokov 7dc98f5b29 scst: Cache the session black-hole mode for task management
Task-management initialization reads sess->acg before acquiring activity
protection. A concurrent reassignment can clear this pointer and later
drop the old ACG reference, so the read can dereference NULL or freed
storage even while ordinary command processing is suspended.

Keep a session-owned copy of the black-hole mode and read it with
READ_ONCE() in the TM path. Initialize it before admitting session work,
retain the old mode while replacing LUNs, and publish the new mode when
installing the new ACG. Update existing sessions on sysfs writes as well.
All writers hold scst_mutex and use WRITE_ONCE(); the TM command already
owns a session reference, so no additional locking or ACG reference is
needed for this scalar policy read.

Read the previous sysfs value under the same mutex so concurrent stores
cannot mistake a real change for a no-op and leave session copies stale.
Extend the private TM tests with sysfs mode transitions, rejected writes,
and old/new drop-policy checks inside and after real reassignment.

Remove the dedicated Ginkgo opt-in and Skip path now that the fix is
in place, so both teardown scenarios run whenever their labels are
selected, including full CI runs.

Link: https://github.com/SCST-project/scst/issues/367
2026-10-16 14:46:19 +03:00
Gleb Chesnokov cf8118a5c8 tests: Exercise ACG changes during iSCSI session teardown
Add opt-in issue-367 scenarios that move a fixture initiator between
disjoint LUN maps alongside logout or an exact TCP socket reset. Wait
for a fresh kernel reassignment message naming the initiator and groups
before requesting teardown, and require overlapping command intervals.
Verify group ownership, recovery and session cleanup after each move.

Capture new kernel records, reject diagnostics or incomplete evidence,
and preserve the target when teardown cannot be justified. Require an
explicit profile option even when all Ginkgo labels are selected.
Test socket selection, log observation and opt-in configuration.

The scenarios use nullio and do not implement a production fix or a
duplicate-IQN login generator. Kernel-observed reassignment and command
overlap do not prove that TM entered the NULL-ACG window; a successful
run means not reproduced.

Link: https://github.com/SCST-project/scst/issues/367
2026-10-16 14:46:19 +03:00
Gleb Chesnokov e467b375e3 kunit: Cover task management across ACG reassignment
Issue #367 reports a TM thread dereferencing sess->acg while the session
reassignment path temporarily clears it. Add private fixtures covering
all black_hole modes for teardown TM functions, mode changes after real
reassignment, and the unchanged-group path.

Invoke the TM reader from the allocation stub during reassignment and
check command state, drop policy and event delivery for all five modes.
Keep the old and new modes equal in this case so that its expected policy
is unambiguous. The regression runs without SKIP and may crash the test
VM before a production fix; document this execution requirement.

Expose only private test entry points and task-scoped redirects; normal
build behavior is unchanged.

Link: https://github.com/SCST-project/scst/issues/367
2026-10-16 14:46:19 +03:00
Gleb Chesnokov 555826aaa5 .github/workflows: Run KUnit and Ginkgo in disposable VMs
Build kernel-matched images on GitHub-hosted runners and execute tests
under an external QEMU supervisor. Run KUnit and Ginkgo in independent
jobs that each build and test SCST. Keep guest images local to each job
and upload build logs and test reports.

Capture serial logs outside the guests, require complete matching
reports, and bound guest execution independently of kernel health.
Exercise guest panic and timeout handling before KUnit. Give Ginkgo an
isolated iSCSI peer and disposable block storage.

Print native test output and summaries in the job log. On failure, include
supervisor errors, kernel diagnostics and bounded serial tails while
retaining complete artifacts and the original test command exit status.

Select basic management and smoke SCSI/I/O tests on both transports for
pull requests. Run every Ginkgo spec after pushes to master and on manual
runs. Pass the label filter into the guest and require both transport
reports to confirm the requested selection.
2026-10-15 20:00:26 +03:00
Gleb Chesnokov a246e3fd2a kunit: Add composite runtime labels
Allow named sets of base labels and exact suite names in one TOML file.
Keep KUNIT_LABEL as the selection interface and combine overlapping sets
without running a suite twice. Include an IO set for CDB, UNMAP and VDISK.

Share expansion between source listing and runtime module selection.
Validate requested sets against the supplied module manifests before any
module operation, then load their owners and dependencies as before.
Reject namespace conflicts, nested sets and incomplete selections.

List descriptions and expanded suites without a build or loaded modules.
Allow an alternate file through --label-config, record selected definitions
in reports, and cover source listing, configuration and module ordering.
2026-10-14 16:30:27 +03:00
Gleb Chesnokov 5144a3c3e2 kunit: Read suite results from debugfs
Read and preserve the native KTAP document for each suite after its run
write completes, under the same operation timeout. Validate the document
identity, plan and completeness independently of the kernel log.

Keep kernel log capture for diagnostics, retained fixtures and unexpected
execution. Preserve the stop and module ownership rules, and cover result
read failures, parameter diagnostics and complete results with an Oops.
2026-10-14 16:30:27 +03:00
Gleb Chesnokov 714bfca753 kunit: Test iSCSI transmit progress and completion
Integrate iSCSI test objects in out-of-tree module builds.
Move transmit state names to a private header and link a separate
suite with task-scoped socket and completion boundaries.

Exercise data, padding and digest progress, retries, short sends and
TX_END completion. Preserve socket arguments and completion order
without creating a socket or initiator session.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov d41d195c4f kunit: Test scst_user cleanup and reply ownership
Link a USER suite with private cleanup access and a task-scoped
pool-flush boundary. Check existing cleanup-yield behavior, post-unjam
flush ordering and session reply ownership without changing logic or
destroying real SGV pools.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov 4029d4f008 kunit: Integrate handler tests and cover VDISK capacity
Include all handler suites through the shared KUnit switch in external
module builds. Link the capacity suite as a separate object with private
access to the command dispatcher. Keep the access declarations available
to ordinary in-tree builds.

Check READ CAPACITY response bytes, queue geometry, short and split
buffers, and invalid CDBs using private fileio and nullio fixtures.
Bind the command CDB to its inline buffer and provide a private session
for allocation-failure status handling.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov e284f3299a kunit: Test LUN rollback, teardown and external blockers
Add private access declarations and task-scoped boundaries for sysfs,
copy-manager admission, grace periods and blocking waits. Preserve
their original operations outside the current test task.

Share the existing ACG release-work layout through the private core
header so the worker and its separate test object use one definition.

Link separate lifecycle and blocker suites covering rollback, mapping
detach order, ACG worker locking and reference ownership. Cleanup
tolerates failed initialization and assertions.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov 593023ba41 kunit: Test copy-manager updates and read-only admission
Expose private functions to a separate test object and stub discovery,
registration and default-group lookup. Keep the actual update and
admission paths unchanged.

Check coalescing, failed inquiry, removal before retry and read-only
LUN rejection using private state.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov bc20ee1ca1 kunit: Test event import, delivery and timeout accounting
Move the existing client layout into a private header and link
separate suites with shared fixtures. Add task-scoped usercopy and
allocation boundaries around the actual ioctl and timeout paths.

Use private clients without scheduling work or accessing userspace
memory. Preserve payload validation and counter behavior; the
delivered-timeout assertion exposes the existing double decrement.

Include the private event headers needed by ordinary in-tree builds
in generated kernel patches.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov bd6671cdda kunit: Test command ordering with bounded worker teardown
Exercise queue policy, barriers, sequence wrap, slot ownership and
concurrent producers through a private declaration of the existing
ordering function.

Keep worker memory outside KUnit-managed resources and pin the module
until completion. Bound teardown waits and report retained state when
a worker cannot finish.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov 82d9a42ec5 kunit: Test CDB decoding and direction contracts
Link a separate CDB test object with private access to command
parsing. Exercise tape and disk transfer decoding, REWIND and
initiator direction checks on private commands without altering
production behavior.

Provide private device, target-device and session state required by
command parsing, and optional logs of decoded direction expectations.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov de6f96695f kunit: Test UNMAP parsing and atomic overlap boundaries
Give the separate UNMAP suite private access to the actual overlap
function. Check parser and consumer contracts without changing
validation or descriptor traversal.

Bind each command's CDB pointer to its private buffer and provide a
private session for allocation-failure status handling.

Use allocated guard descriptors to expose count violations safely.
Expect incomplete final descriptors to be ignored while preserving
complete descriptors, including when the CDB truncates the list. Stop
sense and descriptor checks if the parser returns an unexpected status.
Keep correct-result assertions for existing failures and explicitly skip
short-transfer cases that could read beyond the baseline buffer.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov 0ebd6c3328 kunit: Test ALUA callback delivery with private groups
Exercise state transitions with unregistered groups, devices and
mappings. Check per-device callback delivery, ordering, optional
callbacks and unchanged or invalid states without changing ALUA
behavior.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov d89f53368b kunit: Add full test builds and label-based execution
Provide kunit-build for all test-owning modules and their dependencies,
kunit-run for existing artifacts, and kunit-test for a sequential build
and run even under make -j. Allow root builds and run every command with
the caller's privileges. Require root for module execution.

Map KUNIT_TEST and KUNIT_LOG to private Kbuild switches. Default
KUNIT_LABEL to ALL and use KUNIT_ARGS for other runner options and
module paths. Resolve artifacts from explicit arguments, configuration
or the recorded build, preserving spaces. Group and align the Makefile
help for component tests, KUnit and ordinary build targets.

Read label-to-suite mappings and dependency order from module metadata,
without a separate Python owner registry. Reject dependency cycles and
missing SCST core artifacts. Load external kernel dependencies with
modprobe before preparing KUnit; keep shared system
modules loaded. Load only selected SCST owners and their dependencies
from the supplied build and trigger suites through native KUnit debugfs.

Support built-in and modular KUnit with autorun disabled. Load modular
KUnit with known parameters when absent and release it after SCST
cleanup or a clean initial load failure. Reuse an existing instance only
after validating its effective parameters in sysfs; reject invalid or
unreadable values without changing the module. Never unload preloaded
KUnit. Check global filters before loading SCST.

Capture fresh kernel records and parse suites with the upstream KTAP
parser. Preserve logs and skip reasons, associating first-parameter
diagnostics with their case without changing plans or results. Stop
module operations on incomplete evidence, diagnostics or retained
fixtures. Continue after ordinary assertion failures. Finish capturing
output after command exit. Distinguish suites not started from missing
results, and count each Oops as one event. Print concise errors and
colored terminal statuses as suites finish. Group failure details after
progress. Normalize each assertion block independently of printk
messages while retaining value indentation. Follow with explicit stop
reasons and a compact SCST build summary. Reserve module headings,
author, license, source checksums, vermagic and other modules for
verbose output. Keep full case logs, module metadata and kernel
diagnostics in plain-text and JSON reports.

Cover build ordering, selection, kernel setup, dependency preparation,
runner lifecycle and reporting with mocked operations. Document VM
setup, build, execution and extension in the KUnit guide.

Add kunit-clean for test-owning component builds. Invalidate the recorded
module list and clear tooling caches on ordinary and component clean
paths too, including failed cleanup. Preserve reports and user settings.

Check all tooling, kunit-build and cleanup in one CI job. Pin the
Fedora container by digest and fetch a fixed kernel-devel package from
Koji with a SHA-256 check, independently of the regression matrix.
Save build evidence without building a kernel or loading modules.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov c3070172c7 kunit: Add a shared test switch and a core library suite
Integrate optional native KUnit suites with out-of-tree SCST modules.
A single CONFIG_SCST_KUNIT_TEST switch includes all test objects of
each owner. Declare each suite name and label once and discover source
registrations for kunit-list without a build or loaded modules.
Preserve ordinary builds without KUnit.

Start with a fixed-wire LUN regression. Centralize private visibility
and task-scoped static-stub switches, and define retained-fixture
reporting for asynchronous tests. Use current native KUnit APIs
without compatibility shims. Keep optional execution messages behind
CONFIG_SCST_KUNIT_LOG while leaving failure diagnostics unconditional.

Add Makefile/Kbuild regression checks and document the shared switch.

Keep compatibility builds free of KUnit, including inherited test
options and allmodconfig. Generate ordinary in-tree SCST patches with
private declarations but without test suites or KUnit build options.
Check this boundary and preserve kernels without an unwinder option.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov e7ad7e093e scst_user: Document the current userspace ABI
The scst_user specification copies ioctl structures and command payloads
that predate several ABI extensions. Building a handler from those
layouts can select the wrong union member, alignment or completion path.

Commit 3fc775c75a ("EXTENDED COPY support") added remapping payloads.
Commit daee4dcb7e ("WRITE SAME command improvements") added WRITE
SAME descriptors. Commit d1bd22afd9 ("scst_user: avoid global locks")
left the explicit unregister ioctl as an obsolete no-op.

Use scst/include/scst_user.h and scst_user.c as the producer-side
source of truth. Synchronize registration, command, reply and subcommand
layouts, version checks, reserved fields and ioctl rules.

Update the fileio_tgt, stpgd and event guides from current code. Make
live-storage and event-consumption risks explicit.
2026-08-21 10:05:36 +03:00
Gleb Chesnokov 59e915e822 doc/scst_pg.sgml: Update the programming guide
The programming guide presents copied structure layouts, callbacks
and management paths as current interfaces. API and build changes have
left those copies describing fields and operations that no longer exist.

Commit 08e532715d ("Remove procfs support") removed the documented
procfs callbacks and paths. Commit 2090b6811a ("qla2x00t: remove
detect() callback") moved QLogic setup out of the template detect hook.

Make scst/include/scst.h and scst/SysfsRules authoritative, and label
embedded declarations as historical outlines. Update callback names,
QLogic initialization, sysfs trace commands and build modes.

The supported kernels in nightly/conf/nightly.conf also span different
Kconfig and logging interfaces. Refer readers to the exact target
kernel instead of prescribing fixed debug symbols, buffer limits and
syslog paths.
2026-08-21 10:05:36 +03:00
Gleb Chesnokov b2a1f6e66a Bump the version number to 3.11.0-pre
These changes have been generated by running the following command:

$ scripts/update-version 3 11 0 -pre
2025-12-29 13:06:44 +03:00
Gleb Chesnokov d4cb03e2b8 Bump the version number to 3.10.0
These changes have been generated by running the following command:

$ scripts/update-version 3 10 0
2025-12-29 12:40:21 +03:00
Gleb Chesnokov 2bdc19a61f Bump the version number to 3.10.0-pre
These changes have been generated by running the following command:

$ scripts/update-version 3 10 0 -pre
2024-12-28 17:14:54 +03:00
Gleb Chesnokov a68cb8e94d Bump the version number to 3.9.0
These changes have been generated by running the following command:

$ scripts/update-version 3 9 0
2024-12-28 16:44:09 +03:00
Gleb Chesnokov 188256792c Bump the version number to 3.9.0-pre
These changes have been generated by running the following command:

$ scripts/update-version 3 9 0 -pre
2024-01-15 15:33:45 +03:00
Gleb Chesnokov 1171841931 Bump the version number to 3.8.0
These changes have been generated by running the following command:

$ scripts/update-version 3 8 0
2024-01-15 13:59:19 +03:00
Gleb Chesnokov b78582f34d Bump the version number to 3.8.0-pre
These changes have been generated by running the following command:

$ scripts/update-version 3 8 0 -pre
2022-12-28 17:08:44 +03:00
Gleb Chesnokov 1ef10b852d Bump the version number to 3.7.0
These changes have been generated by running the following command:

$ scripts/update-version 3 7 0
2022-12-27 16:47:20 +03:00
Gleb Chesnokov 049dc57b10 scst: Drop support for detect() method
Support for scst_tgt_template detect() method was declared obsolete
in 2015. Remove support for scst_tgt_template detect() method.

See also commit 4ac6d7a26d ("[PATCH] scst: Drop detect() method").
2022-11-10 11:46:03 +03:00
Chesnokov Gleb 64a8485fe7 Bump the version number to 3.7.0-pre
These changes have been generated by running the following command:

$ scripts/update-version 3 7 0-pre
2022-01-11 16:37:34 +03:00
Bart Van Assche 9c5406664a Bump the version number to 3.6.0
These changes have been generated by running the following command:

$ scripts/update-version 3 6 0
2021-12-29 19:19:14 -08:00
Bart Van Assche c0151f6cda Bump the version number to 3.6.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9310 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-01-02 23:16:59 +00:00
Bart Van Assche d3c92ea7aa Bump the version number to 3.5.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9231 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-12-22 03:38:21 +00:00
Bart Van Assche d12b0a0d91 Fix spelling in documentation and source code
See also https://github.com/bvanassche/scst/pull/20.

[ bvanassche: left out qla2x00t-32gbit changes and changed patch description ]



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8920 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-15 18:53:48 +00:00
Bart Van Assche ecaab978f0 scst, scstadmin, ...: Bump the version number to 3.5.0-pre
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8683 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-06 05:28:56 +00:00
Bart Van Assche fa156aa40d scripts/update-version: Fix the code for updating the scstadmin version number
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8681 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-04 05:00:49 +00:00
Bart Van Assche 70150cb912 scst: Remove the exec_sync flag
Since all device handlers have at least one asynchronous mode, remove
the exec_sync flag.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7919 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-12 03:07:54 +00:00
Bart Van Assche 69fde133e9 Revert r7524
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7525 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-10-31 14:25:52 +00:00
Bart Van Assche 91b99af914 scst, srpt, iscsi-scst, qla2x00t, fcst: Bump version number to 3.4.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7524 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-10-31 14:24:20 +00:00
Vladislav Bolkhovitin 5968cb4567 docs: version updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6785 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-01-22 03:08:44 +00:00
Vladislav Bolkhovitin 0b8cb936d3 docs: fix (extra)clean brocken by r6716
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6720 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-12-08 03:44:51 +00:00
Bart Van Assche edfd19ee7e scst: Rename the PR-sync document to avoid filenames with spaces in the SCST tree
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6716 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-12-02 16:57:45 +00:00
Vladislav Bolkhovitin 9d61dc4b03 Cluster SCSI state sync support
From Bart Van Assche <Bart.VanAssche@sandisk.com>
Prepared with help from Pralay Dakua <Pralay.Dakua@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6573 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-06 03:23:46 +00:00
Vladislav Bolkhovitin 90ad49cbae scst_user: optimize performance by exchanging multiple commands/responses per IOCTL
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6466 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-08-08 02:57:14 +00:00
Vladislav Bolkhovitin d1bd22afd9 scst_user: avoid global locks
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6221 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-06 04:35:06 +00:00
Vladislav Bolkhovitin c7868c2733 Docs updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6015 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-30 01:35:32 +00:00
Bart Van Assche ee86982787 doc/scst_pg.sgml: Remove trailing whitespace
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5937 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-12 09:34:55 +00:00
Vladislav Bolkhovitin 10ebf80e7a Docs update
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5931 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-11 04:27:17 +00:00