-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test/system: Decouple image caching from Zuul
Since the rewrite of the system test suite[0] we've relied on the Zuul playbooks for taking care of caching images using Skopeo for increasing the reliability of the tests (in the past the instability of the Fedora registry caused problems). This state is problematic if we want to use the tests in other environments than the Zuul CI. This moves the caching from Zuul into the system tests. Currently, Bats does not support officially suite-wide setup and teardown functions. The solution I chose was to add two new test files that are executed before and after all tests. This may complicate the execution of cherry-picked tests but that is not a very common use case anyway. The tests are now to some extent capable of adjusting to the host environment. This is meant in the sense of: I'm running on RHEL, the "default image" is UBI; I'm running on Fedora, the "default image" is fedora-toolbox. This mechanism relies on os-release, which is the same as what Toolbox itself uses. Along the road I chose to update the f29/fedora-toolbox:29 image to the fedora-toolbox:32 image because I did not want to maintain two versions of images (the name changed some time ago[1]). I also introduced or modified a number of helper functions to make better use of the caching and default system recognition. [0] #517 [1] #615 #774
- Loading branch information
1 parent
a24c2f6
commit 16b3560
Showing
6 changed files
with
229 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bats | ||
|
||
load 'libs/helpers' | ||
|
||
@test "test suite: Setup" { | ||
# Cache the default image for the system | ||
_pull_and_cache_distro_image $(get_system_id) $(get_system_version) || die | ||
# Cache all images that will be needed during the tests | ||
_pull_and_cache_distro_image fedora 32 || die | ||
_pull_and_cache_distro_image busybox || die | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bats | ||
|
||
load 'libs/helpers' | ||
|
||
@test "test suite: Teardown" { | ||
_clean_cached_images | ||
} |
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