Skip to content

Conversation

@nitinn22
Copy link

@nitinn22 nitinn22 commented Feb 5, 2026

(Kernel/Baseport): Add SuspendResume validation test suite

Add comprehensive ADB-based suspend/resume validation test for Qualcomm Linux devices. The test remotely triggers suspend via rtcwake, validates resume functionality, and collects detailed power management statistics.

Key Features:

  • ADB-based remote device control
  • Automated suspend/resume cycle with 30s suspend duration
  • Triple validation: suspend count, dmesg markers, resume markers

Test Components:

  • run.sh: Main test script with device detection and validation logic
  • README.md: Detailed documentation with usage examples and troubleshooting
  • SuspendResume.yaml: LAVA integration configuration

Prerequisites: Single ADB device, root access, rtcwake support

Signed-off-by: Nitin Nakka nitinn@qti.qualcomm.com

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
Copy link
Contributor

@smuppand smuppand left a comment

Choose a reason for hiding this comment

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

Test location & structure
Confirm expected placement under Runner/suites/Kernel/... and alignment with our standard YAML pattern.
If this is host-side, we likely shouldn’t place it under Runner suites at all.
Can you align it to our on-device testkit format if DUT-side is desired?

WAIT_TIMEOUT=40 # seconds to wait for device to resume

# Check if adb is available
if ! command -v adb >/dev/null 2>&1; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Our repo is executed on the DUT (inside LAVA) via Runner/.../run.sh.
Your test is host-driven (requires adb on host).
Do you intend this test to run on host or on DUT?
If host: where is it supposed to live (not inside Runner suites)? If DUT: can you provide an on-device version?

Copy link
Contributor

Choose a reason for hiding this comment

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

We can accomodate running the test script on host using adb but I think for clarity the path in the repository should be different.

Copy link
Author

@nitinn22 nitinn22 Feb 6, 2026

Choose a reason for hiding this comment

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

Yes, this is host driven due to limitations of continuing shell with this particular test. Please suggest location where to host this folder.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this is host driven due to limitations of continuing shell with this particular test. Please suggest location where to host this folder.

Suggested options:
Put it under a clearly host-only area, e.g.

  • host-tools/suspend-resume/ or tools/host/SuspendResume/

  • Alternatively, provide two variants:

    • Runner/suites/.../SuspendResume/ → DUT-side RTC baseline only (no adb)
    • tools/host/... → adb/host-driven extension (optional)

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it's possible to have the host based script. I tried this approach in the past and it didn't work. Suspend breaks the execution of the script and thus LAVA can't complete the test shell with suspend step. IMHO the only way of testing it in LAVA is to have a host based script (with adb connection). Feel free to experiment with host based scripts and demonstrate it's possible - I might be wrong here.

Copy link
Author

Choose a reason for hiding this comment

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

Moved to New path is: qcom-linux-testkit\host-tools\SuspendResume, adb driven test suite. Removed from Runner.

log_info "Command: rtcwake -d /dev/rtc0 -m no -s $SUSPEND_DURATION && systemctl suspend"

# Execute suspend command (this will disconnect adb)
adb shell "rtcwake -d /dev/rtc0 -m no -s $SUSPEND_DURATION && systemctl suspend" &
Copy link
Contributor

Choose a reason for hiding this comment

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

Connectivity during suspend
ADB will drop during suspend for most devices.
Your script uses adb shell "rtcwake ... && systemctl suspend" then polls adb shell "echo test".
How do you guarantee adb comes back reliably on resume across boards?
Do you expect the DUT to re-enumerate USB consistently, or require adb reconnect, etc.?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed. This will be tricky to guarantee.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, the default expectation is that the USB interface re‑enumerates consistently. Do you suggest adding an explicit reconnect step before wait-for-device? (i.e., using adb reconnect usb).
Also, the current echo-based polling in the script was intentionally chosen to make the resume detection non‑blocking, unlike adb wait-for-device, which blocks. With this approach, I was able to run around 15 back‑to‑back iterations on one platform and the device reconnected correctly each time.

@smuppand smuppand requested a review from mwasilew February 5, 2026 17:02
@smuppand
Copy link
Contributor

smuppand commented Feb 5, 2026

@mwasilew
Copy link
Contributor

mwasilew commented Feb 5, 2026

Here is a job using this patch: https://lava-staging.infra.foundries.io/scheduler/job/217
First issue to fix is file permissions

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
@nitinn22 nitinn22 requested a review from smuppand February 6, 2026 14:18
Copy link
Contributor

@mwasilew mwasilew left a comment

Choose a reason for hiding this comment

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

Please test your changes before sending for review. I'll stop looking at any new changes without a link to a job you submitted to LAVA to prove that your changes work.

run:
steps:
- REPO_PATH=$PWD
- cd Runner/suites/Kernel/Baseport/SuspendResume
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the path.

Copy link
Author

Choose a reason for hiding this comment

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

Updated the paths in files.

Copy link
Contributor

Choose a reason for hiding this comment

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

please share a test job that demonstrates it works.

Copy link
Author

Choose a reason for hiding this comment

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

Job link: https://lava.infra.foundries.io/scheduler/job/141569,

I am seeing error: I am using a target past job to retrigger this test, does the build support ADB? as i see below error from the test script?

[INFO] 1970-01-01 00:00:32 - -----------------------------------------------------------------------------------------
[INFO] 1970-01-01 00:00:32 - -------------------Starting SuspendResume Testcase (ADB-based)----------------------------
[INFO] 1970-01-01 00:00:32 - === Test Initialization ===
[INFO] 1970-01-01 00:00:32 - Checking for connected ADB devices...
[INFO] 1970-01-01 00:00:32 - Detected 0 device(s)
[FAIL] 1970-01-01 00:00:32 - No ADB devices connected - please connect a device

Copy link
Contributor

Choose a reason for hiding this comment

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

As you might not be aware, RB3g2 requires Renesas firmware to be included in the build for USB stack to work. meta-qcom builds don't include Renesas firmware due to licensing issues. This state is expected - no USB on RB3gen2.

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
…ng tests similar to runner if more tests are added in future and modified the readme file

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
…unner to run independently.

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you duplicate the whole functestlib?

Copy link
Author

Choose a reason for hiding this comment

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

The duplication enables host-tools to be deployed independently from Runner, which is useful for CI/CD scenarios that only need host-side ADB tests. However, if you prefer to avoid duplication, I can create a symbolic link instead. I am not sure if it would work directly without changes or needs rework on scripts. What's your preference?

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you give a scenario when duplication is actually required? I can't think of any. I would prefer a symlink or just using the file directly.

Copy link
Author

Choose a reason for hiding this comment

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

Using the file directly the changes are done, https://lava.infra.foundries.io/scheduler/job/141848 unable to proceed due to resource not available.

… now made a symlink instead of full copy in the host-tools utils path

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
…s are failing instead pointing directly from init_env

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.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.

3 participants