Skip to content
Snippets Groups Projects
  1. Mar 11, 2024
    • Walter Lozano's avatar
      out-of-space: Move repeated code to a new function · d187a0ba
      Walter Lozano authored
      
      In order to improve readability and maintainability move code that is
      repeated to a new set of functions.
      
      Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
      d187a0ba
    • Walter Lozano's avatar
      out-of-space: Reduce the space available for test · 379ce6ee
      Walter Lozano authored
      
      While running the out-of-space test a dummy file is created to reduce
      the space available. Unfortunately, in some cases the space available
      is still enough to upgrade the system leading to sporadic failures.
      
      The reason behind this are a few:
      - The delta file is dinamically created and is very small, so with very
      little space the update can be applied
      - The way of calculating the space required for a file to fill the disk
      free space is not accurate as it relies in the output of df
      
      In order to make the test more reliable, instead of trying to compute
      the free space allow dd to fill the disk and then truncate the file
      allowing only a very limited space.
      
      Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
      379ce6ee
    • Walter Lozano's avatar
      out-of-space: Ensure OSTree is configured to check for free space · 3f33484b
      Walter Lozano authored
      
      In order for the test update_does_not_start_if_disk_too_low make sense
      OStree should be configured with an appropiate value. The previous
      implementation relied in default values that can changed from
      configuration to configuration, so in order to test the functionality
      force a well known value.
      
      Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
      3f33484b
    • Walter Lozano's avatar
      power-cut: Limit max delay used · fa9dcf09
      Walter Lozano authored
      
      During the power cut test several upgrades are triggered and a delay is
      used to trigger a power cut from LAVA. This delay should only allow the
      upgrade to start but not to finish, as the purpose of the test is to ensure
      that in a power cut AUM does not apply the update.
      
      However, with modern boards delays bigger than 3 sec make the system to
      complete the upgrade and thus making the test to fail.
      
      Workaround this issue by limiting the max delay used. This approach is not
      perfect as it is still not deterministic, but at least should make the test
      more stable. A better approach, taking into account the progress in the update
      should be implemented once this support is included.
      
      Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
      fa9dcf09
  2. Jul 17, 2023
    • Walter Lozano's avatar
      Better fixing for journal parsing · 08bb7110
      Walter Lozano authored
      
      With the latest approach, from time to time, the AUM tests does not catch
      the upgrade and reports the error. This happens due to the fact that
      the upgrade is done right after the restart and cursor is updated in the loop.
      
      To avoid the issue detect change the way AUM crashed are caught taking into
      account the number of restarts in the log.
      
      Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
      08bb7110
  3. Apr 11, 2023
  4. Jan 31, 2023
    • Walter Lozano's avatar
      Fix cursor use with journalctl · 773cfa96
      Walter Lozano authored
      
      If the cursor is not saved in an entry matching the filtering, -u in
      this case, later when logs are searched with a filtering enabled, cursor
      is first move to the first match. With this behavior, using --after-cursor
      will probably skip a valid entry.
      
      To properly save the cursor to later retrieve new logs the same filtering
      should be used to avoid losing logs if the cursor is not pointing to a
      filtered entry.
      
      Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
      773cfa96
    • Walter Lozano's avatar
      Flush logs to properly check test result · 7afbc6f7
      Walter Lozano authored
      
      Under some scenarios, the logs for the AUM restart take longer to appear,
      causing that the cursor is saved before them. Under this situation the test
      might think that AUM was restarted after a crash.
      
      In order to have a reliable way of check logs flush them after restart AUM.
      
      Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
      7afbc6f7
  5. Feb 14, 2022
  6. Feb 11, 2022
  7. Feb 10, 2022
  8. Dec 22, 2021
  9. Nov 26, 2021
  10. Nov 22, 2021
  11. Oct 06, 2021
  12. Aug 17, 2021
  13. Aug 07, 2021
  14. Jul 20, 2021
  15. Feb 27, 2021
  16. Feb 22, 2021
    • Denis Pynkin's avatar
      Fix false positive tests results · 140debb5
      Denis Pynkin authored
      
      If we expect the failure of `apply_update_sync` we should treat
      only "1" return status as expected value.
      Return status "99" is reserved on unexpected failure of AUM itself and
      must indicate the failing test.
      This helps to avoid masking of AUM internal problems.
      
      Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
      140debb5
    • Denis Pynkin's avatar
      lib: detect AUM crash · 5676d033
      Denis Pynkin authored
      
      If AUM is crashed by any reason (SIGSEGV for example) the function
      `apply_update_sync` don't detect that behavior and exit with error code
      after timeout (~8 min). This is leading to false positive result if we
      are expecting the update failure.
      
      Added the check of AUM restart by systemd and return code `99` for that case.
      Different error code allow to determine if the upgrade is failed as
      expected or we have bug in AUM code. Reduces the test time in case of
      AUM crash.
      
      Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
      5676d033
  17. Dec 23, 2020
  18. Dec 21, 2020
  19. Dec 20, 2020
    • Denis Pynkin's avatar
      fix: correct check of the updated state · b5f1aaa6
      Denis Pynkin authored
      
      Commit 8f826964 contain the fix of ostree commit ID parsing.
      Before that commit the ID contained additional suffix (".0") and
      thus the comparison with `COMMIT_AFTER` always shows a difference
      and the test result was __always__ false positive: "pass".
      
      After applying the 8f826964 commit we shed light to other issue --
      we saved a wrong ostree commit ID for later usage.
      In case if we prepare the "outdated" commit -- we must use it's ID
      as "starting" for the test.
      
      Moved the preparation of "outdated" ostree commit into the common
      function `prepare_outdated_commit()` and store the proper ostree
      commit ID as starting point.
      
      Additional side-effect fixed for OTA upgrades -- before current fix
      OTA tests were unstable, sometimes allowing to pass the check even
      with wrong ID written as starting point.
      This is caused by long queues in LAVA nowadays -- the build system may
      prepare and submit the new version while the test is waiting in queue.
      In that case the system do the real upgrade to the OS version newer
      than we have during the test submit.
      
      Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
      b5f1aaa6
  20. Dec 19, 2020
  21. Dec 17, 2020
  22. Dec 16, 2020
    • Denis Pynkin's avatar
      Fix the commit ID parsing · 8f826964
      Denis Pynkin authored
      
      There were an arror in commit ID parsing from the output of:
        $ ostree admin status
        * apertis 334f57354221f0800b008d043c5c50683e83e8b6afa5880e95449a980132fa83.0
            origin refspec: origin:apertis/v2021pre/armhf-uboot/minimal
          apertis bab35cb1fe04e2fc11c3b462ebac0e38640173ebcff55ca326f838296a0121f5.0 (rollback)
            origin refspec: origin:apertis/v2020/armhf-uboot/minimal
      
      Some test contains incorrect boot ID detection, including the suffix
      `.0` which is an error. Hence fixing the issue in the initial script and
      all copy-paste copies.
      
      Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
      8f826964
  23. Jul 29, 2020
  24. Jul 26, 2020
  25. Jul 16, 2020
    • Frederic Danis's avatar
      lib: Fix OTA update test failures · ecc1e308
      Frederic Danis authored
      
      aum-ota-signed test fails with the following traces:
      + testname=test-sign-no_signature
      + apply_update_sync -o
      + local RESULT=1
      + date +%Y-%m-%d %H:%M:%S
      + local BEFORE_UP_DATE=2020-07-14 08:02:30
      …
      Jul 14 08:02:40 apertis apertis-update-[667]: Ostree upgrade failed: Can't verify commit: signature: ed25519: no keys loaded: signed with unknown key
      + journalctl --since 2020-07-14 08:02:30 --unit apertis-update-manager
      + grep -qE Ostree already up to date
      + journalctl --since 2020-07-14 08:02:30 --unit apertis-update-manager
      + grep -qE Ostree upgrade failed
      + echo update failed
      update failed
      …
      + echo test-sign-no_signature: pass
      test-sign-no_signature: pass
      + testname=test-sign-update
      + mkdir -p /etc/ostree/trusted.ed25519.d
      + cp -av apertis.ed25519 /etc/ostree/trusted.ed25519.d/
      `apertis.ed25519' -> `/etc/ostree/trusted.ed25519.d/apertis.ed25519'
      + apply_update_sync -o
      + local RESULT=1
      + date +%Y-%m-%d %H:%M:%S
      + local BEFORE_UP_DATE=2020-07-14 08:02:40
      + + grep -qE Ostree already up to datejournalctl
       --since 2020-07-14 08:02:40 --unit apertis-update-manager
      + + journalctl --since 2020-07-14 08:02:40 --unit apertis-update-manager
      grep -qE Ostree upgrade failed
      + echo update failed
      update failed
      + RESULT=1
      + break
      + kill 707
      + kill 701
      + return 1
      + error_occured
      + set +x
      Job for generated-test-case-offline-upgrade.service failed because the control process exited with error code.
      See \"systemctl status generated-test-case-offline-upgrade.service\" and \"journalctl -xe\" for details.
      Command exited with non-zero status 1
      real	0m 16.77s
      user	0m 0.03s
      sys	0m 0.02s
      <LAVA_SIGNAL_TESTCASE TEST_CASE_ID=offline-upgrade RESULT=fail>
      
      When apply_update_sync is called multiple time too quickly it can see
      messages from previous call and base its result on them.
      
      Signed-off-by: default avatarFrédéric Danis <frederic.danis@collabora.com>
      ecc1e308
Loading