-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kola: Support the Debian autopkgtest reboot API
As I was working on extending some of ostree's destructive test suite to do reboots: ostreedev/ostree#2127 I realized that the Debian autopkgtest API for rebooting is better, because it allows *saving state external to the host*. Rather than having the test count boots as ostree is doing today, the "mark" allows us to more reliably dispatch. And further, becase we don't rely on writing anything to disk on the target, we can add clean support for "forced reboots" that might kill the OS before we write to persistent storage there. The "between reboot" state lives in the test runner's memory instead. We retain support for the previous (two!) reboot APIs here for now. I tested this with basically the example script from the Debian autopkgtest specification: ``` set -xeuo pipefail case "${AUTOPKGTEST_REBOOT_MARK:-}" in "") echo "test beginning"; /tmp/autopkgtest-reboot mark1 ;; mark1) echo "test in mark1"; /tmp/autopkgtest-reboot mark2 ;; mark2) echo "test in mark2" ;; *) echo "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}"; exit 1;; esac echo "ok autopkgtest rebooting" ``` I think it will make sense actually to implement more of the autopkgtest API - Debian has a nontrivial number of tests using this, and I think there's even work upstream in e.g. systemd to bridge its tests to autopkgtest. Which would mean we gain "run systemd's tests in kola" for free.
- Loading branch information
Showing
2 changed files
with
92 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters