1
0
mirror of https://github.com/containers/youki synced 2024-11-26 06:08:07 +01:00

Add initial tests for rootless podman (#2406)

This commit is contained in:
Yashodhan 2023-10-09 15:13:52 +05:30 committed by GitHub
parent a7b6d277c7
commit 04dc59f679
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 0 deletions

@ -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

@ -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

18
tests/rootless-tests/run.sh Executable file

@ -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