Skip to content

Comments

Move stress-ng disk test location from /tmp to /root/tmp#1

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/update-default-disk-test-location
Draft

Move stress-ng disk test location from /tmp to /root/tmp#1
Copilot wants to merge 4 commits intomainfrom
copilot/update-default-disk-test-location

Conversation

Copy link

Copilot AI commented Nov 4, 2025

Relocates the default disk test scratch directory from the shared system /tmp to /root/tmp for better isolation and control of test artifacts.

Changes

checkbox_support/disk_support.py

  • Changed Disk class default test_dir from /tmp to /root/tmp
  • Ensured /root/tmp is created in simulate mode via os.makedirs(..., exist_ok=True)

providers/base/bin/stress_ng_test.py

  • Added tracking of /root/tmp pre-existence before test execution
  • Updated cleanup logic to:
    • Remove test-specific subdirectories (/root/tmp/stress-ng-* or /mnt/.../tmp/stress-ng-*)
    • Remove /root/tmp itself if created by the test and empty

Behavior

# Default (non-mounted partition)
test_dir = "/root/tmp"  # was "/tmp"

# Mounted partition (unchanged)
test_dir = f"{mount_point}/tmp/stress-ng-{uuid}"

# Cleanup now removes both test subdirectories and /root/tmp if created

Mounted filesystem behavior remains unchanged. Only the fallback directory path changes.

Original prompt

Move the default disk test location for stress-ng from /tmp to /root/tmp.

  1. Update checkbox_support/disk_support.py:

    • In the Disk class __init__, change the default for self.test_dir from /tmp to /root/tmp when not using a mounted partition.
    • In mount_filesystem(), ensure that the scratch directory is created under /root/tmp (e.g., /root/tmp/stress-ng-UUID), unless using a mounted filesystem as before.
    • Ensure that /root/tmp is created (with os.makedirs(..., exist_ok=True)) if it doesn't exist before the test runs.
  2. In providers/base/bin/stress_ng_test.py:

    • Ensure that after disk tests finish, all test data, including /root/tmp/stress-ng-... and /root/tmp (if it didn't already exist), is removed.
    • If cleanup currently only happens for directories other than /tmp, update the logic to handle /root/tmp as the new scratch base.
    • Update all usage/comments to reference /root/tmp for disk tests, not /tmp.
  3. Tests:

    • Ensure existing and new test cases expect /root/tmp and related structure as the default disk test directory.
    • Clean up /root/tmp in tests as necessary.

This pull request was created as a result of the following prompt from Copilot chat.

Move the default disk test location for stress-ng from /tmp to /root/tmp.

  1. Update checkbox_support/disk_support.py:

    • In the Disk class __init__, change the default for self.test_dir from /tmp to /root/tmp when not using a mounted partition.
    • In mount_filesystem(), ensure that the scratch directory is created under /root/tmp (e.g., /root/tmp/stress-ng-UUID), unless using a mounted filesystem as before.
    • Ensure that /root/tmp is created (with os.makedirs(..., exist_ok=True)) if it doesn't exist before the test runs.
  2. In providers/base/bin/stress_ng_test.py:

    • Ensure that after disk tests finish, all test data, including /root/tmp/stress-ng-... and /root/tmp (if it didn't already exist), is removed.
    • If cleanup currently only happens for directories other than /tmp, update the logic to handle /root/tmp as the new scratch base.
    • Update all usage/comments to reference /root/tmp for disk tests, not /tmp.
  3. Tests:

    • Ensure existing and new test cases expect /root/tmp and related structure as the default disk test directory.
    • Clean up /root/tmp in tests as necessary.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 4, 2025 12:36
Co-authored-by: rodwsmith <104451842+rodwsmith@users.noreply.github.com>
Co-authored-by: rodwsmith <104451842+rodwsmith@users.noreply.github.com>
Co-authored-by: rodwsmith <104451842+rodwsmith@users.noreply.github.com>
Copilot AI changed the title [WIP] Move default disk test location for stress-ng to /root/tmp Move stress-ng disk test location from /tmp to /root/tmp Nov 4, 2025
Copilot AI requested a review from rodwsmith November 4, 2025 12:48
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.

2 participants