Skip to content

Commit

Permalink
test: Add basic quadlet test
Browse files Browse the repository at this point in the history
  • Loading branch information
travier committed Feb 3, 2023
1 parent 402168f commit 2f4812c
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/kola/containers/quadlet/config.bu
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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
Volume=test.volume:/data
Exec=sleep 60

[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=value
- 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=value
1 change: 1 addition & 0 deletions tests/kola/containers/quadlet/data/commonlib.sh
22 changes: 22 additions & 0 deletions tests/kola/containers/quadlet/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/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 inspect systemd-test | jq -r '.[0].ImageName')" != "registry.fedoraproject.org/fedora-minimal:latest" ]]; then
fail "Container not correctly created"
fi

if [[ "$(podman volume inspect systemd-test | jq -r '.[0].Labels."org.test.Key"')" != "value" ]]; then
fail "Volume not correctly created"
fi

podman network ls

ok "Successfully test basic quadlet functionality"

0 comments on commit 2f4812c

Please sign in to comment.