Skip to content

Empty resolution_before_suspend file causing after suspend failures #2750

Description

@rene-oromtz

Bug Description

The resolution_before_suspend test should record the resolution before suspend. However, due to it being a xrandr + grep invocation, most likely the test is failing to identify the currently active mode creating an empty file which is later compared to the output of xrandr after suspend.

Submission: https://certification.canonical.com/hardware/202008-28167/submission/504265/

Cert-blocker Test Case

  • cert-blocker

To Reproduce

  1. Launch a test plan that contains both resolution tests
  2. suspend/1_resolution_before_suspend_TU104M__GeForce_RTX_2070_SUPER_Mobile___Max_Q__auto is run
  3. Suspend is made
  4. After suspend, the suspend/1_resolution_after_suspend_TU104M__GeForce_RTX_2070_SUPER_Mobile___Max_Q__auto runs

Expected Result

Resolution before and after should be the same and both test should pass

Actual Result

  1. Before suspend test passed but the file is empty, given its just a shell command it doesn't verify the grep found a match and that the file is not empty
  2. After suspend test failed, only the resolution after suspend is present

Environment

  • OS: 22.04.5
  • Checkbox type: Snap
  • Checkbox version: 7.4.0.dev111

Relevant log output

Before suspend test log:

++ DRIVER=nvidia
++ INDEX=1
+++ echo ''
+++ rev
+++ cut -d / -f 1
+++ rev
++ PCIBUS=
++ PCIBUS_OFFLOAD_FORMAT=pci-
+++ udev_resource.py -l VIDEO
+++ grep -oP -m1 '\d+'
++ NB_GPU=1
++ [[ 1 -gt 1 ]]
++ unset DRI_PRIME
++ ensure_xdg_session_type
++ local max_attempts=5
++ local attempt=0
++ '[' -z x11 ']'
++ export XDG_SESSION_TYPE
+ xrandr -q
+ grep '[*]'
+ awk '{print $1}'

After suspend test log:

++ DRIVER=nvidia
++ INDEX=1
+++ echo ''
+++ rev
+++ cut -d / -f 1
+++ rev
++ PCIBUS=
++ PCIBUS_OFFLOAD_FORMAT=pci-
+++ udev_resource.py -l VIDEO
+++ grep -oP -m1 '\d+'
++ NB_GPU=1
++ [[ 1 -gt 1 ]]
++ unset DRI_PRIME
++ ensure_xdg_session_type
++ local max_attempts=5
++ local attempt=0
++ '[' -z x11 ']'
++ export XDG_SESSION_TYPE
+ xrandr -q
+ grep '[*]'
+ awk '{print $1}'
+ diff /var/tmp/checkbox-ng/sessions/session_title-2026-08-16T20.11.59.446122.session/session-share/1_resolution_before_suspend.txt -
0a1
> 1280x1024

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions