-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic test for podman-quadlet #2216
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,36 @@ | ||
variant: fcos | ||
version: 1.4.0 | ||
storage: | ||
files: | ||
- path: /etc/containers/systemd/test.container | ||
contents: | ||
inline: | | ||
[Unit] | ||
Description=A minimal container | ||
|
||
[Container] | ||
Image=registry.fedoraproject.org/fedora-minimal | ||
Exec=sleep 60 | ||
Volume=test.volume:/data | ||
Network=test.network | ||
|
||
[Service] | ||
Restart=always | ||
|
||
[Install] | ||
WantedBy=multi-user.target default.target | ||
- path: /etc/containers/systemd/test.volume | ||
contents: | ||
inline: | | ||
[Volume] | ||
User=root | ||
Group=root | ||
Label=org.test.Key=quadlet-test-volume | ||
- path: /etc/containers/systemd/test.network | ||
contents: | ||
inline: | | ||
[Network] | ||
Subnet=172.16.0.0/24 | ||
Gateway=172.16.0.1 | ||
IPRange=172.16.0.0/28 | ||
Label=org.test.Key=quadlet-test-network |
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 @@ | ||
../../../data/commonlib.sh |
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,32 @@ | ||
#!/bin/bash | ||
## kola: | ||
## # We're pulling a container image from Quay.io | ||
## tags: "platform-independent needs-internet" | ||
# | ||
# Ensure that basic quadlet functionality works | ||
|
||
set -xeuo pipefail | ||
|
||
. $KOLA_EXT_DATA/commonlib.sh | ||
|
||
if [[ "$(podman volume inspect systemd-test | jq -r '.[0].Labels."org.test.Key"')" != "quadlet-test-volume" ]]; then | ||
fatal "Volume not correctly created" | ||
fi | ||
|
||
if [[ "$(podman network inspect systemd-test | jq -r '.[0].labels."org.test.Key"')" != "quadlet-test-network" ]]; then | ||
fatal "Network not correctly created" | ||
fi | ||
|
||
if [[ "$(podman inspect systemd-test | jq -r '.[0].ImageName')" != "registry.fedoraproject.org/fedora-minimal:latest" ]]; then | ||
fatal "Container not using the correct image" | ||
fi | ||
|
||
if [[ "$(podman inspect systemd-test | jq -r '.[0].NetworkSettings.Networks[].NetworkID')" != "systemd-test" ]]; then | ||
fatal "Container not using the correct network" | ||
fi | ||
|
||
if [[ "$(podman inspect systemd-test | jq -r '.[0].HostConfig.Binds[0]')" != "systemd-test:/data:rw,rprivate,nosuid,nodev,rbind" ]]; then | ||
fatal "Container not using the correct volume" | ||
fi | ||
|
||
ok "Successfully tested basic quadlet functionality" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we do have other tests that pull containers that are
exclusive: false
. This one is probably on the fence of "making meaningful changes to the system" or not so I could go either way.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. We'll setup networks for containers and volumes. This should not interact with other things but the more container related tests we merge the more likely we'll have issues.