Skip to content

Commit

Permalink
Add initial tests for rootless podman (#2406)
Browse files Browse the repository at this point in the history
  • Loading branch information
YJDoc2 authored Oct 9, 2023
1 parent a7b6d27 commit 04dc59f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,26 @@ jobs:
run: just runtimetest rust-oci-tests-bin
- name: Validate tests on youki
run: just rust-oci-tests

rootless-podman-test:
runs-on: ubuntu-22.04
needs: [youki-build]
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install just
uses: taiki-e/install-action@just
- name: Install requirements
run: sudo env PATH=$PATH just ci-prepare
- name: Download youki binary
uses: actions/download-artifact@v3
with:
name: youki
- name: Add the permission to run
run: chmod +x ./youki
- name: Run tests
run: just test-rootless-podman
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ rust-oci-tests: youki-release runtimetest rust-oci-tests-bin
validate-rust-oci-runc: runtimetest rust-oci-tests-bin
{{ cwd }}/scripts/rust_integration_tests.sh runc

# test podman rootless works with youki
test-rootless-podman:
{{ cwd }}/tests/rootless-tests/run.sh {{ cwd }}/youki


# run containerd integration tests
containerd-test: youki-dev
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant up
Expand Down
18 changes: 18 additions & 0 deletions tests/rootless-tests/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This is a temporary test-collection for validating youki runs correctly with podman in rootless mode
# This will be moved to a proper rust based test crate, similar to rust-integration tests soon

set -ex

runtime=$1

podman rm --force --ignore create-test # remove if existing

podman create --runtime $runtime --name create-test hello-world
log=$(podman start -a create-test)
echo $log | grep "This message shows that your installation appears to be working correctly"
podman rm create-test

rand=$(head -c 10 /dev/random | base64)

log=$(podman run --runtime $runtime fedora echo "$rand")
echo $log | grep $rand

0 comments on commit 04dc59f

Please sign in to comment.