Skip to content

[Benchmark] storage kinds ram and network; a btrfs subvolume resolves to its device - #4498

Open
coryjett wants to merge 1 commit into
Niko1221:mainfrom
coryjett:fix-bench-storage-kind
Open

coryjett wants to merge 1 commit into
Niko1221:mainfrom
coryjett:fix-bench-storage-kind

Conversation

@coryjett

Copy link
Copy Markdown

Problem and result

Fixes #4493. storage_of (strata_cli/bench_facts.py) read the mount's SOURCE and gave up when it was not a
/dev/ path. A model copied to /dev/shm (tmpfs), a btrfs subvolume (SOURCE /dev/nvme0n1p2[/@home], the
Fedora default) and an NFS export (host:/export) all produced hardware.storage: null with the reason "the drive
holding the model files could not be identified". Our run in #4468 shows it for /dev/shm.

After: FSTYPE is read with SOURCE. tmpfs, ramfs, devtmpfs and hugetlbfs report {"kind": "ram", "model": "tmpfs", "bus": "memory"}; nfs*, cifs, smb*, 9p, ceph, glusterfs and fuse.sshfs report {"kind": "network", "model": "<fstype>", "bus": "network"} (the host name stays out of the report); a btrfs [subvolume] suffix is stripped
before lsblk, so the disk is found as for any other device. Other sources still give None with the old reason.

Related discussion

#4493

Approach

Linux branch of storage_of only; Windows and the lsblk walk are unchanged. The README line renders as
"ram tmpfs (memory)" through the existing "%s %s (%s)" format. validate() checks that the storage field exists,
not its kind values, so the two new kinds pass as they are.

Validation

Passed:

  • python3.12 -m unittest tests.terminal.test_bench_facts_storage tests.terminal.test_bench_standard tests.terminal.test_bench_facts_amd:
    Ran 82 tests in 43.762s, OK (1 skipped). Strata Control 0.1.52's bundled Python 3.12.15, Ubuntu 26.10, this branch (main 46c152a + this commit).
  • The new tests/terminal/test_bench_facts_storage.py on unchanged main: Ran 5 tests in 0.002s FAILED (failures=3) (tmpfs, NFS and btrfs cases fail; the plain-device and unknown-source cases pass as before).

Failed:

  • None observed.

Not run:

  • A new strata bench run with this branch (the real /dev/shm case is only covered by the unit test with findmnt's output string).
  • Windows.

Limits

  • The fstype lists are the common ones; an unlisted network filesystem still reports None with the old reason.

🤖 Generated with Claude Code

…to its device (Niko1221#4493)

storage_of gave up on any mount whose source was not a /dev path, so a model copied to /dev/shm, a btrfs
subvolume (/dev/nvme0n1p2[/@home]) or an NFS export all reported "the drive holding the model files could not
be identified". Read FSTYPE with SOURCE: tmpfs and friends are kind ram, network filesystems kind network (the
host stays out of the report), and a btrfs [subvolume] suffix is stripped before lsblk.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

[Benchmark] a model in /dev/shm reports "the drive could not be identified" instead of RAM

1 participant